Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=05da08048226cefd2ecc5fe925002d3cf849c7dd
Commit:     05da08048226cefd2ecc5fe925002d3cf849c7dd
Parent:     1b961ac05a1624ac2883ec31a3601de7eb30ebdd
Author:     Christoph Hellwig <[EMAIL PROTECTED]>
AuthorDate: Sun Oct 21 16:42:09 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Mon Oct 22 08:13:20 2007 -0700

    efs: new export ops
    
    Trivial switch over to the new generic helpers.
    
    Signed-off-by: Christoph Hellwig <[EMAIL PROTECTED]>
    Cc: Neil Brown <[EMAIL PROTECTED]>
    Cc: "J. Bruce Fields" <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 fs/efs/namei.c         |   36 ++++++++++++++++++++----------------
 fs/efs/super.c         |    3 ++-
 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 5276b19..f7f4070 100644
--- a/fs/efs/namei.c
+++ b/fs/efs/namei.c
@@ -10,6 +10,8 @@
 #include <linux/string.h>
 #include <linux/efs_fs.h>
 #include <linux/smp_lock.h>
+#include <linux/exportfs.h>
+
 
 static efs_ino_t efs_find_entry(struct inode *inode, const char *name, int 
len) {
        struct buffer_head *bh;
@@ -75,13 +77,10 @@ struct dentry *efs_lookup(struct inode *dir, struct dentry 
*dentry, struct namei
        return NULL;
 }
 
-struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp)
+static struct inode *efs_nfs_get_inode(struct super_block *sb, u64 ino,
+               u32 generation)
 {
-       __u32 *objp = vobjp;
-       unsigned long ino = objp[0];
-       __u32 generation = objp[1];
        struct inode *inode;
-       struct dentry *result;
 
        if (ino == 0)
                return ERR_PTR(-ESTALE);
@@ -91,20 +90,25 @@ struct dentry *efs_get_dentry(struct super_block *sb, void 
*vobjp)
 
        if (is_bad_inode(inode) ||
            (generation && inode->i_generation != generation)) {
-               result = ERR_PTR(-ESTALE);
-               goto out_iput;
+               iput(inode);
+               return ERR_PTR(-ESTALE);
        }
 
-       result = d_alloc_anon(inode);
-       if (!result) {
-               result = ERR_PTR(-ENOMEM);
-               goto out_iput;
-       }
-       return result;
+       return inode;
+}
 
- out_iput:
-       iput(inode);
-       return result;
+struct dentry *efs_fh_to_dentry(struct super_block *sb, struct fid *fid,
+               int fh_len, int fh_type)
+{
+       return generic_fh_to_dentry(sb, fid, fh_len, fh_type,
+                                   efs_nfs_get_inode);
+}
+
+struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid,
+               int fh_len, int fh_type)
+{
+       return generic_fh_to_parent(sb, fid, fh_len, fh_type,
+                                   efs_nfs_get_inode);
 }
 
 struct dentry *efs_get_parent(struct dentry *child)
diff --git a/fs/efs/super.c b/fs/efs/super.c
index 25d0326..d8ce21b 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -114,7 +114,8 @@ static const struct super_operations 
efs_superblock_operations = {
 };
 
 static struct export_operations efs_export_ops = {
-       .get_dentry     = efs_get_dentry,
+       .fh_to_dentry   = efs_fh_to_dentry,
+       .fh_to_parent   = efs_fh_to_parent,
        .get_parent     = efs_get_parent,
 };
 
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index 16cb25c..dd57fe5 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)
 }
 
 struct statfs;
+struct fid;
 
 extern const struct inode_operations efs_dir_inode_operations;
 extern const struct file_operations efs_dir_operations;
@@ -45,7 +46,10 @@ extern efs_block_t efs_map_block(struct inode *, 
efs_block_t);
 extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int);
 
 extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct 
nameidata *);
-extern struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp);
+extern struct dentry *efs_fh_to_dentry(struct super_block *sb, struct fid *fid,
+               int fh_len, int fh_type);
+extern struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid,
+               int fh_len, int fh_type);
 extern struct dentry *efs_get_parent(struct dentry *);
 extern int efs_bmap(struct inode *, int);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to