* [PATCH 1/2] btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls
@ 2016-02-18 13:25 David Sterba
2016-02-18 13:25 ` [PATCH 2/2] btrfs: drop unused argument in btrfs_ioctl_get_supported_features David Sterba
2016-02-20 10:24 ` [PATCH 1/2] btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls Anand Jain
0 siblings, 2 replies; 4+ messages in thread
From: David Sterba @ 2016-02-18 13:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
The control device is accessible when no filesystem is mounted and we
may want to query features supported by the module. This is already
possible using the sysfs files, this ioctl is for parity and
convenience.
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/ctree.h | 1 +
fs/btrfs/ioctl.c | 3 +--
fs/btrfs/super.c | 4 ++++
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index bfe4a337fb4d..47bc50fd4f55 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -4089,6 +4089,7 @@ void btrfs_test_inode_set_ops(struct inode *inode);
/* ioctl.c */
long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
+int btrfs_ioctl_get_supported_features(struct file *file, void __user *arg);
void btrfs_update_iflags(struct inode *inode);
void btrfs_inherit_iflags(struct inode *inode, struct inode *dir);
int btrfs_is_empty_uuid(u8 *uuid);
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 952172ca7e45..f4c6ed5c5300 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -5187,8 +5187,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg)
.compat_ro_flags = BTRFS_FEATURE_COMPAT_RO_##suffix, \
.incompat_flags = BTRFS_FEATURE_INCOMPAT_##suffix }
-static int btrfs_ioctl_get_supported_features(struct file *file,
- void __user *arg)
+int btrfs_ioctl_get_supported_features(struct file *file, void __user *arg)
{
static const struct btrfs_ioctl_feature_flags features[3] = {
INIT_FEATURE_FLAGS(SUPP),
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index d41e09fe8e38..dda6f64dfd73 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -2163,6 +2163,10 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
break;
ret = !(fs_devices->num_devices == fs_devices->total_devices);
break;
+ case BTRFS_IOC_GET_SUPPORTED_FEATURES:
+ ret = btrfs_ioctl_get_supported_features(NULL,
+ (void __user*)arg);
+ break;
}
kfree(vol);
--
2.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] btrfs: drop unused argument in btrfs_ioctl_get_supported_features
2016-02-18 13:25 [PATCH 1/2] btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls David Sterba
@ 2016-02-18 13:25 ` David Sterba
2016-02-20 10:25 ` Anand Jain
2016-02-20 10:24 ` [PATCH 1/2] btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls Anand Jain
1 sibling, 1 reply; 4+ messages in thread
From: David Sterba @ 2016-02-18 13:25 UTC (permalink / raw)
To: linux-btrfs; +Cc: David Sterba
Signed-off-by: David Sterba <dsterba@suse.com>
---
fs/btrfs/ctree.h | 2 +-
fs/btrfs/ioctl.c | 4 ++--
fs/btrfs/super.c | 3 +--
3 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 47bc50fd4f55..82ce847318ae 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -4089,7 +4089,7 @@ void btrfs_test_inode_set_ops(struct inode *inode);
/* ioctl.c */
long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
-int btrfs_ioctl_get_supported_features(struct file *file, void __user *arg);
+int btrfs_ioctl_get_supported_features(void __user *arg);
void btrfs_update_iflags(struct inode *inode);
void btrfs_inherit_iflags(struct inode *inode, struct inode *dir);
int btrfs_is_empty_uuid(u8 *uuid);
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index f4c6ed5c5300..dcda7ea1e928 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -5187,7 +5187,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg)
.compat_ro_flags = BTRFS_FEATURE_COMPAT_RO_##suffix, \
.incompat_flags = BTRFS_FEATURE_INCOMPAT_##suffix }
-int btrfs_ioctl_get_supported_features(struct file *file, void __user *arg)
+int btrfs_ioctl_get_supported_features(void __user *arg)
{
static const struct btrfs_ioctl_feature_flags features[3] = {
INIT_FEATURE_FLAGS(SUPP),
@@ -5466,7 +5466,7 @@ long btrfs_ioctl(struct file *file, unsigned int
case BTRFS_IOC_SET_FSLABEL:
return btrfs_ioctl_set_fslabel(file, argp);
case BTRFS_IOC_GET_SUPPORTED_FEATURES:
- return btrfs_ioctl_get_supported_features(file, argp);
+ return btrfs_ioctl_get_supported_features(argp);
case BTRFS_IOC_GET_FEATURES:
return btrfs_ioctl_get_features(file, argp);
case BTRFS_IOC_SET_FEATURES:
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index dda6f64dfd73..737e6a85c71e 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -2164,8 +2164,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
ret = !(fs_devices->num_devices == fs_devices->total_devices);
break;
case BTRFS_IOC_GET_SUPPORTED_FEATURES:
- ret = btrfs_ioctl_get_supported_features(NULL,
- (void __user*)arg);
+ ret = btrfs_ioctl_get_supported_features((void __user*)arg);
break;
}
--
2.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls
2016-02-18 13:25 [PATCH 1/2] btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls David Sterba
2016-02-18 13:25 ` [PATCH 2/2] btrfs: drop unused argument in btrfs_ioctl_get_supported_features David Sterba
@ 2016-02-20 10:24 ` Anand Jain
1 sibling, 0 replies; 4+ messages in thread
From: Anand Jain @ 2016-02-20 10:24 UTC (permalink / raw)
To: David Sterba, linux-btrfs
On 02/18/2016 09:25 PM, David Sterba wrote:
> The control device is accessible when no filesystem is mounted and we
> may want to query features supported by the module.
yes.
> This is already
> possible using the sysfs files, this ioctl is for parity and
> convenience.
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Thanks.
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
> fs/btrfs/ctree.h | 1 +
> fs/btrfs/ioctl.c | 3 +--
> fs/btrfs/super.c | 4 ++++
> 3 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index bfe4a337fb4d..47bc50fd4f55 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -4089,6 +4089,7 @@ void btrfs_test_inode_set_ops(struct inode *inode);
>
> /* ioctl.c */
> long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
> +int btrfs_ioctl_get_supported_features(struct file *file, void __user *arg);
> void btrfs_update_iflags(struct inode *inode);
> void btrfs_inherit_iflags(struct inode *inode, struct inode *dir);
> int btrfs_is_empty_uuid(u8 *uuid);
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index 952172ca7e45..f4c6ed5c5300 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -5187,8 +5187,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg)
> .compat_ro_flags = BTRFS_FEATURE_COMPAT_RO_##suffix, \
> .incompat_flags = BTRFS_FEATURE_INCOMPAT_##suffix }
>
> -static int btrfs_ioctl_get_supported_features(struct file *file,
> - void __user *arg)
> +int btrfs_ioctl_get_supported_features(struct file *file, void __user *arg)
> {
> static const struct btrfs_ioctl_feature_flags features[3] = {
> INIT_FEATURE_FLAGS(SUPP),
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index d41e09fe8e38..dda6f64dfd73 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -2163,6 +2163,10 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
> break;
> ret = !(fs_devices->num_devices == fs_devices->total_devices);
> break;
> + case BTRFS_IOC_GET_SUPPORTED_FEATURES:
> + ret = btrfs_ioctl_get_supported_features(NULL,
> + (void __user*)arg);
> + break;
> }
>
> kfree(vol);
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] btrfs: drop unused argument in btrfs_ioctl_get_supported_features
2016-02-18 13:25 ` [PATCH 2/2] btrfs: drop unused argument in btrfs_ioctl_get_supported_features David Sterba
@ 2016-02-20 10:25 ` Anand Jain
0 siblings, 0 replies; 4+ messages in thread
From: Anand Jain @ 2016-02-20 10:25 UTC (permalink / raw)
To: David Sterba, linux-btrfs
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Thanks.
On 02/18/2016 09:25 PM, David Sterba wrote:
> Signed-off-by: David Sterba <dsterba@suse.com>
> ---
> fs/btrfs/ctree.h | 2 +-
> fs/btrfs/ioctl.c | 4 ++--
> fs/btrfs/super.c | 3 +--
> 3 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
> index 47bc50fd4f55..82ce847318ae 100644
> --- a/fs/btrfs/ctree.h
> +++ b/fs/btrfs/ctree.h
> @@ -4089,7 +4089,7 @@ void btrfs_test_inode_set_ops(struct inode *inode);
>
> /* ioctl.c */
> long btrfs_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
> -int btrfs_ioctl_get_supported_features(struct file *file, void __user *arg);
> +int btrfs_ioctl_get_supported_features(void __user *arg);
> void btrfs_update_iflags(struct inode *inode);
> void btrfs_inherit_iflags(struct inode *inode, struct inode *dir);
> int btrfs_is_empty_uuid(u8 *uuid);
> diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
> index f4c6ed5c5300..dcda7ea1e928 100644
> --- a/fs/btrfs/ioctl.c
> +++ b/fs/btrfs/ioctl.c
> @@ -5187,7 +5187,7 @@ static int btrfs_ioctl_set_fslabel(struct file *file, void __user *arg)
> .compat_ro_flags = BTRFS_FEATURE_COMPAT_RO_##suffix, \
> .incompat_flags = BTRFS_FEATURE_INCOMPAT_##suffix }
>
> -int btrfs_ioctl_get_supported_features(struct file *file, void __user *arg)
> +int btrfs_ioctl_get_supported_features(void __user *arg)
> {
> static const struct btrfs_ioctl_feature_flags features[3] = {
> INIT_FEATURE_FLAGS(SUPP),
> @@ -5466,7 +5466,7 @@ long btrfs_ioctl(struct file *file, unsigned int
> case BTRFS_IOC_SET_FSLABEL:
> return btrfs_ioctl_set_fslabel(file, argp);
> case BTRFS_IOC_GET_SUPPORTED_FEATURES:
> - return btrfs_ioctl_get_supported_features(file, argp);
> + return btrfs_ioctl_get_supported_features(argp);
> case BTRFS_IOC_GET_FEATURES:
> return btrfs_ioctl_get_features(file, argp);
> case BTRFS_IOC_SET_FEATURES:
> diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
> index dda6f64dfd73..737e6a85c71e 100644
> --- a/fs/btrfs/super.c
> +++ b/fs/btrfs/super.c
> @@ -2164,8 +2164,7 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd,
> ret = !(fs_devices->num_devices == fs_devices->total_devices);
> break;
> case BTRFS_IOC_GET_SUPPORTED_FEATURES:
> - ret = btrfs_ioctl_get_supported_features(NULL,
> - (void __user*)arg);
> + ret = btrfs_ioctl_get_supported_features((void __user*)arg);
> break;
> }
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-02-20 10:26 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-18 13:25 [PATCH 1/2] btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls David Sterba
2016-02-18 13:25 ` [PATCH 2/2] btrfs: drop unused argument in btrfs_ioctl_get_supported_features David Sterba
2016-02-20 10:25 ` Anand Jain
2016-02-20 10:24 ` [PATCH 1/2] btrfs: add GET_SUPPORTED_FEATURES to the control device ioctls Anand Jain
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).