diff options
-rw-r--r-- | fs/cifs/export.c | 1 | ||||
-rw-r--r-- | fs/efs/super.c | 1 | ||||
-rw-r--r-- | fs/exportfs/expfs.c | 1 | ||||
-rw-r--r-- | fs/ext2/super.c | 1 | ||||
-rw-r--r-- | fs/ext3/super.c | 1 | ||||
-rw-r--r-- | fs/ext4/super.c | 1 | ||||
-rw-r--r-- | fs/fat/inode.c | 1 | ||||
-rw-r--r-- | fs/gfs2/ops_export.c | 1 | ||||
-rw-r--r-- | fs/isofs/isofs.h | 1 | ||||
-rw-r--r-- | fs/jfs/super.c | 1 | ||||
-rw-r--r-- | fs/nfsd/export.c | 1 | ||||
-rw-r--r-- | fs/nfsd/nfsfh.c | 1 | ||||
-rw-r--r-- | fs/ntfs/namei.c | 1 | ||||
-rw-r--r-- | fs/ocfs2/export.h | 2 | ||||
-rw-r--r-- | fs/reiserfs/inode.c | 1 | ||||
-rw-r--r-- | fs/reiserfs/super.c | 1 | ||||
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.h | 2 | ||||
-rw-r--r-- | include/linux/exportfs.h | 119 | ||||
-rw-r--r-- | include/linux/fs.h | 114 | ||||
-rw-r--r-- | mm/shmem.c | 1 |
20 files changed, 140 insertions, 113 deletions
diff --git a/fs/cifs/export.c b/fs/cifs/export.c index 1d716392c3aa..96df1d51fdc3 100644 --- a/fs/cifs/export.c +++ b/fs/cifs/export.c | |||
@@ -29,6 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include <linux/fs.h> | 31 | #include <linux/fs.h> |
32 | #include <linux/exportfs.h> | ||
32 | 33 | ||
33 | #ifdef CONFIG_CIFS_EXPERIMENTAL | 34 | #ifdef CONFIG_CIFS_EXPERIMENTAL |
34 | 35 | ||
diff --git a/fs/efs/super.c b/fs/efs/super.c index e0a6839e68ae..67338d622f56 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/efs_fs.h> | 11 | #include <linux/efs_fs.h> |
12 | #include <linux/efs_vh.h> | 12 | #include <linux/efs_vh.h> |
13 | #include <linux/efs_fs_sb.h> | 13 | #include <linux/efs_fs_sb.h> |
14 | #include <linux/exportfs.h> | ||
14 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
15 | #include <linux/buffer_head.h> | 16 | #include <linux/buffer_head.h> |
16 | #include <linux/vfs.h> | 17 | #include <linux/vfs.h> |
diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c index e98f6cd7200c..16287af34859 100644 --- a/fs/exportfs/expfs.c +++ b/fs/exportfs/expfs.c | |||
@@ -1,4 +1,5 @@ | |||
1 | 1 | ||
2 | #include <linux/exportfs.h> | ||
2 | #include <linux/fs.h> | 3 | #include <linux/fs.h> |
3 | #include <linux/file.h> | 4 | #include <linux/file.h> |
4 | #include <linux/module.h> | 5 | #include <linux/module.h> |
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index b2efd9083b9b..3eefa97fe204 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/parser.h> | 25 | #include <linux/parser.h> |
26 | #include <linux/random.h> | 26 | #include <linux/random.h> |
27 | #include <linux/buffer_head.h> | 27 | #include <linux/buffer_head.h> |
28 | #include <linux/exportfs.h> | ||
28 | #include <linux/smp_lock.h> | 29 | #include <linux/smp_lock.h> |
29 | #include <linux/vfs.h> | 30 | #include <linux/vfs.h> |
30 | #include <linux/seq_file.h> | 31 | #include <linux/seq_file.h> |
diff --git a/fs/ext3/super.c b/fs/ext3/super.c index 51d1c456cdab..4f84dc86628a 100644 --- a/fs/ext3/super.c +++ b/fs/ext3/super.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/parser.h> | 29 | #include <linux/parser.h> |
30 | #include <linux/smp_lock.h> | 30 | #include <linux/smp_lock.h> |
31 | #include <linux/buffer_head.h> | 31 | #include <linux/buffer_head.h> |
32 | #include <linux/exportfs.h> | ||
32 | #include <linux/vfs.h> | 33 | #include <linux/vfs.h> |
33 | #include <linux/random.h> | 34 | #include <linux/random.h> |
34 | #include <linux/mount.h> | 35 | #include <linux/mount.h> |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index d0d8c76c7edb..b806e689c4aa 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/parser.h> | 29 | #include <linux/parser.h> |
30 | #include <linux/smp_lock.h> | 30 | #include <linux/smp_lock.h> |
31 | #include <linux/buffer_head.h> | 31 | #include <linux/buffer_head.h> |
32 | #include <linux/exportfs.h> | ||
32 | #include <linux/vfs.h> | 33 | #include <linux/vfs.h> |
33 | #include <linux/random.h> | 34 | #include <linux/random.h> |
34 | #include <linux/mount.h> | 35 | #include <linux/mount.h> |
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index cfaf5877d98b..0a7ddb39a593 100644 --- a/fs/fat/inode.c +++ b/fs/fat/inode.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/pagemap.h> | 20 | #include <linux/pagemap.h> |
21 | #include <linux/mpage.h> | 21 | #include <linux/mpage.h> |
22 | #include <linux/buffer_head.h> | 22 | #include <linux/buffer_head.h> |
23 | #include <linux/exportfs.h> | ||
23 | #include <linux/mount.h> | 24 | #include <linux/mount.h> |
24 | #include <linux/vfs.h> | 25 | #include <linux/vfs.h> |
25 | #include <linux/parser.h> | 26 | #include <linux/parser.h> |
diff --git a/fs/gfs2/ops_export.c b/fs/gfs2/ops_export.c index 99ea5659bc2c..b8312edee0e4 100644 --- a/fs/gfs2/ops_export.c +++ b/fs/gfs2/ops_export.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/spinlock.h> | 11 | #include <linux/spinlock.h> |
12 | #include <linux/completion.h> | 12 | #include <linux/completion.h> |
13 | #include <linux/buffer_head.h> | 13 | #include <linux/buffer_head.h> |
14 | #include <linux/exportfs.h> | ||
14 | #include <linux/gfs2_ondisk.h> | 15 | #include <linux/gfs2_ondisk.h> |
15 | #include <linux/crc32.h> | 16 | #include <linux/crc32.h> |
16 | #include <linux/lm_interface.h> | 17 | #include <linux/lm_interface.h> |
diff --git a/fs/isofs/isofs.h b/fs/isofs/isofs.h index efe2872cd4e3..a07e67b1ea7f 100644 --- a/fs/isofs/isofs.h +++ b/fs/isofs/isofs.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/fs.h> | 1 | #include <linux/fs.h> |
2 | #include <linux/buffer_head.h> | 2 | #include <linux/buffer_head.h> |
3 | #include <linux/exportfs.h> | ||
3 | #include <linux/iso_fs.h> | 4 | #include <linux/iso_fs.h> |
4 | #include <asm/unaligned.h> | 5 | #include <asm/unaligned.h> |
5 | 6 | ||
diff --git a/fs/jfs/super.c b/fs/jfs/super.c index 20e4ac1c79a3..49b652bd96ba 100644 --- a/fs/jfs/super.c +++ b/fs/jfs/super.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/kthread.h> | 27 | #include <linux/kthread.h> |
28 | #include <linux/posix_acl.h> | 28 | #include <linux/posix_acl.h> |
29 | #include <linux/buffer_head.h> | 29 | #include <linux/buffer_head.h> |
30 | #include <linux/exportfs.h> | ||
30 | #include <asm/uaccess.h> | 31 | #include <asm/uaccess.h> |
31 | #include <linux/seq_file.h> | 32 | #include <linux/seq_file.h> |
32 | 33 | ||
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index 79bd03b8bbf8..c518421a9355 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <linux/mount.h> | 26 | #include <linux/mount.h> |
27 | #include <linux/hash.h> | 27 | #include <linux/hash.h> |
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/exportfs.h> | ||
29 | 30 | ||
30 | #include <linux/sunrpc/svc.h> | 31 | #include <linux/sunrpc/svc.h> |
31 | #include <linux/nfsd/nfsd.h> | 32 | #include <linux/nfsd/nfsd.h> |
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index 6ca2d24fc216..0108d3ec1c27 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/string.h> | 15 | #include <linux/string.h> |
16 | #include <linux/stat.h> | 16 | #include <linux/stat.h> |
17 | #include <linux/dcache.h> | 17 | #include <linux/dcache.h> |
18 | #include <linux/exportfs.h> | ||
18 | #include <linux/mount.h> | 19 | #include <linux/mount.h> |
19 | 20 | ||
20 | #include <linux/sunrpc/clnt.h> | 21 | #include <linux/sunrpc/clnt.h> |
diff --git a/fs/ntfs/namei.c b/fs/ntfs/namei.c index bff01a54675a..e93c6142b23c 100644 --- a/fs/ntfs/namei.c +++ b/fs/ntfs/namei.c | |||
@@ -21,6 +21,7 @@ | |||
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include <linux/dcache.h> | 23 | #include <linux/dcache.h> |
24 | #include <linux/exportfs.h> | ||
24 | #include <linux/security.h> | 25 | #include <linux/security.h> |
25 | 26 | ||
26 | #include "attrib.h" | 27 | #include "attrib.h" |
diff --git a/fs/ocfs2/export.h b/fs/ocfs2/export.h index 5b77ee7866ef..e08bed9e45a0 100644 --- a/fs/ocfs2/export.h +++ b/fs/ocfs2/export.h | |||
@@ -26,6 +26,8 @@ | |||
26 | #ifndef OCFS2_EXPORT_H | 26 | #ifndef OCFS2_EXPORT_H |
27 | #define OCFS2_EXPORT_H | 27 | #define OCFS2_EXPORT_H |
28 | 28 | ||
29 | #include <linux/exportfs.h> | ||
30 | |||
29 | extern struct export_operations ocfs2_export_ops; | 31 | extern struct export_operations ocfs2_export_ops; |
30 | 32 | ||
31 | #endif /* OCFS2_EXPORT_H */ | 33 | #endif /* OCFS2_EXPORT_H */ |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 1272d11399fb..ddde489f1cb2 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/reiserfs_fs.h> | 7 | #include <linux/reiserfs_fs.h> |
8 | #include <linux/reiserfs_acl.h> | 8 | #include <linux/reiserfs_acl.h> |
9 | #include <linux/reiserfs_xattr.h> | 9 | #include <linux/reiserfs_xattr.h> |
10 | #include <linux/exportfs.h> | ||
10 | #include <linux/smp_lock.h> | 11 | #include <linux/smp_lock.h> |
11 | #include <linux/pagemap.h> | 12 | #include <linux/pagemap.h> |
12 | #include <linux/highmem.h> | 13 | #include <linux/highmem.h> |
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index b4ac9119200e..5a93cfe1a032 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/blkdev.h> | 22 | #include <linux/blkdev.h> |
23 | #include <linux/buffer_head.h> | 23 | #include <linux/buffer_head.h> |
24 | #include <linux/exportfs.h> | ||
24 | #include <linux/vfs.h> | 25 | #include <linux/vfs.h> |
25 | #include <linux/mnt_namespace.h> | 26 | #include <linux/mnt_namespace.h> |
26 | #include <linux/mount.h> | 27 | #include <linux/mount.h> |
diff --git a/fs/xfs/linux-2.6/xfs_super.h b/fs/xfs/linux-2.6/xfs_super.h index 33dd1ca13245..201cc3273c84 100644 --- a/fs/xfs/linux-2.6/xfs_super.h +++ b/fs/xfs/linux-2.6/xfs_super.h | |||
@@ -18,6 +18,8 @@ | |||
18 | #ifndef __XFS_SUPER_H__ | 18 | #ifndef __XFS_SUPER_H__ |
19 | #define __XFS_SUPER_H__ | 19 | #define __XFS_SUPER_H__ |
20 | 20 | ||
21 | #include <linux/exportfs.h> | ||
22 | |||
21 | #ifdef CONFIG_XFS_DMAPI | 23 | #ifdef CONFIG_XFS_DMAPI |
22 | # define vfs_insertdmapi(vfs) vfs_insertops(vfsp, &xfs_dmops) | 24 | # define vfs_insertdmapi(vfs) vfs_insertops(vfsp, &xfs_dmops) |
23 | # define vfs_initdmapi() dmapi_init() | 25 | # define vfs_initdmapi() dmapi_init() |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h new file mode 100644 index 000000000000..fdc306fbba50 --- /dev/null +++ b/include/linux/exportfs.h | |||
@@ -0,0 +1,119 @@ | |||
1 | #ifndef LINUX_EXPORTFS_H | ||
2 | #define LINUX_EXPORTFS_H 1 | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct dentry; | ||
7 | struct super_block; | ||
8 | |||
9 | |||
10 | /** | ||
11 | * struct export_operations - for nfsd to communicate with file systems | ||
12 | * @decode_fh: decode a file handle fragment and return a &struct dentry | ||
13 | * @encode_fh: encode a file handle fragment from a dentry | ||
14 | * @get_name: find the name for a given inode in a given directory | ||
15 | * @get_parent: find the parent of a given directory | ||
16 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment | ||
17 | * @find_exported_dentry: | ||
18 | * set by the exporting module to a standard helper function. | ||
19 | * | ||
20 | * Description: | ||
21 | * The export_operations structure provides a means for nfsd to communicate | ||
22 | * with a particular exported file system - particularly enabling nfsd and | ||
23 | * the filesystem to co-operate when dealing with file handles. | ||
24 | * | ||
25 | * export_operations contains two basic operation for dealing with file | ||
26 | * handles, decode_fh() and encode_fh(), and allows for some other | ||
27 | * operations to be defined which standard helper routines use to get | ||
28 | * specific information from the filesystem. | ||
29 | * | ||
30 | * nfsd encodes information use to determine which filesystem a filehandle | ||
31 | * applies to in the initial part of the file handle. The remainder, termed | ||
32 | * a file handle fragment, is controlled completely by the filesystem. The | ||
33 | * standard helper routines assume that this fragment will contain one or | ||
34 | * two sub-fragments, one which identifies the file, and one which may be | ||
35 | * used to identify the (a) directory containing the file. | ||
36 | * | ||
37 | * In some situations, nfsd needs to get a dentry which is connected into a | ||
38 | * specific part of the file tree. To allow for this, it passes the | ||
39 | * function acceptable() together with a @context which can be used to see | ||
40 | * if the dentry is acceptable. As there can be multiple dentrys for a | ||
41 | * given file, the filesystem should check each one for acceptability before | ||
42 | * looking for the next. As soon as an acceptable one is found, it should | ||
43 | * be returned. | ||
44 | * | ||
45 | * decode_fh: | ||
46 | * @decode_fh is given a &struct super_block (@sb), a file handle fragment | ||
47 | * (@fh, @fh_len) and an acceptability testing function (@acceptable, | ||
48 | * @context). It should return a &struct dentry which refers to the same | ||
49 | * file that the file handle fragment refers to, and which passes the | ||
50 | * acceptability test. If it cannot, it should return a %NULL pointer if | ||
51 | * the file was found but no acceptable &dentries were available, or a | ||
52 | * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or | ||
53 | * %ENOMEM). | ||
54 | * | ||
55 | * encode_fh: | ||
56 | * @encode_fh should store in the file handle fragment @fh (using at most | ||
57 | * @max_len bytes) information that can be used by @decode_fh to recover the | ||
58 | * file refered to by the &struct dentry @de. If the @connectable flag is | ||
59 | * set, the encode_fh() should store sufficient information so that a good | ||
60 | * attempt can be made to find not only the file but also it's place in the | ||
61 | * filesystem. This typically means storing a reference to de->d_parent in | ||
62 | * the filehandle fragment. encode_fh() should return the number of bytes | ||
63 | * stored or a negative error code such as %-ENOSPC | ||
64 | * | ||
65 | * get_name: | ||
66 | * @get_name should find a name for the given @child in the given @parent | ||
67 | * directory. The name should be stored in the @name (with the | ||
68 | * understanding that it is already pointing to a a %NAME_MAX+1 sized | ||
69 | * buffer. get_name() should return %0 on success, a negative error code | ||
70 | * or error. @get_name will be called without @parent->i_mutex held. | ||
71 | * | ||
72 | * get_parent: | ||
73 | * @get_parent should find the parent directory for the given @child which | ||
74 | * is also a directory. In the event that it cannot be found, or storage | ||
75 | * space cannot be allocated, a %ERR_PTR should be returned. | ||
76 | * | ||
77 | * get_dentry: | ||
78 | * Given a &super_block (@sb) and a pointer to a file-system specific inode | ||
79 | * identifier, possibly an inode number, (@inump) get_dentry() should find | ||
80 | * the identified inode and return a dentry for that inode. Any suitable | ||
81 | * dentry can be returned including, if necessary, a new dentry created with | ||
82 | * d_alloc_root. The caller can then find any other extant dentrys by | ||
83 | * following the d_alias links. If a new dentry was created using | ||
84 | * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry | ||
85 | * should be d_rehash()ed. | ||
86 | * | ||
87 | * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code | ||
88 | * can be returned. The @inump will be whatever was passed to | ||
89 | * nfsd_find_fh_dentry() in either the @obj or @parent parameters. | ||
90 | * | ||
91 | * Locking rules: | ||
92 | * get_parent is called with child->d_inode->i_mutex down | ||
93 | * get_name is not (which is possibly inconsistent) | ||
94 | */ | ||
95 | |||
96 | struct export_operations { | ||
97 | struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, | ||
98 | int fh_len, int fh_type, | ||
99 | int (*acceptable)(void *context, struct dentry *de), | ||
100 | void *context); | ||
101 | int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len, | ||
102 | int connectable); | ||
103 | int (*get_name)(struct dentry *parent, char *name, | ||
104 | struct dentry *child); | ||
105 | struct dentry * (*get_parent)(struct dentry *child); | ||
106 | struct dentry * (*get_dentry)(struct super_block *sb, void *inump); | ||
107 | |||
108 | /* This is set by the exporting module to a standard helper */ | ||
109 | struct dentry * (*find_exported_dentry)( | ||
110 | struct super_block *sb, void *obj, void *parent, | ||
111 | int (*acceptable)(void *context, struct dentry *de), | ||
112 | void *context); | ||
113 | }; | ||
114 | |||
115 | extern struct dentry *find_exported_dentry(struct super_block *sb, void *obj, | ||
116 | void *parent, int (*acceptable)(void *context, struct dentry *de), | ||
117 | void *context); | ||
118 | |||
119 | #endif /* LINUX_EXPORTFS_H */ | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index aa74f7de9dcd..58ce336d4a6b 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -289,6 +289,7 @@ extern int dir_notify_enable; | |||
289 | #include <asm/semaphore.h> | 289 | #include <asm/semaphore.h> |
290 | #include <asm/byteorder.h> | 290 | #include <asm/byteorder.h> |
291 | 291 | ||
292 | struct export_operations; | ||
292 | struct hd_geometry; | 293 | struct hd_geometry; |
293 | struct iovec; | 294 | struct iovec; |
294 | struct nameidata; | 295 | struct nameidata; |
@@ -1278,119 +1279,6 @@ static inline void file_accessed(struct file *file) | |||
1278 | 1279 | ||
1279 | int sync_inode(struct inode *inode, struct writeback_control *wbc); | 1280 | int sync_inode(struct inode *inode, struct writeback_control *wbc); |
1280 | 1281 | ||
1281 | /** | ||
1282 | * struct export_operations - for nfsd to communicate with file systems | ||
1283 | * @decode_fh: decode a file handle fragment and return a &struct dentry | ||
1284 | * @encode_fh: encode a file handle fragment from a dentry | ||
1285 | * @get_name: find the name for a given inode in a given directory | ||
1286 | * @get_parent: find the parent of a given directory | ||
1287 | * @get_dentry: find a dentry for the inode given a file handle sub-fragment | ||
1288 | * @find_exported_dentry: | ||
1289 | * set by the exporting module to a standard helper function. | ||
1290 | * | ||
1291 | * Description: | ||
1292 | * The export_operations structure provides a means for nfsd to communicate | ||
1293 | * with a particular exported file system - particularly enabling nfsd and | ||
1294 | * the filesystem to co-operate when dealing with file handles. | ||
1295 | * | ||
1296 | * export_operations contains two basic operation for dealing with file | ||
1297 | * handles, decode_fh() and encode_fh(), and allows for some other | ||
1298 | * operations to be defined which standard helper routines use to get | ||
1299 | * specific information from the filesystem. | ||
1300 | * | ||
1301 | * nfsd encodes information use to determine which filesystem a filehandle | ||
1302 | * applies to in the initial part of the file handle. The remainder, termed | ||
1303 | * a file handle fragment, is controlled completely by the filesystem. The | ||
1304 | * standard helper routines assume that this fragment will contain one or | ||
1305 | * two sub-fragments, one which identifies the file, and one which may be | ||
1306 | * used to identify the (a) directory containing the file. | ||
1307 | * | ||
1308 | * In some situations, nfsd needs to get a dentry which is connected into a | ||
1309 | * specific part of the file tree. To allow for this, it passes the | ||
1310 | * function acceptable() together with a @context which can be used to see | ||
1311 | * if the dentry is acceptable. As there can be multiple dentrys for a | ||
1312 | * given file, the filesystem should check each one for acceptability before | ||
1313 | * looking for the next. As soon as an acceptable one is found, it should | ||
1314 | * be returned. | ||
1315 | * | ||
1316 | * decode_fh: | ||
1317 | * @decode_fh is given a &struct super_block (@sb), a file handle fragment | ||
1318 | * (@fh, @fh_len) and an acceptability testing function (@acceptable, | ||
1319 | * @context). It should return a &struct dentry which refers to the same | ||
1320 | * file that the file handle fragment refers to, and which passes the | ||
1321 | * acceptability test. If it cannot, it should return a %NULL pointer if | ||
1322 | * the file was found but no acceptable &dentries were available, or a | ||
1323 | * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or | ||
1324 | * %ENOMEM). | ||
1325 | * | ||
1326 | * encode_fh: | ||
1327 | * @encode_fh should store in the file handle fragment @fh (using at most | ||
1328 | * @max_len bytes) information that can be used by @decode_fh to recover the | ||
1329 | * file refered to by the &struct dentry @de. If the @connectable flag is | ||
1330 | * set, the encode_fh() should store sufficient information so that a good | ||
1331 | * attempt can be made to find not only the file but also it's place in the | ||
1332 | * filesystem. This typically means storing a reference to de->d_parent in | ||
1333 | * the filehandle fragment. encode_fh() should return the number of bytes | ||
1334 | * stored or a negative error code such as %-ENOSPC | ||
1335 | * | ||
1336 | * get_name: | ||
1337 | * @get_name should find a name for the given @child in the given @parent | ||
1338 | * directory. The name should be stored in the @name (with the | ||
1339 | * understanding that it is already pointing to a a %NAME_MAX+1 sized | ||
1340 | * buffer. get_name() should return %0 on success, a negative error code | ||
1341 | * or error. @get_name will be called without @parent->i_mutex held. | ||
1342 | * | ||
1343 | * get_parent: | ||
1344 | * @get_parent should find the parent directory for the given @child which | ||
1345 | * is also a directory. In the event that it cannot be found, or storage | ||
1346 | * space cannot be allocated, a %ERR_PTR should be returned. | ||
1347 | * | ||
1348 | * get_dentry: | ||
1349 | * Given a &super_block (@sb) and a pointer to a file-system specific inode | ||
1350 | * identifier, possibly an inode number, (@inump) get_dentry() should find | ||
1351 | * the identified inode and return a dentry for that inode. Any suitable | ||
1352 | * dentry can be returned including, if necessary, a new dentry created with | ||
1353 | * d_alloc_root. The caller can then find any other extant dentrys by | ||
1354 | * following the d_alias links. If a new dentry was created using | ||
1355 | * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry | ||
1356 | * should be d_rehash()ed. | ||
1357 | * | ||
1358 | * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code | ||
1359 | * can be returned. The @inump will be whatever was passed to | ||
1360 | * nfsd_find_fh_dentry() in either the @obj or @parent parameters. | ||
1361 | * | ||
1362 | * Locking rules: | ||
1363 | * get_parent is called with child->d_inode->i_mutex down | ||
1364 | * get_name is not (which is possibly inconsistent) | ||
1365 | */ | ||
1366 | |||
1367 | struct export_operations { | ||
1368 | struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, int fh_len, int fh_type, | ||
1369 | int (*acceptable)(void *context, struct dentry *de), | ||
1370 | void *context); | ||
1371 | int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len, | ||
1372 | int connectable); | ||
1373 | |||
1374 | /* the following are only called from the filesystem itself */ | ||
1375 | int (*get_name)(struct dentry *parent, char *name, | ||
1376 | struct dentry *child); | ||
1377 | struct dentry * (*get_parent)(struct dentry *child); | ||
1378 | struct dentry * (*get_dentry)(struct super_block *sb, void *inump); | ||
1379 | |||
1380 | /* This is set by the exporting module to a standard helper */ | ||
1381 | struct dentry * (*find_exported_dentry)( | ||
1382 | struct super_block *sb, void *obj, void *parent, | ||
1383 | int (*acceptable)(void *context, struct dentry *de), | ||
1384 | void *context); | ||
1385 | |||
1386 | |||
1387 | }; | ||
1388 | |||
1389 | extern struct dentry * | ||
1390 | find_exported_dentry(struct super_block *sb, void *obj, void *parent, | ||
1391 | int (*acceptable)(void *context, struct dentry *de), | ||
1392 | void *context); | ||
1393 | |||
1394 | struct file_system_type { | 1282 | struct file_system_type { |
1395 | const char *name; | 1283 | const char *name; |
1396 | int fs_flags; | 1284 | int fs_flags; |
diff --git a/mm/shmem.c b/mm/shmem.c index e49181d9d893..96fa79fb6ad3 100644 --- a/mm/shmem.c +++ b/mm/shmem.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/init.h> | 27 | #include <linux/init.h> |
28 | #include <linux/fs.h> | 28 | #include <linux/fs.h> |
29 | #include <linux/xattr.h> | 29 | #include <linux/xattr.h> |
30 | #include <linux/exportfs.h> | ||
30 | #include <linux/generic_acl.h> | 31 | #include <linux/generic_acl.h> |
31 | #include <linux/mm.h> | 32 | #include <linux/mm.h> |
32 | #include <linux/mman.h> | 33 | #include <linux/mman.h> |