]> Pileus Git - ~andy/linux/blobdiff - fs/buffer.c
nfsd4: implement minimal SP4_MACH_CRED
[~andy/linux] / fs / buffer.c
index b4dcb34c9635ae61b747bb9d4816477a49a8d90a..d2a4d1bb2d57aec3999e494d52c4f765a0ae48e8 100644 (file)
@@ -865,8 +865,6 @@ try_again:
 
                /* Link the buffer to its page */
                set_bh_page(bh, page, offset);
-
-               init_buffer(bh, NULL, NULL);
        }
        return head;
 /*
@@ -2949,7 +2947,7 @@ static void guard_bh_eod(int rw, struct bio *bio, struct buffer_head *bh)
        }
 }
 
-int submit_bh(int rw, struct buffer_head * bh)
+int _submit_bh(int rw, struct buffer_head *bh, unsigned long bio_flags)
 {
        struct bio *bio;
        int ret = 0;
@@ -2979,15 +2977,20 @@ int submit_bh(int rw, struct buffer_head * bh)
        bio->bi_io_vec[0].bv_offset = bh_offset(bh);
 
        bio->bi_vcnt = 1;
-       bio->bi_idx = 0;
        bio->bi_size = bh->b_size;
 
        bio->bi_end_io = end_bio_bh_io_sync;
        bio->bi_private = bh;
+       bio->bi_flags |= bio_flags;
 
        /* Take care of bh's that straddle the end of the device */
        guard_bh_eod(rw, bio, bh);
 
+       if (buffer_meta(bh))
+               rw |= REQ_META;
+       if (buffer_prio(bh))
+               rw |= REQ_PRIO;
+
        bio_get(bio);
        submit_bio(rw, bio);
 
@@ -2997,6 +3000,12 @@ int submit_bh(int rw, struct buffer_head * bh)
        bio_put(bio);
        return ret;
 }
+EXPORT_SYMBOL_GPL(_submit_bh);
+
+int submit_bh(int rw, struct buffer_head *bh)
+{
+       return _submit_bh(rw, bh, 0);
+}
 EXPORT_SYMBOL(submit_bh);
 
 /**