diff mbox

btrfs: ioctls would need unique id

Message ID 1387425992-15268-1-git-send-email-anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Anand Jain Dec. 19, 2013, 4:06 a.m. UTC
BTRFS_IOC_SET_FEATURES and BTRFS_IOC_GET_SUPPORTED_FEATURES
conflicts with BTRFS_IOC_GET_FEATURES

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 include/uapi/linux/btrfs.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Hugo Mills Dec. 19, 2013, 8:19 a.m. UTC | #1
On Thu, Dec 19, 2013 at 12:06:32PM +0800, Anand Jain wrote:
> BTRFS_IOC_SET_FEATURES and BTRFS_IOC_GET_SUPPORTED_FEATURES
> conflicts with BTRFS_IOC_GET_FEATURES
> 
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
>  include/uapi/linux/btrfs.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
> index 7d7f776..0fe736e 100644
> --- a/include/uapi/linux/btrfs.h
> +++ b/include/uapi/linux/btrfs.h
> @@ -634,9 +634,9 @@ struct btrfs_ioctl_fslist_args {
>  					struct btrfs_ioctl_fslist_args)
>  #define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
>  				   struct btrfs_ioctl_feature_flags)
> -#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
> +#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 58, \
>  				   struct btrfs_ioctl_feature_flags[2])
> -#define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
> +#define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 59, \
>  				   struct btrfs_ioctl_feature_flags[3])

   The ioctls are distinct as tehy are, as they have different-sized
parameters. Changing these numbers is changing the public interface,
which is a big no-no.

   Hugo.
David Sterba Dec. 19, 2013, 4:53 p.m. UTC | #2
On Thu, Dec 19, 2013 at 08:19:08AM +0000, Hugo Mills wrote:
> On Thu, Dec 19, 2013 at 12:06:32PM +0800, Anand Jain wrote:
> > BTRFS_IOC_SET_FEATURES and BTRFS_IOC_GET_SUPPORTED_FEATURES
> > conflicts with BTRFS_IOC_GET_FEATURES
> > 
> > Signed-off-by: Anand Jain <anand.jain@oracle.com>
> > ---
> >  include/uapi/linux/btrfs.h |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
> > index 7d7f776..0fe736e 100644
> > --- a/include/uapi/linux/btrfs.h
> > +++ b/include/uapi/linux/btrfs.h
> > @@ -634,9 +634,9 @@ struct btrfs_ioctl_fslist_args {
> >  					struct btrfs_ioctl_fslist_args)
> >  #define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
> >  				   struct btrfs_ioctl_feature_flags)
> > -#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
> > +#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 58, \
> >  				   struct btrfs_ioctl_feature_flags[2])
> > -#define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
> > +#define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 59, \
> >  				   struct btrfs_ioctl_feature_flags[3])
> 
>    The ioctls are distinct as tehy are, as they have different-sized
> parameters.

We're already using the trick to distinguish the ioctls by argument
size, so it's not strictly necessary to make the main numbers different.

> Changing these numbers is changing the public interface,
> which is a big no-no.

The related feature hasn't been merged yet so it's still time to change
them.

I'd say to keep it as it is now.

david
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index 7d7f776..0fe736e 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -634,9 +634,9 @@  struct btrfs_ioctl_fslist_args {
 					struct btrfs_ioctl_fslist_args)
 #define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
 				   struct btrfs_ioctl_feature_flags)
-#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \
+#define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 58, \
 				   struct btrfs_ioctl_feature_flags[2])
-#define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \
+#define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 59, \
 				   struct btrfs_ioctl_feature_flags[3])
 
 #endif /* _UAPI_LINUX_BTRFS_H */