aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2007-10-21 19:42:09 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-22 11:13:20 -0400
commitd425de704334dc2bad64ca6ea2ac20ef33c9e754 (patch)
tree5702b0ee4b47f3fd9423f1dfe5a889f43320a290 /fs
parent05da08048226cefd2ecc5fe925002d3cf849c7dd (diff)
jfs: 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> Cc: Dave Kleikamp <shaggy@austin.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/jfs/jfs_inode.h7
-rw-r--r--fs/jfs/namei.c35
-rw-r--r--fs/jfs/super.c3
3 files changed, 27 insertions, 18 deletions
diff --git a/fs/jfs/jfs_inode.h b/fs/jfs/jfs_inode.h
index f0ec72b263f1..8e2cf2cde185 100644
--- a/fs/jfs/jfs_inode.h
+++ b/fs/jfs/jfs_inode.h
@@ -18,6 +18,8 @@
18#ifndef _H_JFS_INODE 18#ifndef _H_JFS_INODE
19#define _H_JFS_INODE 19#define _H_JFS_INODE
20 20
21struct fid;
22
21extern struct inode *ialloc(struct inode *, umode_t); 23extern struct inode *ialloc(struct inode *, umode_t);
22extern int jfs_fsync(struct file *, struct dentry *, int); 24extern int jfs_fsync(struct file *, struct dentry *, int);
23extern int jfs_ioctl(struct inode *, struct file *, 25extern int jfs_ioctl(struct inode *, struct file *,
@@ -32,7 +34,10 @@ extern void jfs_truncate_nolock(struct inode *, loff_t);
32extern void jfs_free_zero_link(struct inode *); 34extern void jfs_free_zero_link(struct inode *);
33extern struct dentry *jfs_get_parent(struct dentry *dentry); 35extern struct dentry *jfs_get_parent(struct dentry *dentry);
34extern void jfs_get_inode_flags(struct jfs_inode_info *); 36extern void jfs_get_inode_flags(struct jfs_inode_info *);
35extern struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp); 37extern struct dentry *jfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
38 int fh_len, int fh_type);
39extern struct dentry *jfs_fh_to_parent(struct super_block *sb, struct fid *fid,
40 int fh_len, int fh_type);
36extern void jfs_set_inode_flags(struct inode *); 41extern void jfs_set_inode_flags(struct inode *);
37extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int); 42extern int jfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
38 43
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 932797ba433b..4e0a8493cef6 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -20,6 +20,7 @@
20#include <linux/fs.h> 20#include <linux/fs.h>
21#include <linux/ctype.h> 21#include <linux/ctype.h>
22#include <linux/quotaops.h> 22#include <linux/quotaops.h>
23#include <linux/exportfs.h>
23#include "jfs_incore.h" 24#include "jfs_incore.h"
24#include "jfs_superblock.h" 25#include "jfs_superblock.h"
25#include "jfs_inode.h" 26#include "jfs_inode.h"
@@ -1477,13 +1478,10 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc
1477 return dentry; 1478 return dentry;
1478} 1479}
1479 1480
1480struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp) 1481static struct inode *jfs_nfs_get_inode(struct super_block *sb,
1482 u64 ino, u32 generation)
1481{ 1483{
1482 __u32 *objp = vobjp;
1483 unsigned long ino = objp[0];
1484 __u32 generation = objp[1];
1485 struct inode *inode; 1484 struct inode *inode;
1486 struct dentry *result;
1487 1485
1488 if (ino == 0) 1486 if (ino == 0)
1489 return ERR_PTR(-ESTALE); 1487 return ERR_PTR(-ESTALE);
@@ -1493,20 +1491,25 @@ struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp)
1493 1491
1494 if (is_bad_inode(inode) || 1492 if (is_bad_inode(inode) ||
1495 (generation && inode->i_generation != generation)) { 1493 (generation && inode->i_generation != generation)) {
1496 result = ERR_PTR(-ESTALE); 1494 iput(inode);
1497 goto out_iput; 1495 return ERR_PTR(-ESTALE);
1498 } 1496 }
1499 1497
1500 result = d_alloc_anon(inode); 1498 return inode;
1501 if (!result) { 1499}
1502 result = ERR_PTR(-ENOMEM);
1503 goto out_iput;
1504 }
1505 return result;
1506 1500
1507 out_iput: 1501struct dentry *jfs_fh_to_dentry(struct super_block *sb, struct fid *fid,
1508 iput(inode); 1502 int fh_len, int fh_type)
1509 return result; 1503{
1504 return generic_fh_to_dentry(sb, fid, fh_len, fh_type,
1505 jfs_nfs_get_inode);
1506}
1507
1508struct dentry *jfs_fh_to_parent(struct super_block *sb, struct fid *fid,
1509 int fh_len, int fh_type)
1510{
1511 return generic_fh_to_parent(sb, fid, fh_len, fh_type,
1512 jfs_nfs_get_inode);
1510} 1513}
1511 1514
1512struct dentry *jfs_get_parent(struct dentry *dentry) 1515struct dentry *jfs_get_parent(struct dentry *dentry)
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index cff60c171943..81c3228ca455 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -738,7 +738,8 @@ static const struct super_operations jfs_super_operations = {
738}; 738};
739 739
740static struct export_operations jfs_export_operations = { 740static struct export_operations jfs_export_operations = {
741 .get_dentry = jfs_get_dentry, 741 .fh_to_dentry = jfs_fh_to_dentry,
742 .fh_to_parent = jfs_fh_to_parent,
742 .get_parent = jfs_get_parent, 743 .get_parent = jfs_get_parent,
743}; 744};
744 745