diff -Naurp linux-post-2.6.24/fs/squashfs/inode.c linux-pre-2.6.25/fs/squashfs/inode.c --- linux-post-2.6.24/fs/squashfs/inode.c 2008-06-13 00:45:31.000000000 +0100 +++ linux-pre-2.6.25/fs/squashfs/inode.c 2008-06-13 00:46:27.000000000 +0100 @@ -32,14 +32,10 @@ #include #include #include #include "squashfs.h" -static struct dentry *squashfs_fh_to_dentry(struct super_block *s, - struct fid *fid, int fh_len, int fh_type); -static struct dentry *squashfs_fh_to_parent(struct super_block *s, - struct fid *fid, int fh_len, int fh_type); +static void vfs_read_inode(struct inode *i); static struct dentry *squashfs_get_parent(struct dentry *child); static int squashfs_read_inode(struct inode *i, squashfs_inode_t inode); static int squashfs_statfs(struct dentry *, struct kstatfs *); @@ -80,9 +76,15 @@ static struct super_operations squashfs_ .remount_fs = squashfs_remount }; +static struct super_operations squashfs_export_super_ops = { + .alloc_inode = squashfs_alloc_inode, + .destroy_inode = squashfs_destroy_inode, + .statfs = squashfs_statfs, + .put_super = squashfs_put_super, + .read_inode = vfs_read_inode +}; + static struct export_operations squashfs_export_ops = { - .fh_to_dentry = squashfs_fh_to_dentry, - .fh_to_parent = squashfs_fh_to_parent, .get_parent = squashfs_get_parent }; @@ -631,72 +633,42 @@ static squashfs_inode_t squashfs_inode_l out: return SQUASHFS_INVALID_BLK; } + - - -static struct dentry *squashfs_export_iget(struct super_block *s, - unsigned int inode_number) -{ - squashfs_inode_t inode; - struct inode *i; - struct dentry *dentry; - - 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); - } - -failure: - return dentry; -} - - -static struct dentry *squashfs_fh_to_dentry(struct super_block *s, - struct fid *fid, int fh_len, int fh_type) +static void vfs_read_inode(struct inode *i) { - if((fh_type != FILEID_INO32_GEN && fh_type != FILEID_INO32_GEN_PARENT) || - fh_len < 2) - return NULL; - - return squashfs_export_iget(s, fid->i32.ino); -} + struct squashfs_sb_info *msblk = i->i_sb->s_fs_info; + squashfs_inode_t inode = squashfs_inode_lookup(i->i_sb, i->i_ino); + TRACE("Entered vfs_read_inode\n"); -static struct dentry *squashfs_fh_to_parent(struct super_block *s, - struct fid *fid, int fh_len, int fh_type) -{ - if(fh_type != FILEID_INO32_GEN_PARENT || fh_len < 4) - return NULL; - - return squashfs_export_iget(s, fid->i32.parent_ino); + if(inode != SQUASHFS_INVALID_BLK) + (msblk->read_inode)(i, inode); } static struct dentry *squashfs_get_parent(struct dentry *child) { struct inode *i = child->d_inode; + struct inode *parent = iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode); + struct dentry *rv; TRACE("Entered squashfs_get_parent\n"); - return squashfs_export_iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode); -} + if(parent == NULL) { + rv = ERR_PTR(-EACCES); + goto out; + } + rv = d_alloc_anon(parent); + if(rv == NULL) + rv = ERR_PTR(-ENOMEM); +out: + return rv; +} + + SQSH_EXTERN struct inode *squashfs_iget(struct super_block *s, squashfs_inode_t inode, unsigned int inode_number) { @@ -1247,6 +1219,7 @@ static int squashfs_fill_super(struct su if (read_inode_lookup_table(s) == 0) goto failed_mount; + s->s_op = &squashfs_export_super_ops; s->s_export_op = &squashfs_export_ops; allocate_root: