diff options
author | Christoph Hellwig <hch@lst.de> | 2010-08-11 11:05:45 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2010-08-18 01:09:00 -0400 |
commit | 87e99511ea54510ffb60b98001d108794d5037f8 (patch) | |
tree | 359228828515e02302d9b259a066a1f1118eba0a /fs/buffer.c | |
parent | dad5eb6daa7eeb63d4fc9d982892c59faa07e797 (diff) |
kill BH_Ordered flag
Instead of abusing a buffer_head flag just add a variant of
sync_dirty_buffer which allows passing the exact type of write
flag required.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/buffer.c')
-rw-r--r-- | fs/buffer.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/fs/buffer.c b/fs/buffer.c index 50efa339e051..6c8ad977f3d4 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
@@ -2912,13 +2912,6 @@ int submit_bh(int rw, struct buffer_head * bh) | |||
2912 | BUG_ON(buffer_unwritten(bh)); | 2912 | BUG_ON(buffer_unwritten(bh)); |
2913 | 2913 | ||
2914 | /* | 2914 | /* |
2915 | * Mask in barrier bit for a write (could be either a WRITE or a | ||
2916 | * WRITE_SYNC | ||
2917 | */ | ||
2918 | if (buffer_ordered(bh) && (rw & WRITE)) | ||
2919 | rw |= WRITE_BARRIER; | ||
2920 | |||
2921 | /* | ||
2922 | * Only clear out a write error when rewriting | 2915 | * Only clear out a write error when rewriting |
2923 | */ | 2916 | */ |
2924 | if (test_set_buffer_req(bh) && (rw & WRITE)) | 2917 | if (test_set_buffer_req(bh) && (rw & WRITE)) |
@@ -3021,7 +3014,7 @@ EXPORT_SYMBOL(ll_rw_block); | |||
3021 | * and then start new I/O and then wait upon it. The caller must have a ref on | 3014 | * and then start new I/O and then wait upon it. The caller must have a ref on |
3022 | * the buffer_head. | 3015 | * the buffer_head. |
3023 | */ | 3016 | */ |
3024 | int sync_dirty_buffer(struct buffer_head *bh) | 3017 | int __sync_dirty_buffer(struct buffer_head *bh, int rw) |
3025 | { | 3018 | { |
3026 | int ret = 0; | 3019 | int ret = 0; |
3027 | 3020 | ||
@@ -3030,7 +3023,7 @@ int sync_dirty_buffer(struct buffer_head *bh) | |||
3030 | if (test_clear_buffer_dirty(bh)) { | 3023 | if (test_clear_buffer_dirty(bh)) { |
3031 | get_bh(bh); | 3024 | get_bh(bh); |
3032 | bh->b_end_io = end_buffer_write_sync; | 3025 | bh->b_end_io = end_buffer_write_sync; |
3033 | ret = submit_bh(WRITE_SYNC, bh); | 3026 | ret = submit_bh(rw, bh); |
3034 | wait_on_buffer(bh); | 3027 | wait_on_buffer(bh); |
3035 | if (buffer_eopnotsupp(bh)) { | 3028 | if (buffer_eopnotsupp(bh)) { |
3036 | clear_buffer_eopnotsupp(bh); | 3029 | clear_buffer_eopnotsupp(bh); |
@@ -3043,6 +3036,12 @@ int sync_dirty_buffer(struct buffer_head *bh) | |||
3043 | } | 3036 | } |
3044 | return ret; | 3037 | return ret; |
3045 | } | 3038 | } |
3039 | EXPORT_SYMBOL(__sync_dirty_buffer); | ||
3040 | |||
3041 | int sync_dirty_buffer(struct buffer_head *bh) | ||
3042 | { | ||
3043 | return __sync_dirty_buffer(bh, WRITE_SYNC); | ||
3044 | } | ||
3046 | EXPORT_SYMBOL(sync_dirty_buffer); | 3045 | EXPORT_SYMBOL(sync_dirty_buffer); |
3047 | 3046 | ||
3048 | /* | 3047 | /* |