* [PATCH] xfs: simplify setting bio flags
@ 2019-10-25 17:42 Christoph Hellwig
2019-10-28 15:01 ` Brian Foster
2019-10-28 16:38 ` Darrick J. Wong
0 siblings, 2 replies; 3+ messages in thread
From: Christoph Hellwig @ 2019-10-25 17:42 UTC (permalink / raw)
To: linux-xfs
Stop using the deprecated bio_set_op_attrs helper, and use a single
argument to xfs_buf_ioapply_map for the operation and flags.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
fs/xfs/xfs_buf.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
index 9640e4174552..1e63dd3d1257 100644
--- a/fs/xfs/xfs_buf.c
+++ b/fs/xfs/xfs_buf.c
@@ -1261,8 +1261,7 @@ xfs_buf_ioapply_map(
int map,
int *buf_offset,
int *count,
- int op,
- int op_flags)
+ int op)
{
int page_index;
int total_nr_pages = bp->b_page_count;
@@ -1297,7 +1296,7 @@ xfs_buf_ioapply_map(
bio->bi_iter.bi_sector = sector;
bio->bi_end_io = xfs_buf_bio_end_io;
bio->bi_private = bp;
- bio_set_op_attrs(bio, op, op_flags);
+ bio->bi_opf = op;
for (; size && nr_pages; nr_pages--, page_index++) {
int rbytes, nbytes = PAGE_SIZE - offset;
@@ -1342,7 +1341,6 @@ _xfs_buf_ioapply(
{
struct blk_plug plug;
int op;
- int op_flags = 0;
int offset;
int size;
int i;
@@ -1384,15 +1382,14 @@ _xfs_buf_ioapply(
dump_stack();
}
}
- } else if (bp->b_flags & XBF_READ_AHEAD) {
- op = REQ_OP_READ;
- op_flags = REQ_RAHEAD;
} else {
op = REQ_OP_READ;
+ if (bp->b_flags & XBF_READ_AHEAD)
+ op |= REQ_RAHEAD;
}
/* we only use the buffer cache for meta-data */
- op_flags |= REQ_META;
+ op |= REQ_META;
/*
* Walk all the vectors issuing IO on them. Set up the initial offset
@@ -1404,7 +1401,7 @@ _xfs_buf_ioapply(
size = BBTOB(bp->b_length);
blk_start_plug(&plug);
for (i = 0; i < bp->b_map_count; i++) {
- xfs_buf_ioapply_map(bp, i, &offset, &size, op, op_flags);
+ xfs_buf_ioapply_map(bp, i, &offset, &size, op);
if (bp->b_error)
break;
if (size <= 0)
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: simplify setting bio flags
2019-10-25 17:42 [PATCH] xfs: simplify setting bio flags Christoph Hellwig
@ 2019-10-28 15:01 ` Brian Foster
2019-10-28 16:38 ` Darrick J. Wong
1 sibling, 0 replies; 3+ messages in thread
From: Brian Foster @ 2019-10-28 15:01 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-xfs
On Fri, Oct 25, 2019 at 07:42:13PM +0200, Christoph Hellwig wrote:
> Stop using the deprecated bio_set_op_attrs helper, and use a single
> argument to xfs_buf_ioapply_map for the operation and flags.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/xfs_buf.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 9640e4174552..1e63dd3d1257 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1261,8 +1261,7 @@ xfs_buf_ioapply_map(
> int map,
> int *buf_offset,
> int *count,
> - int op,
> - int op_flags)
> + int op)
> {
> int page_index;
> int total_nr_pages = bp->b_page_count;
> @@ -1297,7 +1296,7 @@ xfs_buf_ioapply_map(
> bio->bi_iter.bi_sector = sector;
> bio->bi_end_io = xfs_buf_bio_end_io;
> bio->bi_private = bp;
> - bio_set_op_attrs(bio, op, op_flags);
> + bio->bi_opf = op;
>
> for (; size && nr_pages; nr_pages--, page_index++) {
> int rbytes, nbytes = PAGE_SIZE - offset;
> @@ -1342,7 +1341,6 @@ _xfs_buf_ioapply(
> {
> struct blk_plug plug;
> int op;
> - int op_flags = 0;
> int offset;
> int size;
> int i;
> @@ -1384,15 +1382,14 @@ _xfs_buf_ioapply(
> dump_stack();
> }
> }
> - } else if (bp->b_flags & XBF_READ_AHEAD) {
> - op = REQ_OP_READ;
> - op_flags = REQ_RAHEAD;
> } else {
> op = REQ_OP_READ;
> + if (bp->b_flags & XBF_READ_AHEAD)
> + op |= REQ_RAHEAD;
> }
>
> /* we only use the buffer cache for meta-data */
> - op_flags |= REQ_META;
> + op |= REQ_META;
>
> /*
> * Walk all the vectors issuing IO on them. Set up the initial offset
> @@ -1404,7 +1401,7 @@ _xfs_buf_ioapply(
> size = BBTOB(bp->b_length);
> blk_start_plug(&plug);
> for (i = 0; i < bp->b_map_count; i++) {
> - xfs_buf_ioapply_map(bp, i, &offset, &size, op, op_flags);
> + xfs_buf_ioapply_map(bp, i, &offset, &size, op);
> if (bp->b_error)
> break;
> if (size <= 0)
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: simplify setting bio flags
2019-10-25 17:42 [PATCH] xfs: simplify setting bio flags Christoph Hellwig
2019-10-28 15:01 ` Brian Foster
@ 2019-10-28 16:38 ` Darrick J. Wong
1 sibling, 0 replies; 3+ messages in thread
From: Darrick J. Wong @ 2019-10-28 16:38 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-xfs
On Fri, Oct 25, 2019 at 07:42:13PM +0200, Christoph Hellwig wrote:
> Stop using the deprecated bio_set_op_attrs helper, and use a single
> argument to xfs_buf_ioapply_map for the operation and flags.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
> fs/xfs/xfs_buf.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/fs/xfs/xfs_buf.c b/fs/xfs/xfs_buf.c
> index 9640e4174552..1e63dd3d1257 100644
> --- a/fs/xfs/xfs_buf.c
> +++ b/fs/xfs/xfs_buf.c
> @@ -1261,8 +1261,7 @@ xfs_buf_ioapply_map(
> int map,
> int *buf_offset,
> int *count,
> - int op,
> - int op_flags)
> + int op)
> {
> int page_index;
> int total_nr_pages = bp->b_page_count;
> @@ -1297,7 +1296,7 @@ xfs_buf_ioapply_map(
> bio->bi_iter.bi_sector = sector;
> bio->bi_end_io = xfs_buf_bio_end_io;
> bio->bi_private = bp;
> - bio_set_op_attrs(bio, op, op_flags);
> + bio->bi_opf = op;
>
> for (; size && nr_pages; nr_pages--, page_index++) {
> int rbytes, nbytes = PAGE_SIZE - offset;
> @@ -1342,7 +1341,6 @@ _xfs_buf_ioapply(
> {
> struct blk_plug plug;
> int op;
> - int op_flags = 0;
> int offset;
> int size;
> int i;
> @@ -1384,15 +1382,14 @@ _xfs_buf_ioapply(
> dump_stack();
> }
> }
> - } else if (bp->b_flags & XBF_READ_AHEAD) {
> - op = REQ_OP_READ;
> - op_flags = REQ_RAHEAD;
> } else {
> op = REQ_OP_READ;
> + if (bp->b_flags & XBF_READ_AHEAD)
> + op |= REQ_RAHEAD;
> }
>
> /* we only use the buffer cache for meta-data */
> - op_flags |= REQ_META;
> + op |= REQ_META;
>
> /*
> * Walk all the vectors issuing IO on them. Set up the initial offset
> @@ -1404,7 +1401,7 @@ _xfs_buf_ioapply(
> size = BBTOB(bp->b_length);
> blk_start_plug(&plug);
> for (i = 0; i < bp->b_map_count; i++) {
> - xfs_buf_ioapply_map(bp, i, &offset, &size, op, op_flags);
> + xfs_buf_ioapply_map(bp, i, &offset, &size, op);
> if (bp->b_error)
> break;
> if (size <= 0)
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-10-28 16:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-25 17:42 [PATCH] xfs: simplify setting bio flags Christoph Hellwig
2019-10-28 15:01 ` Brian Foster
2019-10-28 16:38 ` Darrick J. Wong
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.