From: Anand Jain <anand.jain@oracle.com>
To: David Sterba <dsterba@suse.com>, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 15/15] btrfs: rename flags for vol args v2
Date: Tue, 16 Feb 2016 17:18:12 +0800 [thread overview]
Message-ID: <56C2E954.4030202@oracle.com> (raw)
In-Reply-To: <533b0847dc15f8d719aaf6198cf18953899f2164.1455556900.git.dsterba@suse.com>
..
On 02/16/2016 01:34 AM, David Sterba wrote:
> Rename BTRFS_DEVICE_BY_ID so it's more descriptive that we specify the
> device by id, it'll be part of the public API. The mask of supported
> flags is also renamed, only for internal use.
>
> The error code for unknown flags is EOPNOTSUPP, fixed.
>
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
> fs/btrfs/ioctl.c | 8 ++++----
> include/uapi/linux/btrfs.h | 7 ++++---
> 2 files changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 57fb05960435..6bcd7700b9fd 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -2689,8 +2689,8 @@ static long btrfs_ioctl_rm_dev_v2(struct file *file, void __user *arg)
> }
>
> /* Check for compatibility reject unknown flags */
> - if (vol_args->flags & ~BTRFS_VOL_ARG_V2_FLAGS)
> - return -ENOTTY;
> + if (vol_args->flags & ~BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED)
> + return -EOPNOTSUPP;
>
> if (atomic_xchg(&root->fs_info->mutually_exclusive_operation_running,
> 1)) {
> @@ -2699,7 +2699,7 @@ static long btrfs_ioctl_rm_dev_v2(struct file *file, void __user *arg)
> }
>
> mutex_lock(&root->fs_info->volume_mutex);
> - if (vol_args->flags & BTRFS_DEVICE_BY_ID) {
> + if (vol_args->flags & BTRFS_DEVICE_SPEC_BY_ID) {
> ret = btrfs_rm_device(root, NULL, vol_args->devid);
> } else {
> vol_args->name[BTRFS_PATH_NAME_MAX] = '\0';
> @@ -2709,7 +2709,7 @@ static long btrfs_ioctl_rm_dev_v2(struct file *file, void __user *arg)
> atomic_set(&root->fs_info->mutually_exclusive_operation_running, 0);
>
> if (!ret) {
> - if (vol_args->flags & BTRFS_DEVICE_BY_ID)
> + if (vol_args->flags & BTRFS_DEVICE_SPEC_BY_ID)
> btrfs_info(root->fs_info, "device deleted: id %llu",
> vol_args->devid);
> else
> diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
> index 396a4efca775..3975e683af72 100644
> --- a/include/uapi/linux/btrfs.h
> +++ b/include/uapi/linux/btrfs.h
> @@ -36,12 +36,13 @@ struct btrfs_ioctl_vol_args {
> #define BTRFS_SUBVOL_CREATE_ASYNC (1ULL << 0)
> #define BTRFS_SUBVOL_RDONLY (1ULL << 1)
> #define BTRFS_SUBVOL_QGROUP_INHERIT (1ULL << 2)
> -#define BTRFS_DEVICE_BY_ID (1ULL << 3)
> -#define BTRFS_VOL_ARG_V2_FLAGS \
> +#define BTRFS_DEVICE_SPEC_BY_ID (1ULL << 3)
> +
Just checked next/delete-by-id-v3.
You may consider to update progs as well.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Thanks, Anand
> +#define BTRFS_VOL_ARG_V2_FLAGS_SUPPORTED \
> (BTRFS_SUBVOL_CREATE_ASYNC | \
> BTRFS_SUBVOL_RDONLY | \
> BTRFS_SUBVOL_QGROUP_INHERIT | \
> - BTRFS_DEVICE_BY_ID)
> + BTRFS_DEVICE_SPEC_BY_ID)
>
> #define BTRFS_FSID_SIZE 16
> #define BTRFS_UUID_SIZE 16
>
next prev parent reply other threads:[~2016-02-16 9:18 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-15 17:33 [PATCH 00/15] Device delete by id David Sterba
2016-02-15 17:33 ` [PATCH 01/15] btrfs: create a helper function to read the disk super David Sterba
2016-02-15 17:34 ` [PATCH 02/15] btrfs: create helper function __check_raid_min_devices() David Sterba
2016-02-15 17:34 ` [PATCH 03/15] btrfs: clean up and optimize __check_raid_min_device() David Sterba
2016-02-15 17:34 ` [PATCH 04/15] btrfs: create helper btrfs_find_device_by_user_input() David Sterba
2016-02-15 17:34 ` [PATCH 05/15] btrfs: make use of btrfs_find_device_by_user_input() David Sterba
2016-02-15 17:34 ` [PATCH 06/15] btrfs: enhance btrfs_find_device_by_user_input() to check device path David Sterba
2016-02-15 17:34 ` [PATCH 07/15] btrfs: make use of btrfs_scratch_superblocks() in btrfs_rm_device() David Sterba
2016-02-15 17:34 ` [PATCH 08/15] btrfs: introduce device delete by devid David Sterba
2016-02-15 17:34 ` [PATCH 09/15] btrfs: optimize check for stale device David Sterba
2016-02-15 17:34 ` [PATCH 10/15] btrfs: rename __check_raid_min_devices David Sterba
2016-02-16 9:07 ` Anand Jain
2016-02-15 17:34 ` [PATCH 11/15] btrfs: pass number of devices to btrfs_check_raid_min_devices David Sterba
2016-02-16 9:08 ` Anand Jain
2016-02-15 17:34 ` [PATCH 12/15] btrfs: indtroduce raid-type to error-code table, for minimum device constraint David Sterba
2016-02-16 9:09 ` Anand Jain
2016-02-15 17:34 ` [PATCH 13/15] btrfs: use existing device constraints table btrfs_raid_array David Sterba
2016-02-16 9:13 ` Anand Jain
2016-02-15 17:34 ` [PATCH 14/15] btrfs: rename btrfs_find_device_by_user_input David Sterba
2016-02-16 9:14 ` Anand Jain
2016-02-15 17:34 ` [PATCH 15/15] btrfs: rename flags for vol args v2 David Sterba
2016-02-16 9:18 ` Anand Jain [this message]
2016-02-16 9:43 ` David Sterba
2016-02-25 17:59 ` [PATCH 00/15] Device delete by id David Sterba
2016-03-11 8:16 ` Anand Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56C2E954.4030202@oracle.com \
--to=anand.jain@oracle.com \
--cc=dsterba@suse.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).