From: Anand Jain <anand.jain@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz, clm@fb.com
Subject: [PATCH RFC] btrfs-progs: make add and delete path max len consistent
Date: Thu, 18 Feb 2016 16:07:17 +0800 [thread overview]
Message-ID: <1455782837-15630-3-git-send-email-anand.jain@oracle.com> (raw)
In-Reply-To: <1455782837-15630-1-git-send-email-anand.jain@oracle.com>
Add device ioctl uses BTRFS_PATH_NAME_MAX however delete
uses BTRFS_SUBVOL_NAME_MAX to hold device path. This patch
makes them consistent.
Depends on
btrfs: make add and device ioctl args path max consistent
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
cmds-device.c | 2 +-
ioctl.h | 19 ++++++++++++++++++-
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/cmds-device.c b/cmds-device.c
index 879ba94d7ea5..be07e34c2af8 100644
--- a/cmds-device.c
+++ b/cmds-device.c
@@ -160,7 +160,7 @@ static int _cmd_device_remove(int argc, char **argv,
struct btrfs_ioctl_vol_args arg;
int res;
- struct btrfs_ioctl_vol_args_v2 argv2 = {0};
+ struct btrfs_ioctl_vol_args_v3 argv2 = {0};
int is_devid = 0;
if (string_is_numerical(argv[i])) {
diff --git a/ioctl.h b/ioctl.h
index 1560dcb4b457..8e444ca374fd 100644
--- a/ioctl.h
+++ b/ioctl.h
@@ -92,6 +92,23 @@ struct btrfs_ioctl_vol_args_v2 {
};
};
+struct btrfs_ioctl_vol_args_v3 {
+ __s64 fd;
+ __u64 transid;
+ __u64 flags;
+ union {
+ struct {
+ __u64 size;
+ struct btrfs_qgroup_inherit __user *qgroup_inherit;
+ };
+ __u64 unused[4];
+ };
+ union {
+ char name[BTRFS_PATH_NAME_MAX + 1];
+ u64 devid;
+ };
+};
+
/*
* structure to report errors and progress to userspace, either as a
* result of a finished scrub, a canceled scrub or a progress inquiry
@@ -689,7 +706,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
#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_v2)
+ struct btrfs_ioctl_vol_args_v3)
#ifdef __cplusplus
}
#endif
--
2.7.0
prev parent reply other threads:[~2016-02-18 8:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-18 8:07 [PATCH RFC] Make add and device ioctls device path len consistent Anand Jain
2016-02-18 8:07 ` [PATCH RFC] btrfs: make add and device ioctl args path max consistent Anand Jain
2016-02-18 8:07 ` Anand Jain [this message]
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=1455782837-15630-3-git-send-email-anand.jain@oracle.com \
--to=anand.jain@oracle.com \
--cc=clm@fb.com \
--cc=dsterba@suse.cz \
--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).