Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242347
b: refs/heads/master
c: 0f1b1fd
h: refs/heads/master
i:
  242345: 50af72a
  242343: bb711d0
v: v3
  • Loading branch information
Dave Chinner authored and Al Viro committed Mar 25, 2011
1 parent c03424b commit 4db3320
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 67a23c494621ff1d5431c3bc320947865b224625
refs/heads/master: 0f1b1fd86f6fd662e04da3e82a6780b226fcd0d1
18 changes: 11 additions & 7 deletions trunk/fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,9 @@ static void inode_wait_for_writeback(struct inode *inode)
}

/*
* Write out an inode's dirty pages. Called under inode_wb_list_lock. Either
* the caller has an active reference on the inode or the inode has I_WILL_FREE
* set.
* Write out an inode's dirty pages. Called under inode_wb_list_lock and
* inode->i_lock. Either the caller has an active reference on the inode or
* the inode has I_WILL_FREE set.
*
* If `wait' is set, wait on the writeout.
*
Expand All @@ -349,7 +349,9 @@ writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
unsigned dirty;
int ret;

spin_lock(&inode->i_lock);
assert_spin_locked(&inode_wb_list_lock);
assert_spin_locked(&inode->i_lock);

if (!atomic_read(&inode->i_count))
WARN_ON(!(inode->i_state & (I_WILL_FREE|I_FREEING)));
else
Expand All @@ -365,7 +367,6 @@ writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
* completed a full scan of b_io.
*/
if (wbc->sync_mode != WB_SYNC_ALL) {
spin_unlock(&inode->i_lock);
requeue_io(inode);
return 0;
}
Expand Down Expand Up @@ -456,7 +457,6 @@ writeback_single_inode(struct inode *inode, struct writeback_control *wbc)
}
}
inode_sync_complete(inode);
spin_unlock(&inode->i_lock);
return ret;
}

Expand Down Expand Up @@ -544,7 +544,6 @@ static int writeback_sb_inodes(struct super_block *sb, struct bdi_writeback *wb,
}

__iget(inode);
spin_unlock(&inode->i_lock);

pages_skipped = wbc->pages_skipped;
writeback_single_inode(inode, wbc);
Expand All @@ -555,6 +554,7 @@ static int writeback_sb_inodes(struct super_block *sb, struct bdi_writeback *wb,
*/
redirty_tail(inode);
}
spin_unlock(&inode->i_lock);
spin_unlock(&inode_wb_list_lock);
iput(inode);
cond_resched();
Expand Down Expand Up @@ -1309,7 +1309,9 @@ int write_inode_now(struct inode *inode, int sync)

might_sleep();
spin_lock(&inode_wb_list_lock);
spin_lock(&inode->i_lock);
ret = writeback_single_inode(inode, &wbc);
spin_unlock(&inode->i_lock);
spin_unlock(&inode_wb_list_lock);
if (sync)
inode_sync_wait(inode);
Expand All @@ -1333,7 +1335,9 @@ int sync_inode(struct inode *inode, struct writeback_control *wbc)
int ret;

spin_lock(&inode_wb_list_lock);
spin_lock(&inode->i_lock);
ret = writeback_single_inode(inode, wbc);
spin_unlock(&inode->i_lock);
spin_unlock(&inode_wb_list_lock);
return ret;
}
Expand Down

0 comments on commit 4db3320

Please sign in to comment.