This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / fs / fs-writeback.c
index 5f3ccf9..0e73e30 100644 (file)
@@ -396,19 +396,9 @@ restart:
        sb = sb_entry(super_blocks.prev);
        for (; sb != sb_entry(&super_blocks); sb = sb_entry(sb->s_list.prev)) {
                if (!list_empty(&sb->s_dirty) || !list_empty(&sb->s_io)) {
-                       /* we're making our own get_super here */
                        sb->s_count++;
                        spin_unlock(&sb_lock);
-                       /*
-                        * If we can't get the readlock, there's no sense in
-                        * waiting around, most of the time the FS is going to
-                        * be unmounted by the time it is released.
-                        */
-                       if (down_read_trylock(&sb->s_umount)) {
-                               if (sb->s_root)
-                                       sync_sb_inodes(sb, wbc);
-                               up_read(&sb->s_umount);
-                       }
+                       sync_sb_inodes(sb, wbc);
                        spin_lock(&sb_lock);
                        if (__put_super(sb))
                                goto restart;
@@ -433,15 +423,18 @@ restart:
  */
 void sync_inodes_sb(struct super_block *sb, int wait)
 {
+       struct page_state ps;
        struct writeback_control wbc = {
+               .bdi            = NULL,
                .sync_mode      = wait ? WB_SYNC_ALL : WB_SYNC_HOLD,
+               .older_than_this = NULL,
+               .nr_to_write    = 0,
        };
-       unsigned long nr_dirty = read_page_state(nr_dirty);
-       unsigned long nr_unstable = read_page_state(nr_unstable);
 
-       wbc.nr_to_write = nr_dirty + nr_unstable +
+       get_page_state(&ps);
+       wbc.nr_to_write = ps.nr_dirty + ps.nr_unstable +
                        (inodes_stat.nr_inodes - inodes_stat.nr_unused) +
-                       nr_dirty + nr_unstable;
+                       ps.nr_dirty + ps.nr_unstable;
        wbc.nr_to_write += wbc.nr_to_write / 2;         /* Bit more for luck */
        spin_lock(&inode_lock);
        sync_sb_inodes(sb, &wbc);