Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031131AbbKDWJB (ORCPT ); Wed, 4 Nov 2015 17:09:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:60487 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030984AbbKDWIt (ORCPT ); Wed, 4 Nov 2015 17:08:49 -0500 From: mchristi@redhat.com To: linux-fsdevel@vger.kernel.org, dm-devel@redhat.com, linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, drbd-dev@lists.linbit.com Cc: Mike Christie Subject: [PATCH 12/32] xfs: prepare for bi_rw split Date: Wed, 4 Nov 2015 16:08:09 -0600 Message-Id: <1446674909-5371-13-git-send-email-mchristi@redhat.com> In-Reply-To: <1446674909-5371-1-git-send-email-mchristi@redhat.com> References: <1446674909-5371-1-git-send-email-mchristi@redhat.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2809 Lines: 104 From: Mike Christie This patch prepares xfs's submit_bio use for the next patches that split bi_rw into a operation and flags field. Instead of passing in a bitmap with both the operation and flags mixed in, the callers will now pass them in seperately. This patch modifies the code related to the submit_bio calls so the flags and operation are seperated. When this is done for all code, one of the later patches in the series will the actual submit_bio call, so the patches are bisectable. Signed-off-by: Mike Christie --- fs/xfs/xfs_buf.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c index 8ecffb3..0621d70 100644 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@ -1123,7 +1123,8 @@ xfs_buf_ioapply_map( int map, int *buf_offset, int *count, - int rw) + int op, + int op_flags) { int page_index; int total_nr_pages = bp->b_page_count; @@ -1186,7 +1187,7 @@ next_chunk: flush_kernel_vmap_range(bp->b_addr, xfs_buf_vmap_len(bp)); } - submit_bio(rw, bio); + submit_bio(op | op_flags, bio); if (size) goto next_chunk; } else { @@ -1206,7 +1207,8 @@ _xfs_buf_ioapply( struct xfs_buf *bp) { struct blk_plug plug; - int rw; + int op; + int op_flags = 0; int offset; int size; int i; @@ -1225,14 +1227,13 @@ _xfs_buf_ioapply( bp->b_ioend_wq = bp->b_target->bt_mount->m_buf_workqueue; if (bp->b_flags & XBF_WRITE) { + op = REQ_OP_WRITE; if (bp->b_flags & XBF_SYNCIO) - rw = WRITE_SYNC; - else - rw = WRITE; + op_flags = WRITE_SYNC; if (bp->b_flags & XBF_FUA) - rw |= REQ_FUA; + op_flags |= REQ_FUA; if (bp->b_flags & XBF_FLUSH) - rw |= REQ_FLUSH; + op_flags |= REQ_FLUSH; /* * Run the write verifier callback function if it exists. If @@ -1262,13 +1263,14 @@ _xfs_buf_ioapply( } } } else if (bp->b_flags & XBF_READ_AHEAD) { - rw = READA; + op = REQ_OP_READ; + op_flags = REQ_RAHEAD; } else { - rw = READ; + op = REQ_OP_READ; } /* we only use the buffer cache for meta-data */ - rw |= REQ_META; + op_flags |= REQ_META; /* * Walk all the vectors issuing IO on them. Set up the initial offset @@ -1280,7 +1282,7 @@ _xfs_buf_ioapply( size = BBTOB(bp->b_io_length); blk_start_plug(&plug); for (i = 0; i < bp->b_map_count; i++) { - xfs_buf_ioapply_map(bp, i, &offset, &size, rw); + xfs_buf_ioapply_map(bp, i, &offset, &size, op, op_flags); if (bp->b_error) break; if (size <= 0) -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/