diff options
author | David Howells <dhowells@redhat.com> | 2008-02-07 03:15:43 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-07 11:42:28 -0500 |
commit | eab1df71a0ef6d333b9b826deaa0d0eb4b4f69dc (patch) | |
tree | 70d73e349ab1af57b1975762d9c1170f43de3562 /fs/jfs/namei.c | |
parent | 5451f79f5f817880958ed063864ad268d94ccd1f (diff) |
iget: stop JFS from using iget() and read_inode()
Stop the JFS filesystem from using iget() and read_inode(). Replace
jfs_read_inode() with jfs_iget(), and call that instead of iget(). jfs_iget()
then uses iget_locked() directly and returns a proper error code instead of an
inode in the event of an error.
jfs_fill_super() returns any error incurred when getting the root inode
instead of EINVAL.
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Acked-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/jfs/namei.c')
-rw-r--r-- | fs/jfs/namei.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c index f8718de3505e..403cfc24c6fe 100644 --- a/fs/jfs/namei.c +++ b/fs/jfs/namei.c | |||
@@ -1462,12 +1462,10 @@ static struct dentry *jfs_lookup(struct inode *dip, struct dentry *dentry, struc | |||
1462 | } | 1462 | } |
1463 | } | 1463 | } |
1464 | 1464 | ||
1465 | ip = iget(dip->i_sb, inum); | 1465 | ip = jfs_iget(dip->i_sb, inum); |
1466 | if (ip == NULL || is_bad_inode(ip)) { | 1466 | if (IS_ERR(ip)) { |
1467 | jfs_err("jfs_lookup: iget failed on inum %d", (uint) inum); | 1467 | jfs_err("jfs_lookup: iget failed on inum %d", (uint) inum); |
1468 | if (ip) | 1468 | return ERR_CAST(ip); |
1469 | iput(ip); | ||
1470 | return ERR_PTR(-EACCES); | ||
1471 | } | 1469 | } |
1472 | 1470 | ||
1473 | dentry = d_splice_alias(ip, dentry); | 1471 | dentry = d_splice_alias(ip, dentry); |
@@ -1485,12 +1483,11 @@ static struct inode *jfs_nfs_get_inode(struct super_block *sb, | |||
1485 | 1483 | ||
1486 | if (ino == 0) | 1484 | if (ino == 0) |
1487 | return ERR_PTR(-ESTALE); | 1485 | return ERR_PTR(-ESTALE); |
1488 | inode = iget(sb, ino); | 1486 | inode = jfs_iget(sb, ino); |
1489 | if (inode == NULL) | 1487 | if (IS_ERR(inode)) |
1490 | return ERR_PTR(-ENOMEM); | 1488 | return ERR_CAST(inode); |
1491 | 1489 | ||
1492 | if (is_bad_inode(inode) || | 1490 | if (generation && inode->i_generation != generation) { |
1493 | (generation && inode->i_generation != generation)) { | ||
1494 | iput(inode); | 1491 | iput(inode); |
1495 | return ERR_PTR(-ESTALE); | 1492 | return ERR_PTR(-ESTALE); |
1496 | } | 1493 | } |
@@ -1521,17 +1518,14 @@ struct dentry *jfs_get_parent(struct dentry *dentry) | |||
1521 | 1518 | ||
1522 | parent_ino = | 1519 | parent_ino = |
1523 | le32_to_cpu(JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot); | 1520 | le32_to_cpu(JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot); |
1524 | inode = iget(sb, parent_ino); | 1521 | inode = jfs_iget(sb, parent_ino); |
1525 | if (inode) { | 1522 | if (IS_ERR(inode)) { |
1526 | if (is_bad_inode(inode)) { | 1523 | parent = ERR_CAST(inode); |
1524 | } else { | ||
1525 | parent = d_alloc_anon(inode); | ||
1526 | if (!parent) { | ||
1527 | parent = ERR_PTR(-ENOMEM); | ||
1527 | iput(inode); | 1528 | iput(inode); |
1528 | parent = ERR_PTR(-EACCES); | ||
1529 | } else { | ||
1530 | parent = d_alloc_anon(inode); | ||
1531 | if (!parent) { | ||
1532 | parent = ERR_PTR(-ENOMEM); | ||
1533 | iput(inode); | ||
1534 | } | ||
1535 | } | 1529 | } |
1536 | } | 1530 | } |
1537 | 1531 | ||