On Wed, Sep 14, 2016 at 10:45:36AM +0200, Bart Van Assche wrote:
> 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 <[email protected]>
> Cc: Mike Christie <[email protected]>
> Cc: Chris Mason <[email protected]> (maintainer:BTRFS FILE SYSTEM)
> Cc: Josef Bacik <[email protected]> (maintainer:BTRFS FILE SYSTEM)
> Cc: Mike Snitzer <[email protected]>
> Cc: Christoph Hellwig <[email protected]>
> Cc: Hannes Reinecke <[email protected]>
> Cc: Damien Le Moal <[email protected]>
> ---
>  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.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to