diff options
author | Christoph Hellwig <hch@lst.de> | 2007-10-21 19:42:09 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-22 11:13:20 -0400 |
commit | 05da08048226cefd2ecc5fe925002d3cf849c7dd (patch) | |
tree | 968242a6581c1e0ecb933f8b8b374667fed600fe | |
parent | 1b961ac05a1624ac2883ec31a3601de7eb30ebdd (diff) |
efs: new export ops
Trivial switch over to the new generic helpers.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Neil Brown <neilb@suse.de>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/efs/namei.c | 36 | ||||
-rw-r--r-- | fs/efs/super.c | 3 | ||||
-rw-r--r-- | include/linux/efs_fs.h | 6 |
3 files changed, 27 insertions, 18 deletions
diff --git a/fs/efs/namei.c b/fs/efs/namei.c index 5276b19423c1..f7f407075be1 100644 --- a/fs/efs/namei.c +++ b/fs/efs/namei.c | |||
@@ -10,6 +10,8 @@ | |||
10 | #include <linux/string.h> | 10 | #include <linux/string.h> |
11 | #include <linux/efs_fs.h> | 11 | #include <linux/efs_fs.h> |
12 | #include <linux/smp_lock.h> | 12 | #include <linux/smp_lock.h> |
13 | #include <linux/exportfs.h> | ||
14 | |||
13 | 15 | ||
14 | static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int len) { | 16 | static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int len) { |
15 | struct buffer_head *bh; | 17 | struct buffer_head *bh; |
@@ -75,13 +77,10 @@ struct dentry *efs_lookup(struct inode *dir, struct dentry *dentry, struct namei | |||
75 | return NULL; | 77 | return NULL; |
76 | } | 78 | } |
77 | 79 | ||
78 | struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp) | 80 | static struct inode *efs_nfs_get_inode(struct super_block *sb, u64 ino, |
81 | u32 generation) | ||
79 | { | 82 | { |
80 | __u32 *objp = vobjp; | ||
81 | unsigned long ino = objp[0]; | ||
82 | __u32 generation = objp[1]; | ||
83 | struct inode *inode; | 83 | struct inode *inode; |
84 | struct dentry *result; | ||
85 | 84 | ||
86 | if (ino == 0) | 85 | if (ino == 0) |
87 | return ERR_PTR(-ESTALE); | 86 | return ERR_PTR(-ESTALE); |
@@ -91,20 +90,25 @@ struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp) | |||
91 | 90 | ||
92 | if (is_bad_inode(inode) || | 91 | if (is_bad_inode(inode) || |
93 | (generation && inode->i_generation != generation)) { | 92 | (generation && inode->i_generation != generation)) { |
94 | result = ERR_PTR(-ESTALE); | 93 | iput(inode); |
95 | goto out_iput; | 94 | return ERR_PTR(-ESTALE); |
96 | } | 95 | } |
97 | 96 | ||
98 | result = d_alloc_anon(inode); | 97 | return inode; |
99 | if (!result) { | 98 | } |
100 | result = ERR_PTR(-ENOMEM); | ||
101 | goto out_iput; | ||
102 | } | ||
103 | return result; | ||
104 | 99 | ||
105 | out_iput: | 100 | struct dentry *efs_fh_to_dentry(struct super_block *sb, struct fid *fid, |
106 | iput(inode); | 101 | int fh_len, int fh_type) |
107 | return result; | 102 | { |
103 | return generic_fh_to_dentry(sb, fid, fh_len, fh_type, | ||
104 | efs_nfs_get_inode); | ||
105 | } | ||
106 | |||
107 | struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid, | ||
108 | int fh_len, int fh_type) | ||
109 | { | ||
110 | return generic_fh_to_parent(sb, fid, fh_len, fh_type, | ||
111 | efs_nfs_get_inode); | ||
108 | } | 112 | } |
109 | 113 | ||
110 | struct dentry *efs_get_parent(struct dentry *child) | 114 | struct dentry *efs_get_parent(struct dentry *child) |
diff --git a/fs/efs/super.c b/fs/efs/super.c index 25d0326c5f1c..d8ce21b82fba 100644 --- a/fs/efs/super.c +++ b/fs/efs/super.c | |||
@@ -114,7 +114,8 @@ static const struct super_operations efs_superblock_operations = { | |||
114 | }; | 114 | }; |
115 | 115 | ||
116 | static struct export_operations efs_export_ops = { | 116 | static struct export_operations efs_export_ops = { |
117 | .get_dentry = efs_get_dentry, | 117 | .fh_to_dentry = efs_fh_to_dentry, |
118 | .fh_to_parent = efs_fh_to_parent, | ||
118 | .get_parent = efs_get_parent, | 119 | .get_parent = efs_get_parent, |
119 | }; | 120 | }; |
120 | 121 | ||
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h index 16cb25cbf7c5..dd57fe523e97 100644 --- a/include/linux/efs_fs.h +++ b/include/linux/efs_fs.h | |||
@@ -35,6 +35,7 @@ static inline struct efs_sb_info *SUPER_INFO(struct super_block *sb) | |||
35 | } | 35 | } |
36 | 36 | ||
37 | struct statfs; | 37 | struct statfs; |
38 | struct fid; | ||
38 | 39 | ||
39 | extern const struct inode_operations efs_dir_inode_operations; | 40 | extern const struct inode_operations efs_dir_inode_operations; |
40 | extern const struct file_operations efs_dir_operations; | 41 | extern const struct file_operations efs_dir_operations; |
@@ -45,7 +46,10 @@ extern efs_block_t efs_map_block(struct inode *, efs_block_t); | |||
45 | extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); | 46 | extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); |
46 | 47 | ||
47 | extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); | 48 | extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); |
48 | extern struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp); | 49 | extern struct dentry *efs_fh_to_dentry(struct super_block *sb, struct fid *fid, |
50 | int fh_len, int fh_type); | ||
51 | extern struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid, | ||
52 | int fh_len, int fh_type); | ||
49 | extern struct dentry *efs_get_parent(struct dentry *); | 53 | extern struct dentry *efs_get_parent(struct dentry *); |
50 | extern int efs_bmap(struct inode *, int); | 54 | extern int efs_bmap(struct inode *, int); |
51 | 55 | ||