[PATCH squashfs] fix squashfs for d_alloc_anon removal

From: Kyle McMartin
Date: Mon Nov 17 2008 - 13:58:46 EST


Signed-off-by: Kyle McMartin <kyle@xxxxxxxxxx>

diff --git a/fs/squashfs/inode.c b/fs/squashfs/inode.c
index 0c0173c..335ba3e 100644
--- a/fs/squashfs/inode.c
+++ b/fs/squashfs/inode.c
@@ -639,29 +639,14 @@ static struct dentry *squashfs_export_iget(struct super_block *s,
{
squashfs_inode_t inode;
struct inode *i;
- struct dentry *dentry;
+ struct dentry *dentry = ERR_PTR(-ENOENT);

TRACE("Entered squashfs_export_iget\n");

inode = squashfs_inode_lookup(s, inode_number);
- if(inode == SQUASHFS_INVALID_BLK) {
- dentry = ERR_PTR(-ENOENT);
- goto failure;
- }
-
- i = squashfs_iget(s, inode, inode_number);
- if(i == NULL) {
- dentry = ERR_PTR(-EACCES);
- goto failure;
- }
-
- dentry = d_alloc_anon(i);
- if (dentry == NULL) {
- iput(i);
- dentry = ERR_PTR(-ENOMEM);
- }
+ if (inode != SQUASHFS_INVALID_BLK)
+ dentry = d_obtain_alias(squashfs_iget(s, inode, inode_number));

-failure:
return dentry;
}

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/