Merge branches 'acpica', 'acpidump', 'intel-idle', 'misc', 'module_acpi_driver-simpli...
[firefly-linux-kernel-4.4.55.git] / fs / fs-writeback.c
index 41a3ccff18d87bdfc3f65148e2f39f8067f3a8ce..be3efc4f64f4b8c556e1d6de5c2ff400f05731ab 100644 (file)
@@ -52,11 +52,6 @@ struct wb_writeback_work {
        struct completion *done;        /* set if the caller waits */
 };
 
-/*
- * We don't actually have pdflush, but this one is exported though /proc...
- */
-int nr_pdflush_threads;
-
 /**
  * writeback_in_progress - determine whether there is writeback in progress
  * @bdi: the device's backing_dev_info structure.
@@ -628,8 +623,8 @@ static long writeback_sb_inodes(struct super_block *sb,
                }
 
                /*
-                * Don't bother with new inodes or inodes beeing freed, first
-                * kind does not need peridic writeout yet, and for the latter
+                * Don't bother with new inodes or inodes being freed, first
+                * kind does not need periodic writeout yet, and for the latter
                 * kind writeout is handled by the freer.
                 */
                spin_lock(&inode->i_lock);
@@ -1315,6 +1310,8 @@ void writeback_inodes_sb_nr(struct super_block *sb,
                .reason                 = reason,
        };
 
+       if (sb->s_bdi == &noop_backing_dev_info)
+               return;
        WARN_ON(!rwsem_is_locked(&sb->s_umount));
        bdi_queue_work(sb->s_bdi, &work);
        wait_for_completion(&done);
@@ -1398,6 +1395,9 @@ void sync_inodes_sb(struct super_block *sb)
                .reason         = WB_REASON_SYNC,
        };
 
+       /* Nothing to do? */
+       if (sb->s_bdi == &noop_backing_dev_info)
+               return;
        WARN_ON(!rwsem_is_locked(&sb->s_umount));
 
        bdi_queue_work(sb->s_bdi, &work);