linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.cz>
To: Anand Jain <anand.jain@oracle.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH v2 2/2] btrfs-progs: device delete to accept devid
Date: Wed, 30 Sep 2015 17:14:12 +0200	[thread overview]
Message-ID: <20150930151411.GI11442@suse.cz> (raw)
In-Reply-To: <1443564222-1641-1-git-send-email-anand.jain@oracle.com>

On Wed, Sep 30, 2015 at 06:03:42AM +0800, Anand Jain wrote:
> +struct btrfs_ioctl_vol_args_v3 {

Can we use struct btrfs_ioctl_vol_args_v2 for that purpose? It contains
the 'flags' so we can abuse the name field to store the device id and
set the flags accordingly.

> +	__s64 fd;
> +	char name[BTRFS_PATH_NAME_MAX + 1];
> +	__u64 devid;
> +};
> +
>  #define BTRFS_DEVICE_PATH_NAME_MAX 1024
>  
>  #define BTRFS_SUBVOL_CREATE_ASYNC	(1ULL << 0)
> @@ -683,6 +689,8 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
>                                    struct btrfs_ioctl_feature_flags[2])
>  #define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
>                                    struct btrfs_ioctl_feature_flags[3])
> +#define BTRFS_IOC_RM_DEV_V2	_IOW(BTRFS_IOCTL_MAGIC, 58, \
> +				   struct btrfs_ioctl_vol_args_v3)

And we can reuse the ioctl nmuber 11

#define BTRFS_IOC_RM_DEV_V2	_IOW(BTRFS_IOCTL_MAGIC, 11, \
				   struct btrfs_ioctl_vol_args_v2)

The vol_v2 structure is extensible so we can add more functionality
there and then I think it justifies the V2 interface bump.

  reply	other threads:[~2015-09-30 15:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-29 22:03 [PATCH v2 2/2] btrfs-progs: device delete to accept devid Anand Jain
2015-09-30 15:14 ` David Sterba [this message]
2015-10-06  9:45   ` 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=20150930151411.GI11442@suse.cz \
    --to=dsterba@suse.cz \
    --cc=anand.jain@oracle.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).