]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/gfs2/meta_io.c
Merge branch 'for-4.8/core' of git://git.kernel.dk/linux-block
[karo-tx-linux.git] / fs / gfs2 / meta_io.c
index 0448524c11bcfca005a874861235066de2a7242e..052c1132e5b6e821b4f6a75539660d8a1655b1f0 100644 (file)
@@ -37,8 +37,8 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb
 {
        struct buffer_head *bh, *head;
        int nr_underway = 0;
-       int write_op = REQ_META | REQ_PRIO |
-               (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : WRITE);
+       int write_flags = REQ_META | REQ_PRIO |
+               (wbc->sync_mode == WB_SYNC_ALL ? WRITE_SYNC : 0);
 
        BUG_ON(!PageLocked(page));
        BUG_ON(!page_has_buffers(page));
@@ -79,7 +79,7 @@ static int gfs2_aspace_writepage(struct page *page, struct writeback_control *wb
        do {
                struct buffer_head *next = bh->b_this_page;
                if (buffer_async_write(bh)) {
-                       submit_bh(write_op, bh);
+                       submit_bh(REQ_OP_WRITE, write_flags, bh);
                        nr_underway++;
                }
                bh = next;
@@ -213,7 +213,8 @@ static void gfs2_meta_read_endio(struct bio *bio)
  * Submit several consecutive buffer head I/O requests as a single bio I/O
  * request.  (See submit_bh_wbc.)
  */
-static void gfs2_submit_bhs(int rw, struct buffer_head *bhs[], int num)
+static void gfs2_submit_bhs(int op, int op_flags, struct buffer_head *bhs[],
+                           int num)
 {
        struct buffer_head *bh = bhs[0];
        struct bio *bio;
@@ -230,7 +231,8 @@ static void gfs2_submit_bhs(int rw, struct buffer_head *bhs[], int num)
                bio_add_page(bio, bh->b_page, bh->b_size, bh_offset(bh));
        }
        bio->bi_end_io = gfs2_meta_read_endio;
-       submit_bio(rw, bio);
+       bio_set_op_attrs(bio, op, op_flags);
+       submit_bio(bio);
 }
 
 /**
@@ -280,7 +282,7 @@ int gfs2_meta_read(struct gfs2_glock *gl, u64 blkno, int flags,
                }
        }
 
-       gfs2_submit_bhs(READ_SYNC | REQ_META | REQ_PRIO, bhs, num);
+       gfs2_submit_bhs(REQ_OP_READ, READ_SYNC | REQ_META | REQ_PRIO, bhs, num);
        if (!(flags & DIO_WAIT))
                return 0;
 
@@ -325,18 +327,19 @@ int gfs2_meta_wait(struct gfs2_sbd *sdp, struct buffer_head *bh)
        return 0;
 }
 
-void gfs2_remove_from_journal(struct buffer_head *bh, struct gfs2_trans *tr, int meta)
+void gfs2_remove_from_journal(struct buffer_head *bh, int meta)
 {
        struct address_space *mapping = bh->b_page->mapping;
        struct gfs2_sbd *sdp = gfs2_mapping2sbd(mapping);
        struct gfs2_bufdata *bd = bh->b_private;
+       struct gfs2_trans *tr = current->journal_info;
        int was_pinned = 0;
 
        if (test_clear_buffer_pinned(bh)) {
                trace_gfs2_pin(bd, 0);
                atomic_dec(&sdp->sd_log_pinned);
                list_del_init(&bd->bd_list);
-               if (meta)
+               if (meta == REMOVE_META)
                        tr->tr_num_buf_rm++;
                else
                        tr->tr_num_databuf_rm++;
@@ -376,7 +379,7 @@ void gfs2_meta_wipe(struct gfs2_inode *ip, u64 bstart, u32 blen)
                if (bh) {
                        lock_buffer(bh);
                        gfs2_log_lock(sdp);
-                       gfs2_remove_from_journal(bh, current->journal_info, 1);
+                       gfs2_remove_from_journal(bh, REMOVE_META);
                        gfs2_log_unlock(sdp);
                        unlock_buffer(bh);
                        brelse(bh);
@@ -447,7 +450,7 @@ struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen)
        if (buffer_uptodate(first_bh))
                goto out;
        if (!buffer_locked(first_bh))
-               ll_rw_block(READ_SYNC | REQ_META, 1, &first_bh);
+               ll_rw_block(REQ_OP_READ, READ_SYNC | REQ_META, 1, &first_bh);
 
        dblock++;
        extlen--;
@@ -456,7 +459,7 @@ struct buffer_head *gfs2_meta_ra(struct gfs2_glock *gl, u64 dblock, u32 extlen)
                bh = gfs2_getbuf(gl, dblock, CREATE);
 
                if (!buffer_uptodate(bh) && !buffer_locked(bh))
-                       ll_rw_block(READA | REQ_META, 1, &bh);
+                       ll_rw_block(REQ_OP_READ, READA | REQ_META, 1, &bh);
                brelse(bh);
                dblock++;
                extlen--;