Re: [PATCH v3] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask

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

 



On 2025/7/16 11:04, chuguangqing wrote:
> Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags.
> This change improves code clarity and maintains by explicitly showing
> this flag in the supported flags mask.
> 
> Note that since FALLOC_FL_ALLOCATE_RANGE is defined as 0x00, this addition
> has no functional modifications.
> 
> Signed-off-by: chuguangqing <chuguangqing@xxxxxxxxxx>

OK, now it looks good to me. Feel free to add:

Reviewed-by: Zhang Yi <yi.zhang@xxxxxxxxxx>

> ---
>  fs/ext4/extents.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index b43aa82c1b39..46cbb8697252 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -4784,9 +4784,10 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
>  		return -EOPNOTSUPP;
>  
>  	/* Return error if mode is not supported */
> -	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
> -		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_COLLAPSE_RANGE |
> -		     FALLOC_FL_INSERT_RANGE | FALLOC_FL_WRITE_ZEROES))
> +	if (mode & ~(FALLOC_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
> +		     FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
> +		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE |
> +		     FALLOC_FL_WRITE_ZEROES))
>  		return -EOPNOTSUPP;
>  
>  	inode_lock(inode);





[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux