Re: [PATCH] btrfs: Use IS_ALIGNED in btrfs_truncate_block instead of opencoding it

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

 




On 2018年01月18日 20:47, Nikolay Borisov wrote:
> No functional changes, just makes the code more readable
> 
> Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx>

Reviewed-by: Qu Wenruo <wqu@xxxxxxxx>

Thanks,
Qu

> ---
>  fs/btrfs/inode.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 269d129ffb1f..e9690e2aba09 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -4775,8 +4775,8 @@ int btrfs_truncate_block(struct inode *inode, loff_t from, loff_t len,
>  	u64 block_start;
>  	u64 block_end;
>  
> -	if ((offset & (blocksize - 1)) == 0 &&
> -	    (!len || ((len & (blocksize - 1)) == 0)))
> +	if (IS_ALIGNED(offset, blocksize) &&
> +	    (!len || IS_ALIGNED(len, blocksize)))
>  		goto out;
>  
>  	block_start = round_down(from, blocksize);
> 

Attachment: signature.asc
Description: OpenPGP digital signature


[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