diff options
author | 2004-01-19 18:20:49 +0000 | |
---|---|---|
committer | 2004-01-19 18:20:49 +0000 | |
commit | e815c03771bfe19a12f9ff76639b28567942903c (patch) | |
tree | f60f5388664f618704a943e1ddd15e52168cdda1 /kernel/inode.c | |
parent | 7c35cf9df254b3d315a0036f8102afa72f0a382d (diff) |
NFS export for 2.6
Diffstat (limited to 'kernel/inode.c')
-rw-r--r-- | kernel/inode.c | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/kernel/inode.c b/kernel/inode.c index a868edb..4a16051 100644 --- a/kernel/inode.c +++ b/kernel/inode.c @@ -105,14 +105,6 @@ static int fuse_statfs(struct super_block *sb, struct kstatfs *buf) return out.h.error; } -static struct super_operations fuse_super_operations = { - .read_inode = fuse_read_inode, - .clear_inode = fuse_clear_inode, - .put_super = fuse_put_super, - .statfs = fuse_statfs, -}; - - static struct fuse_conn *get_conn(struct fuse_mount_data *d) { struct fuse_conn *fc = NULL; @@ -156,6 +148,45 @@ static struct inode *get_root_inode(struct super_block *sb, unsigned int mode) return fuse_iget(sb, 1, &attr, 0); } + +#ifdef KERNEL_2_6 + +static struct dentry *fuse_get_dentry(struct super_block *sb, void *vobjp) +{ + __u32 *objp = vobjp; + unsigned long ino = objp[0]; + /* __u32 generation = objp[1]; */ + struct inode *inode; + struct dentry *entry; + + if(ino == 0) + return ERR_PTR(-ESTALE); + + inode = ilookup(sb, ino); + if(!inode) + return ERR_PTR(-ESTALE); + + entry = d_alloc_anon(inode); + if(!entry) { + iput(inode); + return ERR_PTR(-ENOMEM); + } + + return entry; +} + +static struct export_operations fuse_export_operations = { + .get_dentry = fuse_get_dentry, +}; +#endif + +static struct super_operations fuse_super_operations = { + .read_inode = fuse_read_inode, + .clear_inode = fuse_clear_inode, + .put_super = fuse_put_super, + .statfs = fuse_statfs, +}; + static int fuse_read_super(struct super_block *sb, void *data, int silent) { struct fuse_conn *fc; @@ -166,6 +197,9 @@ static int fuse_read_super(struct super_block *sb, void *data, int silent) sb->s_blocksize_bits = PAGE_CACHE_SHIFT; sb->s_magic = FUSE_SUPER_MAGIC; sb->s_op = &fuse_super_operations; +#ifdef KERNEL_2_6 + sb->s_export_op = &fuse_export_operations; +#endif root = get_root_inode(sb, d->rootmode); if(root == NULL) { |