[PATCH] lockdep: annotate qeth driver
[pandora-kernel.git] / fs / fs-writeback.c
index c27f8d4..892643d 100644 (file)
@@ -381,8 +381,8 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc)
                        list_move(&inode->i_list, &sb->s_dirty);
                }
                spin_unlock(&inode_lock);
-               cond_resched();
                iput(inode);
+               cond_resched();
                spin_lock(&inode_lock);
                if (wbc->nr_to_write <= 0)
                        break;
@@ -461,9 +461,11 @@ void sync_inodes_sb(struct super_block *sb, int wait)
 {
        struct writeback_control wbc = {
                .sync_mode      = wait ? WB_SYNC_ALL : WB_SYNC_HOLD,
+               .range_start    = 0,
+               .range_end      = LLONG_MAX,
        };
-       unsigned long nr_dirty = read_page_state(nr_dirty);
-       unsigned long nr_unstable = read_page_state(nr_unstable);
+       unsigned long nr_dirty = global_page_state(NR_FILE_DIRTY);
+       unsigned long nr_unstable = global_page_state(NR_UNSTABLE_NFS);
 
        wbc.nr_to_write = nr_dirty + nr_unstable +
                        (inodes_stat.nr_inodes - inodes_stat.nr_unused) +
@@ -559,10 +561,12 @@ int write_inode_now(struct inode *inode, int sync)
        struct writeback_control wbc = {
                .nr_to_write = LONG_MAX,
                .sync_mode = WB_SYNC_ALL,
+               .range_start = 0,
+               .range_end = LLONG_MAX,
        };
 
        if (!mapping_cap_writeback_dirty(inode->i_mapping))
-               return 0;
+               wbc.nr_to_write = 0;
 
        might_sleep();
        spin_lock(&inode_lock);
@@ -606,7 +610,7 @@ EXPORT_SYMBOL(sync_inode);
  * O_SYNC flag set, to flush dirty writes to disk.
  *
  * @what is a bitmask, specifying which part of the inode's data should be
- * written and waited upon:
+ * written and waited upon.
  *
  *    OSYNC_DATA:     i_mapping's dirty data
  *    OSYNC_METADATA: the buffers at i_mapping->private_list
@@ -619,7 +623,6 @@ int generic_osync_inode(struct inode *inode, struct address_space *mapping, int
        int need_write_inode_now = 0;
        int err2;
 
-       current->flags |= PF_SYNCWRITE;
        if (what & OSYNC_DATA)
                err = filemap_fdatawrite(mapping);
        if (what & (OSYNC_METADATA|OSYNC_DATA)) {
@@ -632,7 +635,6 @@ int generic_osync_inode(struct inode *inode, struct address_space *mapping, int
                if (!err)
                        err = err2;
        }
-       current->flags &= ~PF_SYNCWRITE;
 
        spin_lock(&inode_lock);
        if ((inode->i_state & I_DIRTY) &&
@@ -672,8 +674,9 @@ int writeback_acquire(struct backing_dev_info *bdi)
 
 /**
  * writeback_in_progress: determine whether there is writeback in progress
- *                        against a backing device.
  * @bdi: the device's backing_dev_info structure.
+ *
+ * Determine whether there is writeback in progress against a backing device.
  */
 int writeback_in_progress(struct backing_dev_info *bdi)
 {