aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/exportfs.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index 06178a1336ff..b44f6b6871c8 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -4,6 +4,7 @@
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct dentry; 6struct dentry;
7struct inode;
7struct super_block; 8struct super_block;
8struct vfsmount; 9struct vfsmount;
9 10
@@ -101,6 +102,21 @@ struct fid {
101 * the filehandle fragment. encode_fh() should return the number of bytes 102 * the filehandle fragment. encode_fh() should return the number of bytes
102 * stored or a negative error code such as %-ENOSPC 103 * stored or a negative error code such as %-ENOSPC
103 * 104 *
105 * fh_to_dentry:
106 * @fh_to_dentry is given a &struct super_block (@sb) and a file handle
107 * fragment (@fh, @fh_len). It should return a &struct dentry which refers
108 * to the same file that the file handle fragment refers to. If it cannot,
109 * it should return a %NULL pointer if the file was found but no acceptable
110 * &dentries were available, or an %ERR_PTR error code indicating why it
111 * couldn't be found (e.g. %ENOENT or %ENOMEM). Any suitable dentry can be
112 * returned including, if necessary, a new dentry created with d_alloc_root.
113 * The caller can then find any other extant dentries by following the
114 * d_alias links.
115 *
116 * fh_to_parent:
117 * Same as @fh_to_dentry, except that it returns a pointer to the parent
118 * dentry if it was encoded into the filehandle fragment by @encode_fh.
119 *
104 * get_name: 120 * get_name:
105 * @get_name should find a name for the given @child in the given @parent 121 * @get_name should find a name for the given @child in the given @parent
106 * directory. The name should be stored in the @name (with the 122 * directory. The name should be stored in the @name (with the
@@ -139,6 +155,10 @@ struct export_operations {
139 void *context); 155 void *context);
140 int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len, 156 int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len,
141 int connectable); 157 int connectable);
158 struct dentry * (*fh_to_dentry)(struct super_block *sb, struct fid *fid,
159 int fh_len, int fh_type);
160 struct dentry * (*fh_to_parent)(struct super_block *sb, struct fid *fid,
161 int fh_len, int fh_type);
142 int (*get_name)(struct dentry *parent, char *name, 162 int (*get_name)(struct dentry *parent, char *name,
143 struct dentry *child); 163 struct dentry *child);
144 struct dentry * (*get_parent)(struct dentry *child); 164 struct dentry * (*get_parent)(struct dentry *child);
@@ -161,4 +181,14 @@ extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid,
161 int fh_len, int fileid_type, int (*acceptable)(void *, struct dentry *), 181 int fh_len, int fileid_type, int (*acceptable)(void *, struct dentry *),
162 void *context); 182 void *context);
163 183
184/*
185 * Generic helpers for filesystems.
186 */
187extern struct dentry *generic_fh_to_dentry(struct super_block *sb,
188 struct fid *fid, int fh_len, int fh_type,
189 struct inode *(*get_inode) (struct super_block *sb, u64 ino, u32 gen));
190extern struct dentry *generic_fh_to_parent(struct super_block *sb,
191 struct fid *fid, int fh_len, int fh_type,
192 struct inode *(*get_inode) (struct super_block *sb, u64 ino, u32 gen));
193
164#endif /* LINUX_EXPORTFS_H */ 194#endif /* LINUX_EXPORTFS_H */