From: "Misono, Tomohiro" <misono.tomohiro@jp.fujitsu.com>
To: linux-btrfs <linux-btrfs@vger.kernel.org>
Subject: [RFC PATCH 1/7] btrfs-progs: Add 2 definitions of new unprivileged ioctl
Date: Tue, 6 Mar 2018 17:33:45 +0900 [thread overview]
Message-ID: <f899fbdc-84db-73e7-4fe3-d85cc8f814a7@jp.fujitsu.com> (raw)
In-Reply-To: <94a0bad6-d696-a72e-ba7b-287d1d442997@jp.fujitsu.com>
Add 2 definitions of new unprivileged ioctl (BTRFS_IOC_GET_SUBVOL_INFO
and BTRFS_IOC_INO_LOOKUP_USER). They will be used to implement
user version of "btrfs subvolume list" etc.
Signed-off-by: Tomohiro Misono <misono.tomohiro@jp.fujitsu.com>
---
ioctl.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/ioctl.h b/ioctl.h
index 709e996f..c5181dd9 100644
--- a/ioctl.h
+++ b/ioctl.h
@@ -320,6 +320,21 @@ struct btrfs_ioctl_ino_lookup_args {
};
BUILD_ASSERT(sizeof(struct btrfs_ioctl_ino_lookup_args) == 4096);
+#define BTRFS_INO_LOOKUP_USER_PATH_MAX (4072-BTRFS_VOL_NAME_MAX)
+struct btrfs_ioctl_ino_lookup_user_args {
+ /* in */
+ __u64 treeid;
+ /* in, 'dirid' is the same as objectid in btrfs_ioctl_ino_lookup_args */
+ __u64 dirid;
+ /* in, subvolume id */
+ __u64 subid;
+ /* out, name of the subvolume whose objectid is 'subid' */
+ char name[BTRFS_VOL_NAME_MAX];
+ /* out, 'path' is the same as 'name' in btrfs_ioctl_ino_lookup_args */
+ char path[BTRFS_INO_LOOKUP_USER_PATH_MAX];
+};
+BUILD_ASSERT(sizeof(struct btrfs_ioctl_ino_lookup_user_args) == 4096);
+
struct btrfs_ioctl_search_key {
/* which root are we searching. 0 is the tree of tree roots */
__u64 tree_id;
@@ -828,6 +843,10 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
struct btrfs_ioctl_feature_flags[3])
#define BTRFS_IOC_RM_DEV_V2 _IOW(BTRFS_IOCTL_MAGIC, 58, \
struct btrfs_ioctl_vol_args_v2)
+#define BTRFS_IOC_GET_SUBVOL_INFO _IOWR(BTRFS_IOCTL_MAGIC, 60, \
+ struct btrfs_ioctl_search_args)
+#define BTRFS_IOC_INO_LOOKUP_USER _IOWR(BTRFS_IOCTL_MAGIC, 61, \
+ struct btrfs_ioctl_ino_lookup_args)
#ifdef __cplusplus
}
#endif
--
2.14.3
next prev parent reply other threads:[~2018-03-06 8:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 8:32 [RFC PATCH 0/7] btrfs-progs: Allow normal user to call "subvolume list/show" Misono, Tomohiro
2018-03-06 8:33 ` Misono, Tomohiro [this message]
2018-03-06 8:34 ` [RFC PATCH 2/7] btrfs-progs: sub list: Add helper function which checks the permission for tree search ioctl Misono, Tomohiro
2018-03-06 8:34 ` [PATCH 3/7] btrfs-progs: sub list: Pass specified path down to btrfs_list_subvols() Misono, Tomohiro
2018-03-06 8:35 ` [RFC PATCH 4/7] btrfs-progs: fallback to open without O_NOATIME flag in, find_mount_root() Misono, Tomohiro
2018-03-06 8:36 ` [RFC PATCH 5/7] btrfs-progs: sub list: Allow normal user to call "subvolume list/show" Misono, Tomohiro
2018-03-06 8:36 ` [RFC PATCH 6/7] btrfs-progs: test: Add helper function to check if test user exists Misono, Tomohiro
2018-03-06 8:37 ` [RFC PATCH 7/7] btrfs-porgs: test: Add cli-test/009 to check subvolume list for both root and normal user Misono, Tomohiro
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=f899fbdc-84db-73e7-4fe3-d85cc8f814a7@jp.fujitsu.com \
--to=misono.tomohiro@jp.fujitsu.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).