lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 6 Jun 2016 08:51:01 +0200
From:	Hannes Reinecke <hare@...e.de>
To:	mchristi@...hat.com, linux-f2fs-devel@...ts.sourceforge.net,
	linux-ext4@...r.kernel.org, konrad.wilk@...cle.com,
	drbd-dev@...ts.linbit.com, philipp.reisner@...bit.com,
	lars.ellenberg@...bit.com, linux-raid@...r.kernel.org,
	dm-devel@...hat.com, linux-fsdevel@...r.kernel.org,
	linux-bcache@...r.kernel.org, linux-block@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-scsi@...r.kernel.org,
	linux-mtd@...ts.infradead.org, target-devel@...r.kernel.org,
	linux-btrfs@...r.kernel.org, osd-dev@...n-osd.org, xfs@....sgi.com,
	ocfs2-devel@....oracle.com
Subject: Re: [PATCH 40/45] block: move bio io prio to a new field

On 06/05/2016 09:32 PM, mchristi@...hat.com wrote:
> From: Mike Christie <mchristi@...hat.com>
> 
> In the next patch, we move drop the compat code and make
> the op a separate value that is hidden in bi_rw. To give
> the op and rq bits flags room to grow this moves prio to
> its own field.
> 
> Signed-off-by: Mike Christie <mchristi@...hat.com>
> ---
>  include/linux/bio.h       | 14 ++------------
>  include/linux/blk_types.h |  5 ++---
>  2 files changed, 4 insertions(+), 15 deletions(-)
> 
> diff --git a/include/linux/bio.h b/include/linux/bio.h
> index 4568647..35108c2 100644
> --- a/include/linux/bio.h
> +++ b/include/linux/bio.h
> @@ -47,18 +47,8 @@
>  #define bio_op(bio)				(op_from_rq_bits((bio)->bi_rw))
>  #define bio_set_op_attrs(bio, op, flags)	((bio)->bi_rw |= (op | flags))
>  
> -/*
> - * upper 16 bits of bi_rw define the io priority of this bio
> - */
> -#define BIO_PRIO_SHIFT	(8 * sizeof(unsigned long) - IOPRIO_BITS)
> -#define bio_prio(bio)	((bio)->bi_rw >> BIO_PRIO_SHIFT)
> -#define bio_prio_valid(bio)	ioprio_valid(bio_prio(bio))
> -
> -#define bio_set_prio(bio, prio)		do {			\
> -	WARN_ON(prio >= (1 << IOPRIO_BITS));			\
> -	(bio)->bi_rw &= ((1UL << BIO_PRIO_SHIFT) - 1);		\
> -	(bio)->bi_rw |= ((unsigned long) (prio) << BIO_PRIO_SHIFT);	\
> -} while (0)
> +#define bio_prio(bio)			(bio)->bi_ioprio
> +#define bio_set_prio(bio, prio)		((bio)->bi_ioprio = prio)
>  
>  /*
>   * various member access, note that bio_data should of course not be used
> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
> index 6e60baa..2738413 100644
> --- a/include/linux/blk_types.h
> +++ b/include/linux/blk_types.h
> @@ -48,9 +48,8 @@ struct bio {
>  	struct block_device	*bi_bdev;
>  	unsigned int		bi_flags;	/* status, command, etc */
>  	int			bi_error;
> -	unsigned long		bi_rw;		/* bottom bits READ/WRITE,
> -						 * top bits priority
> -						 */
> +	unsigned long		bi_rw;		/* READ/WRITE */
> +	unsigned short		bi_ioprio;
>  
>  	struct bvec_iter	bi_iter;
>  
> 
Reviewed-by: Hannes Reinecke <hare@...e.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@...e.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ