[2/3] btrfs: use ioctl args support mask for subvolume create/delete
diff mbox series

Message ID 4b8a60420b7da2f62f04969541b3405fc14914e6.1582289899.git.dsterba@suse.com
State New
Headers show
Series
  • Clean up supported flags for ioctls
Related show

Commit Message

David Sterba Feb. 21, 2020, 1:02 p.m. UTC
Using the defined mask instead of flag enumeration in the ioctl handler
is preferred. No functional changes.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/ioctl.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Marcos Paulo de Souza Feb. 21, 2020, 1:21 p.m. UTC | #1
On Fri, 2020-02-21 at 14:02 +0100, David Sterba wrote:
> Using the defined mask instead of flag enumeration in the ioctl
> handler
> is preferred. No functional changes.
> 
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
>  fs/btrfs/ioctl.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 7305e6770157..a7872cacd0aa 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -1838,9 +1838,7 @@ static noinline int
> btrfs_ioctl_snap_create_v2(struct file *file,
>  		return PTR_ERR(vol_args);
>  	vol_args->name[BTRFS_SUBVOL_NAME_MAX] = '\0';
>  
> -	if (vol_args->flags &
> -	    ~(BTRFS_SUBVOL_CREATE_ASYNC | BTRFS_SUBVOL_RDONLY |
> -	      BTRFS_SUBVOL_QGROUP_INHERIT)) {
> +	if (vol_args->flags & ~BTRFS_SUBVOL_CREATE_ARGS_MASK) {
>  		ret = -EOPNOTSUPP;
>  		goto free_args;
>  	}

Looks good to me,
Reviewed-by: Marcos Paulo de Souza <mpdesouza@suse.com>

Patch
diff mbox series

diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 7305e6770157..a7872cacd0aa 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1838,9 +1838,7 @@  static noinline int btrfs_ioctl_snap_create_v2(struct file *file,
 		return PTR_ERR(vol_args);
 	vol_args->name[BTRFS_SUBVOL_NAME_MAX] = '\0';
 
-	if (vol_args->flags &
-	    ~(BTRFS_SUBVOL_CREATE_ASYNC | BTRFS_SUBVOL_RDONLY |
-	      BTRFS_SUBVOL_QGROUP_INHERIT)) {
+	if (vol_args->flags & ~BTRFS_SUBVOL_CREATE_ARGS_MASK) {
 		ret = -EOPNOTSUPP;
 		goto free_args;
 	}