You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
[PATCH] switch all filesystems over to d_obtain_alias
Switch all users of d_alloc_anon to d_obtain_alias. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
committed by
Al Viro
parent
4ea3ada295
commit
440037287c
+1
-14
@@ -1511,25 +1511,12 @@ struct dentry *jfs_fh_to_parent(struct super_block *sb, struct fid *fid,
|
||||
|
||||
struct dentry *jfs_get_parent(struct dentry *dentry)
|
||||
{
|
||||
struct super_block *sb = dentry->d_inode->i_sb;
|
||||
struct dentry *parent = ERR_PTR(-ENOENT);
|
||||
struct inode *inode;
|
||||
unsigned long parent_ino;
|
||||
|
||||
parent_ino =
|
||||
le32_to_cpu(JFS_IP(dentry->d_inode)->i_dtroot.header.idotdot);
|
||||
inode = jfs_iget(sb, parent_ino);
|
||||
if (IS_ERR(inode)) {
|
||||
parent = ERR_CAST(inode);
|
||||
} else {
|
||||
parent = d_alloc_anon(inode);
|
||||
if (!parent) {
|
||||
parent = ERR_PTR(-ENOMEM);
|
||||
iput(inode);
|
||||
}
|
||||
}
|
||||
|
||||
return parent;
|
||||
return d_obtain_alias(jfs_iget(dentry->d_inode->i_sb, parent_ino));
|
||||
}
|
||||
|
||||
const struct inode_operations jfs_dir_inode_operations = {
|
||||
|
||||
Reference in New Issue
Block a user