Re: [PATCH 1/3] block: make sure discard bio is aligned with logical block size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Oct 28, 2018 at 08:51:31AM +0800, Ming Lei wrote:
> On Fri, Oct 26, 2018 at 09:44:15AM +0200, Christoph Hellwig wrote:
> > >  		if (req_sects > UINT_MAX >> 9)
> > > -			req_sects = UINT_MAX >> 9;
> > > +			req_sects = (UINT_MAX >> 9) & ~bs_mask;
> > 
> > Given that we have this same thing duplicated in write zeroes
> > what about a documented helper?
> 
> IMO, using UINT_MAX & bs_mask is better because it is self-explanatory
> in the context.

I don't think it is in any way.  I understand it because I know the
code, but there is nothing that documents why we do that.



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux