Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142029
b: refs/heads/master
c: 9cf6b72
h: refs/heads/master
i:
  142027: 94dc61a
v: v3
  • Loading branch information
Jens Axboe authored and Linus Torvalds committed Apr 6, 2009
1 parent 94e0575 commit db2cdb3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 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: a1f242524c3c1f5d40f1c9c343427e34d1aadd6e
refs/heads/master: 9cf6b720f84d6999ff9a514d0a939dd183846aaf
20 changes: 16 additions & 4 deletions trunk/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list)
{
struct buffer_head *bh;
struct list_head tmp;
struct address_space *mapping;
struct address_space *mapping, *prev_mapping = NULL;
int err = 0, err2;

INIT_LIST_HEAD(&tmp);
Expand All @@ -762,7 +762,18 @@ static int fsync_buffers_list(spinlock_t *lock, struct list_head *list)
* contents - it is a noop if I/O is still in
* flight on potentially older contents.
*/
ll_rw_block(SWRITE_SYNC, 1, &bh);
ll_rw_block(SWRITE_SYNC_PLUG, 1, &bh);

/*
* Kick off IO for the previous mapping. Note
* that we will not run the very last mapping,
* wait_on_buffer() will do that for us
* through sync_buffer().
*/
if (prev_mapping && prev_mapping != mapping)
blk_run_address_space(prev_mapping);
prev_mapping = mapping;

brelse(bh);
spin_lock(lock);
}
Expand Down Expand Up @@ -2957,12 +2968,13 @@ void ll_rw_block(int rw, int nr, struct buffer_head *bhs[])
for (i = 0; i < nr; i++) {
struct buffer_head *bh = bhs[i];

if (rw == SWRITE || rw == SWRITE_SYNC)
if (rw == SWRITE || rw == SWRITE_SYNC || rw == SWRITE_SYNC_PLUG)
lock_buffer(bh);
else if (!trylock_buffer(bh))
continue;

if (rw == WRITE || rw == SWRITE || rw == SWRITE_SYNC) {
if (rw == WRITE || rw == SWRITE || rw == SWRITE_SYNC ||
rw == SWRITE_SYNC_PLUG) {
if (test_clear_buffer_dirty(bh)) {
bh->b_end_io = end_buffer_write_sync;
get_bh(bh);
Expand Down

0 comments on commit db2cdb3

Please sign in to comment.