Re: [PATCH v4 1/2] btrfs: volumes: Use more straightforward way to calculate map length

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

 



On Fri, Oct 25, 2019 at 04:59:55PM +0800, Qu Wenruo wrote:
> The old code goes:
> 
>  	offset = logical - em->start;
> 	length = min_t(u64, em->len - offset, length);
> 
> Where @length calculate is dependent on offset, it can take reader
> several more seconds to find it's just the same code as:
> 
>  	offset = logical - em->start;
> 	length = min_t(u64, em->start + em->len - logical, length);
> 
> Use above code to make the length calculate independent from other
> variable, thus slightly increase the readability.
> 
> Signed-off-by: Qu Wenruo <wqu@xxxxxxxx>

Reviewed-by: Josef Bacik <josef@xxxxxxxxxxxxxx>

Thanks,

Josef



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux