diff options
Diffstat (limited to 'fs/jfs/namei.c')
-rw-r--r-- | fs/jfs/namei.c | 35 |
1 files changed, 19 insertions, 16 deletions
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 | ||
1480 | struct dentry *jfs_get_dentry(struct super_block *sb, void *vobjp) | 1481 | static 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: | 1501 | struct 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 | |||
1508 | struct 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 | ||
1512 | struct dentry *jfs_get_parent(struct dentry *dentry) | 1515 | struct dentry *jfs_get_parent(struct dentry *dentry) |