aboutsummaryrefslogtreecommitdiffstats
path: root/fs/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/buffer.c')
-rw-r--r--fs/buffer.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/fs/buffer.c b/fs/buffer.c
index b4dcb34c9635..d2a4d1bb2d57 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -865,8 +865,6 @@ try_again:
865 865
866 /* Link the buffer to its page */ 866 /* Link the buffer to its page */
867 set_bh_page(bh, page, offset); 867 set_bh_page(bh, page, offset);
868
869 init_buffer(bh, NULL, NULL);
870 } 868 }
871 return head; 869 return head;
872/* 870/*
@@ -2949,7 +2947,7 @@ static void guard_bh_eod(int rw, struct bio *bio, struct buffer_head *bh)
2949 } 2947 }
2950} 2948}
2951 2949
2952int submit_bh(int rw, struct buffer_head * bh) 2950int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags)
2953{ 2951{
2954 struct bio *bio; 2952 struct bio *bio;
2955 int ret = 0; 2953 int ret = 0;
@@ -2979,15 +2977,20 @@ int submit_bh(int rw, struct buffer_head * bh)
2979 bio->bi_io_vec[0].bv_offset = bh_offset(bh); 2977 bio->bi_io_vec[0].bv_offset = bh_offset(bh);
2980 2978
2981 bio->bi_vcnt = 1; 2979 bio->bi_vcnt = 1;
2982 bio->bi_idx = 0;
2983 bio->bi_size = bh->b_size; 2980 bio->bi_size = bh->b_size;
2984 2981
2985 bio->bi_end_io = end_bio_bh_io_sync; 2982 bio->bi_end_io = end_bio_bh_io_sync;
2986 bio->bi_private = bh; 2983 bio->bi_private = bh;
2984 bio->bi_flags |= bio_flags;
2987 2985
2988 /* Take care of bh's that straddle the end of the device */ 2986 /* Take care of bh's that straddle the end of the device */
2989 guard_bh_eod(rw, bio, bh); 2987 guard_bh_eod(rw, bio, bh);
2990 2988
2989 if (buffer_meta(bh))
2990 rw |= REQ_META;
2991 if (buffer_prio(bh))
2992 rw |= REQ_PRIO;
2993
2991 bio_get(bio); 2994 bio_get(bio);
2992 submit_bio(rw, bio); 2995 submit_bio(rw, bio);
2993 2996
@@ -2997,6 +3000,12 @@ int submit_bh(int rw, struct buffer_head * bh)
2997 bio_put(bio); 3000 bio_put(bio);
2998 return ret; 3001 return ret;
2999} 3002}
3003EXPORT_SYMBOL_GPL(_submit_bh);
3004
3005int submit_bh(int rw, struct buffer_head *bh)
3006{
3007 return _submit_bh(rw, bh, 0);
3008}
3000EXPORT_SYMBOL(submit_bh); 3009EXPORT_SYMBOL(submit_bh);
3001 3010
3002/** 3011/**