]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pseudofs: add support for export_ops
authorErin Shepherd <erin.shepherd@e43.eu>
Fri, 29 Nov 2024 13:38:00 +0000 (14:38 +0100)
committerChristian Brauner <brauner@kernel.org>
Sat, 14 Dec 2024 11:40:40 +0000 (12:40 +0100)
Pseudo-filesystems might reasonably wish to implement the export ops
(particularly for name_to_handle_at/open_by_handle_at); plumb this
through pseudo_fs_context

Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Erin Shepherd <erin.shepherd@e43.eu>
Link: https://lore.kernel.org/r/20241113-pidfs_fh-v2-1-9a4d28155a37@e43.eu
Link: https://lore.kernel.org/r/20241129-work-pidfs-file_handle-v1-1-87d803a42495@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/libfs.c
include/linux/pseudo_fs.h

index 748ac59231547c29abcbade3fa025e3b00533d8b..2890a9c4a414b7e2be5c337e238db84743f0a30b 100644 (file)
@@ -673,6 +673,7 @@ static int pseudo_fs_fill_super(struct super_block *s, struct fs_context *fc)
        s->s_blocksize_bits = PAGE_SHIFT;
        s->s_magic = ctx->magic;
        s->s_op = ctx->ops ?: &simple_super_operations;
+       s->s_export_op = ctx->eops;
        s->s_xattr = ctx->xattr;
        s->s_time_gran = 1;
        root = new_inode(s);
index 730f77381d55f1816ef14adf7dd2cf1d62bb912c..2503f7625d65e7b1fbe9e64d5abf06cd8f017b5f 100644 (file)
@@ -5,6 +5,7 @@
 
 struct pseudo_fs_context {
        const struct super_operations *ops;
+       const struct export_operations *eops;
        const struct xattr_handler * const *xattr;
        const struct dentry_operations *dops;
        unsigned long magic;