Commit eaede9da authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[PATCH] allow NFS exports of EFS filesystems

Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent ebe977b7
...@@ -75,3 +75,36 @@ struct dentry *efs_lookup(struct inode *dir, struct dentry *dentry, struct namei ...@@ -75,3 +75,36 @@ struct dentry *efs_lookup(struct inode *dir, struct dentry *dentry, struct namei
return NULL; return NULL;
} }
struct dentry *efs_get_parent(struct dentry *child)
{
struct dentry *parent;
struct inode *inode;
efs_ino_t ino;
int error;
lock_kernel();
error = -ENOENT;
ino = efs_find_entry(child->d_inode, "..", 2);
if (!ino)
goto fail;
error = -EACCES;
inode = iget(child->d_inode->i_sb, ino);
if (!inode)
goto fail;
error = -ENOMEM;
parent = d_alloc_anon(inode);
if (!parent)
goto fail_iput;
unlock_kernel();
return parent;
fail_iput:
iput(inode);
fail:
unlock_kernel();
return ERR_PTR(error);
}
...@@ -95,6 +95,10 @@ static struct super_operations efs_superblock_operations = { ...@@ -95,6 +95,10 @@ static struct super_operations efs_superblock_operations = {
.remount_fs = efs_remount, .remount_fs = efs_remount,
}; };
static struct export_operations efs_export_ops = {
.get_parent = efs_get_parent,
};
static int __init init_efs_fs(void) { static int __init init_efs_fs(void) {
int err; int err;
printk("EFS: "EFS_VERSION" - http://aeschi.ch.eu.org/efs/\n"); printk("EFS: "EFS_VERSION" - http://aeschi.ch.eu.org/efs/\n");
...@@ -278,6 +282,7 @@ static int efs_fill_super(struct super_block *s, void *d, int silent) ...@@ -278,6 +282,7 @@ static int efs_fill_super(struct super_block *s, void *d, int silent)
s->s_flags |= MS_RDONLY; s->s_flags |= MS_RDONLY;
} }
s->s_op = &efs_superblock_operations; s->s_op = &efs_superblock_operations;
s->s_export_op = &efs_export_ops;
root = iget(s, EFS_ROOTINODE); root = iget(s, EFS_ROOTINODE);
s->s_root = d_alloc_root(root); s->s_root = d_alloc_root(root);
......
...@@ -45,6 +45,7 @@ extern efs_block_t efs_map_block(struct inode *, efs_block_t); ...@@ -45,6 +45,7 @@ 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 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_lookup(struct inode *, struct dentry *, struct nameidata *);
extern struct dentry *efs_get_parent(struct dentry *);
extern int efs_bmap(struct inode *, int); extern int efs_bmap(struct inode *, int);
#endif /* __EFS_FS_H__ */ #endif /* __EFS_FS_H__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment