summaryrefslogtreecommitdiff
path: root/include/linux/exportfs.h
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2024-11-29 16:38:02 +0300
committerChristian Brauner <brauner@kernel.org>2024-12-14 14:40:41 +0300
commit50166d57ea8c5042ecba0ee22532617d72ed085a (patch)
treee71d3f1a6d3945385eaadf19b9aa67579655fc7b /include/linux/exportfs.h
parentf07c7cc4684a641032c6bd439d3b91ec336e8cb5 (diff)
downloadlinux-50166d57ea8c5042ecba0ee22532617d72ed085a.tar.xz
exportfs: add open method
This allows filesystems such as pidfs to provide their custom open. Link: https://lore.kernel.org/r/20241129-work-pidfs-file_handle-v1-3-87d803a42495@kernel.org Reviewed-by: Amir Goldstein <amir73il@gmail.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'include/linux/exportfs.h')
-rw-r--r--include/linux/exportfs.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index 4cc8801e50e3..c69b79b64466 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -10,6 +10,7 @@ struct inode;
struct iomap;
struct super_block;
struct vfsmount;
+struct path;
/* limit the handle size to NFSv4 handle size now */
#define MAX_HANDLE_SZ 128
@@ -225,6 +226,9 @@ struct fid {
* is also a directory. In the event that it cannot be found, or storage
* space cannot be allocated, a %ERR_PTR should be returned.
*
+ * open:
+ * Allow filesystems to specify a custom open function.
+ *
* commit_metadata:
* @commit_metadata should commit metadata changes to stable storage.
*
@@ -251,6 +255,7 @@ struct export_operations {
bool write, u32 *device_generation);
int (*commit_blocks)(struct inode *inode, struct iomap *iomaps,
int nr_iomaps, struct iattr *iattr);
+ struct file * (*open)(struct path *path, unsigned int oflags);
#define EXPORT_OP_NOWCC (0x1) /* don't collect v3 wcc data */
#define EXPORT_OP_NOSUBTREECHK (0x2) /* no subtree checking */
#define EXPORT_OP_CLOSE_BEFORE_UNLINK (0x4) /* close files before unlink */