Thread (12 messages) 12 messages, 4 authors, 2016-09-14

Re: [PATCH 2/3] block, dm-crypt, btrfs: Introduce bio_flags()

flat view

From: Christoph Hellwig <hch@lst.de>
Date: 2016-09-14 09:58:16
Also in: dm-devel, linux-btrfs

On Wed, Sep 14, 2016 at 10:45:36AM +0200, Bart Van Assche wrote:
quoted hunk ↗ jump to hunk
Introduce the bio_flags() macro. Ensure that the second argument of
bio_set_op_attrs() only contains flags and no operation. This patch
does not change any functionality.

Signed-off-by: Bart Van Assche <redacted>
Cc: Mike Christie <redacted>
Cc: Chris Mason <redacted> (maintainer:BTRFS FILE SYSTEM)
Cc: Josef Bacik <redacted> (maintainer:BTRFS FILE SYSTEM)
Cc: Mike Snitzer <redacted>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Damien Le Moal <redacted>
---
 drivers/md/dm-crypt.c     | 2 +-
 fs/btrfs/inode.c          | 5 +++--
 include/linux/blk_types.h | 3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 8742957..0448e7e 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1136,7 +1136,7 @@ static void clone_init(struct dm_crypt_io *io, struct bio *clone)
 	clone->bi_private = io;
 	clone->bi_end_io  = crypt_endio;
 	clone->bi_bdev    = cc->dev->bdev;
-	bio_set_op_attrs(clone, bio_op(io->base_bio), io->base_bio->bi_opf);
+	bio_set_op_attrs(clone, bio_op(io->base_bio), bio_flags(io->base_bio));
Given that bio_set_op_attrs calls bio_flags internall do we need
the call here as well?

The other option might be to check that we only get flags inside the
bio_flags space and let the caller sort it out, which sounds useful
to me.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help