summaryrefslogtreecommitdiff
path: root/include/linux/fs_context.h
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2018-12-24 01:25:47 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2019-02-28 11:29:26 +0300
commitcb50b348c71ffa90d7d1b2a494b553b5099bc090 (patch)
treed3896d01eb8fdd3ddbce3329314137f24da83ecb /include/linux/fs_context.h
parent3e1aeb00e6d132efc151dacc062b38269bc9eccc (diff)
downloadlinux-cb50b348c71ffa90d7d1b2a494b553b5099bc090.tar.xz
convenience helpers: vfs_get_super() and sget_fc()
the former is an analogue of mount_{single,nodev} for use in ->get_tree() instances, the latter - analogue of sget() for the same. These are fairly similar to the originals, but the callback signature for sget_fc() is different from sget() ones, so getting bits and pieces shared would be too convoluted; we might get around to that later, but for now let's just remember to keep them in sync. They do live next to each other, and changes in either won't be hard to spot. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs_context.h')
-rw-r--r--include/linux/fs_context.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/fs_context.h b/include/linux/fs_context.h
index d794b04e9fbb..b1a95db7a111 100644
--- a/include/linux/fs_context.h
+++ b/include/linux/fs_context.h
@@ -83,11 +83,13 @@ struct fs_context {
const char *source; /* The source name (eg. dev path) */
const char *subtype; /* The subtype to set on the superblock */
void *security; /* Linux S&M options */
+ void *s_fs_info; /* Proposed s_fs_info */
unsigned int sb_flags; /* Proposed superblock flags (SB_*) */
unsigned int sb_flags_mask; /* Superblock flags that were changed */
unsigned int lsm_flags; /* Information flags from the fs to the LSM */
enum fs_context_purpose purpose:8;
bool need_free:1; /* Need to call ops->free() */
+ bool global:1; /* Goes into &init_user_ns */
};
struct fs_context_operations {
@@ -116,6 +118,19 @@ extern int generic_parse_monolithic(struct fs_context *fc, void *data);
extern int vfs_get_tree(struct fs_context *fc);
extern void put_fs_context(struct fs_context *fc);
+/*
+ * sget() wrapper to be called from the ->get_tree() op.
+ */
+enum vfs_get_super_keying {
+ vfs_get_single_super, /* Only one such superblock may exist */
+ vfs_get_keyed_super, /* Superblocks with different s_fs_info keys may exist */
+ vfs_get_independent_super, /* Multiple independent superblocks may exist */
+};
+extern int vfs_get_super(struct fs_context *fc,
+ enum vfs_get_super_keying keying,
+ int (*fill_super)(struct super_block *sb,
+ struct fs_context *fc));
+
#define logfc(FC, FMT, ...) pr_notice(FMT, ## __VA_ARGS__)
/**