aboutsummaryrefslogtreecommitdiffstats
path: root/fs/efs
diff options
context:
space:
mode:
authorDavid Woodhouse <dwmw2@infradead.org>2007-07-23 05:20:10 -0400
committerDavid Woodhouse <dwmw2@infradead.org>2007-07-23 05:20:10 -0400
commit39fe5434cb9de5da40510028b17b96bc4eb312b3 (patch)
tree7a02a317b9ad57da51ca99887c119e779ccf3f13 /fs/efs
parent0fc72b81d3111d114ab378935b1cf07680ca1289 (diff)
parentf695baf2df9e0413d3521661070103711545207a (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'fs/efs')
-rw-r--r--fs/efs/namei.c32
-rw-r--r--fs/efs/super.c6
2 files changed, 36 insertions, 2 deletions
diff --git a/fs/efs/namei.c b/fs/efs/namei.c
index ed4a207fe2..5276b19423 100644
--- a/fs/efs/namei.c
+++ b/fs/efs/namei.c
@@ -75,6 +75,38 @@ struct dentry *efs_lookup(struct inode *dir, struct dentry *dentry, struct namei
75 return NULL; 75 return NULL;
76} 76}
77 77
78struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp)
79{
80 __u32 *objp = vobjp;
81 unsigned long ino = objp[0];
82 __u32 generation = objp[1];
83 struct inode *inode;
84 struct dentry *result;
85
86 if (ino == 0)
87 return ERR_PTR(-ESTALE);
88 inode = iget(sb, ino);
89 if (inode == NULL)
90 return ERR_PTR(-ENOMEM);
91
92 if (is_bad_inode(inode) ||
93 (generation && inode->i_generation != generation)) {
94 result = ERR_PTR(-ESTALE);
95 goto out_iput;
96 }
97
98 result = d_alloc_anon(inode);
99 if (!result) {
100 result = ERR_PTR(-ENOMEM);
101 goto out_iput;
102 }
103 return result;
104
105 out_iput:
106 iput(inode);
107 return result;
108}
109
78struct dentry *efs_get_parent(struct dentry *child) 110struct dentry *efs_get_parent(struct dentry *child)
79{ 111{
80 struct dentry *parent; 112 struct dentry *parent;
diff --git a/fs/efs/super.c b/fs/efs/super.c
index e0a6839e68..ce4acb8ff8 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>
@@ -74,13 +75,13 @@ static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flag
74 75
75 inode_init_once(&ei->vfs_inode); 76 inode_init_once(&ei->vfs_inode);
76} 77}
77 78
78static int init_inodecache(void) 79static int init_inodecache(void)
79{ 80{
80 efs_inode_cachep = kmem_cache_create("efs_inode_cache", 81 efs_inode_cachep = kmem_cache_create("efs_inode_cache",
81 sizeof(struct efs_inode_info), 82 sizeof(struct efs_inode_info),
82 0, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD, 83 0, SLAB_RECLAIM_ACCOUNT|SLAB_MEM_SPREAD,
83 init_once, NULL); 84 init_once);
84 if (efs_inode_cachep == NULL) 85 if (efs_inode_cachep == NULL)
85 return -ENOMEM; 86 return -ENOMEM;
86 return 0; 87 return 0;
@@ -113,6 +114,7 @@ static const struct super_operations efs_superblock_operations = {
113}; 114};
114 115
115static struct export_operations efs_export_ops = { 116static struct export_operations efs_export_ops = {
117 .get_dentry = efs_get_dentry,
116 .get_parent = efs_get_parent, 118 .get_parent = efs_get_parent,
117}; 119};
118 120