From 764421ac5b73a8b1cad058b4aff464da6c351fd4 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Tue, 1 Jul 2008 09:07:34 +0200 Subject: [PATCH] --- yaml --- r: 98631 b: refs/heads/master c: 18ce3751ccd488c78d3827e9f6bf54e6322676fb h: refs/heads/master i: 98629: ad1552fe059d9d19d8aed5d1af7af45f2a31b652 98627: 15f7847867ccbb457231a0714580dcccbf338c97 98623: d4439326de76f70897154e5ca835b35593c632ca v: v3 --- [refs] | 2 +- trunk/fs/buffer.c | 13 ++++++++----- trunk/include/linux/fs.h | 1 + 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index ab9775ce1912..ec89b3073e8d 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d585d0b9d73ed999cc7b8cf3cac4a5b01abb544e +refs/heads/master: 18ce3751ccd488c78d3827e9f6bf54e6322676fb diff --git a/trunk/fs/buffer.c b/trunk/fs/buffer.c index a073f3f4f013..0f51c0f7c266 100644 --- a/trunk/fs/buffer.c +++ b/trunk/fs/buffer.c @@ -821,7 +821,7 @@ 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, 1, &bh); + ll_rw_block(SWRITE_SYNC, 1, &bh); brelse(bh); spin_lock(lock); } @@ -2940,16 +2940,19 @@ 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) + if (rw == SWRITE || rw == SWRITE_SYNC) lock_buffer(bh); else if (test_set_buffer_locked(bh)) continue; - if (rw == WRITE || rw == SWRITE) { + if (rw == WRITE || rw == SWRITE || rw == SWRITE_SYNC) { if (test_clear_buffer_dirty(bh)) { bh->b_end_io = end_buffer_write_sync; get_bh(bh); - submit_bh(WRITE, bh); + if (rw == SWRITE_SYNC) + submit_bh(WRITE_SYNC, bh); + else + submit_bh(WRITE, bh); continue; } } else { @@ -2978,7 +2981,7 @@ int sync_dirty_buffer(struct buffer_head *bh) if (test_clear_buffer_dirty(bh)) { get_bh(bh); bh->b_end_io = end_buffer_write_sync; - ret = submit_bh(WRITE, bh); + ret = submit_bh(WRITE_SYNC, bh); wait_on_buffer(bh); if (buffer_eopnotsupp(bh)) { clear_buffer_eopnotsupp(bh); diff --git a/trunk/include/linux/fs.h b/trunk/include/linux/fs.h index 7c1080826832..d8e2762ed14d 100644 --- a/trunk/include/linux/fs.h +++ b/trunk/include/linux/fs.h @@ -83,6 +83,7 @@ extern int dir_notify_enable; #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) #define READ_META (READ | (1 << BIO_RW_META)) #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) +#define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC)) #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) #define SEL_IN 1