Loading fs/dcache.c +5 −5 Original line number Diff line number Diff line Loading @@ -1187,17 +1187,17 @@ struct dentry * d_alloc_anon(struct inode *inode) * allocating a new one. * * On successful return, the reference to the inode has been transferred * to the dentry. If %NULL is returned (indicating kmalloc failure), * the reference on the inode has been released. To make it easier * to use in export operations a NULL or IS_ERR inode may be passed in * and will be casted to the corresponding NULL or IS_ERR dentry. * to the dentry. In case of an error the reference on the inode is released. * To make it easier to use in export operations a %NULL or IS_ERR inode may * be passed in and will be the error will be propagate to the return value, * with a %NULL @inode replaced by ERR_PTR(-ESTALE). */ struct dentry *d_obtain_alias(struct inode *inode) { struct dentry *dentry; if (!inode) return NULL; return ERR_PTR(-ESTALE); if (IS_ERR(inode)) return ERR_CAST(inode); Loading fs/efs/namei.c +4 −25 Original line number Diff line number Diff line Loading @@ -112,35 +112,14 @@ struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid, struct dentry *efs_get_parent(struct dentry *child) { struct dentry *parent; struct inode *inode; struct dentry *parent = ERR_PTR(-ENOENT); efs_ino_t ino; long error; lock_kernel(); error = -ENOENT; ino = efs_find_entry(child->d_inode, "..", 2); if (!ino) goto fail; inode = efs_iget(child->d_inode->i_sb, ino); if (IS_ERR(inode)) { error = PTR_ERR(inode); goto fail; } error = -ENOMEM; parent = d_alloc_anon(inode); if (!parent) goto fail_iput; if (ino) parent = d_obtain_alias(efs_iget(child->d_inode->i_sb, ino)); unlock_kernel(); return parent; fail_iput: iput(inode); fail: unlock_kernel(); return ERR_PTR(error); return parent; } fs/exportfs/expfs.c +0 −4 Original line number Diff line number Diff line Loading @@ -366,8 +366,6 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid, * Try to get any dentry for the given file handle from the filesystem. */ result = nop->fh_to_dentry(mnt->mnt_sb, fid, fh_len, fileid_type); if (!result) result = ERR_PTR(-ESTALE); if (IS_ERR(result)) return result; Loading Loading @@ -422,8 +420,6 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid, target_dir = nop->fh_to_parent(mnt->mnt_sb, fid, fh_len, fileid_type); if (!target_dir) goto err_result; err = PTR_ERR(target_dir); if (IS_ERR(target_dir)) goto err_result; Loading fs/ext2/namei.c +1 −12 Original line number Diff line number Diff line Loading @@ -73,8 +73,6 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, str struct dentry *ext2_get_parent(struct dentry *child) { unsigned long ino; struct dentry *parent; struct inode *inode; struct dentry dotdot; dotdot.d_name.name = ".."; Loading @@ -83,16 +81,7 @@ struct dentry *ext2_get_parent(struct dentry *child) ino = ext2_inode_by_name(child->d_inode, &dotdot); if (!ino) return ERR_PTR(-ENOENT); inode = ext2_iget(child->d_inode->i_sb, ino); if (IS_ERR(inode)) return ERR_CAST(inode); parent = d_alloc_anon(inode); if (!parent) { iput(inode); parent = ERR_PTR(-ENOMEM); } return parent; return d_obtain_alias(ext2_iget(child->d_inode->i_sb, ino)); } /* Loading fs/ext3/namei.c +1 −13 Original line number Diff line number Diff line Loading @@ -1057,8 +1057,6 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str struct dentry *ext3_get_parent(struct dentry *child) { unsigned long ino; struct dentry *parent; struct inode *inode; struct dentry dotdot; struct ext3_dir_entry_2 * de; struct buffer_head *bh; Loading @@ -1068,7 +1066,6 @@ struct dentry *ext3_get_parent(struct dentry *child) dotdot.d_parent = child; /* confusing, isn't it! */ bh = ext3_find_entry(&dotdot, &de); inode = NULL; if (!bh) return ERR_PTR(-ENOENT); ino = le32_to_cpu(de->inode); Loading @@ -1080,16 +1077,7 @@ struct dentry *ext3_get_parent(struct dentry *child) return ERR_PTR(-EIO); } inode = ext3_iget(child->d_inode->i_sb, ino); if (IS_ERR(inode)) return ERR_CAST(inode); parent = d_alloc_anon(inode); if (!parent) { iput(inode); parent = ERR_PTR(-ENOMEM); } return parent; return d_obtain_alias(ext3_iget(child->d_inode->i_sb, ino)); } #define S_SHIFT 12 Loading Loading
fs/dcache.c +5 −5 Original line number Diff line number Diff line Loading @@ -1187,17 +1187,17 @@ struct dentry * d_alloc_anon(struct inode *inode) * allocating a new one. * * On successful return, the reference to the inode has been transferred * to the dentry. If %NULL is returned (indicating kmalloc failure), * the reference on the inode has been released. To make it easier * to use in export operations a NULL or IS_ERR inode may be passed in * and will be casted to the corresponding NULL or IS_ERR dentry. * to the dentry. In case of an error the reference on the inode is released. * To make it easier to use in export operations a %NULL or IS_ERR inode may * be passed in and will be the error will be propagate to the return value, * with a %NULL @inode replaced by ERR_PTR(-ESTALE). */ struct dentry *d_obtain_alias(struct inode *inode) { struct dentry *dentry; if (!inode) return NULL; return ERR_PTR(-ESTALE); if (IS_ERR(inode)) return ERR_CAST(inode); Loading
fs/efs/namei.c +4 −25 Original line number Diff line number Diff line Loading @@ -112,35 +112,14 @@ struct dentry *efs_fh_to_parent(struct super_block *sb, struct fid *fid, struct dentry *efs_get_parent(struct dentry *child) { struct dentry *parent; struct inode *inode; struct dentry *parent = ERR_PTR(-ENOENT); efs_ino_t ino; long error; lock_kernel(); error = -ENOENT; ino = efs_find_entry(child->d_inode, "..", 2); if (!ino) goto fail; inode = efs_iget(child->d_inode->i_sb, ino); if (IS_ERR(inode)) { error = PTR_ERR(inode); goto fail; } error = -ENOMEM; parent = d_alloc_anon(inode); if (!parent) goto fail_iput; if (ino) parent = d_obtain_alias(efs_iget(child->d_inode->i_sb, ino)); unlock_kernel(); return parent; fail_iput: iput(inode); fail: unlock_kernel(); return ERR_PTR(error); return parent; }
fs/exportfs/expfs.c +0 −4 Original line number Diff line number Diff line Loading @@ -366,8 +366,6 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid, * Try to get any dentry for the given file handle from the filesystem. */ result = nop->fh_to_dentry(mnt->mnt_sb, fid, fh_len, fileid_type); if (!result) result = ERR_PTR(-ESTALE); if (IS_ERR(result)) return result; Loading Loading @@ -422,8 +420,6 @@ struct dentry *exportfs_decode_fh(struct vfsmount *mnt, struct fid *fid, target_dir = nop->fh_to_parent(mnt->mnt_sb, fid, fh_len, fileid_type); if (!target_dir) goto err_result; err = PTR_ERR(target_dir); if (IS_ERR(target_dir)) goto err_result; Loading
fs/ext2/namei.c +1 −12 Original line number Diff line number Diff line Loading @@ -73,8 +73,6 @@ static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, str struct dentry *ext2_get_parent(struct dentry *child) { unsigned long ino; struct dentry *parent; struct inode *inode; struct dentry dotdot; dotdot.d_name.name = ".."; Loading @@ -83,16 +81,7 @@ struct dentry *ext2_get_parent(struct dentry *child) ino = ext2_inode_by_name(child->d_inode, &dotdot); if (!ino) return ERR_PTR(-ENOENT); inode = ext2_iget(child->d_inode->i_sb, ino); if (IS_ERR(inode)) return ERR_CAST(inode); parent = d_alloc_anon(inode); if (!parent) { iput(inode); parent = ERR_PTR(-ENOMEM); } return parent; return d_obtain_alias(ext2_iget(child->d_inode->i_sb, ino)); } /* Loading
fs/ext3/namei.c +1 −13 Original line number Diff line number Diff line Loading @@ -1057,8 +1057,6 @@ static struct dentry *ext3_lookup(struct inode * dir, struct dentry *dentry, str struct dentry *ext3_get_parent(struct dentry *child) { unsigned long ino; struct dentry *parent; struct inode *inode; struct dentry dotdot; struct ext3_dir_entry_2 * de; struct buffer_head *bh; Loading @@ -1068,7 +1066,6 @@ struct dentry *ext3_get_parent(struct dentry *child) dotdot.d_parent = child; /* confusing, isn't it! */ bh = ext3_find_entry(&dotdot, &de); inode = NULL; if (!bh) return ERR_PTR(-ENOENT); ino = le32_to_cpu(de->inode); Loading @@ -1080,16 +1077,7 @@ struct dentry *ext3_get_parent(struct dentry *child) return ERR_PTR(-EIO); } inode = ext3_iget(child->d_inode->i_sb, ino); if (IS_ERR(inode)) return ERR_CAST(inode); parent = d_alloc_anon(inode); if (!parent) { iput(inode); parent = ERR_PTR(-ENOMEM); } return parent; return d_obtain_alias(ext3_iget(child->d_inode->i_sb, ino)); } #define S_SHIFT 12 Loading