Commit 6b9cceea authored by Al Viro's avatar Al Viro

hfs: use d_splice_alias()

code is simpler that way
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 18fbbfc2
...@@ -31,21 +31,15 @@ static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry, ...@@ -31,21 +31,15 @@ static struct dentry *hfs_lookup(struct inode *dir, struct dentry *dentry,
hfs_cat_build_key(dir->i_sb, fd.search_key, dir->i_ino, &dentry->d_name); hfs_cat_build_key(dir->i_sb, fd.search_key, dir->i_ino, &dentry->d_name);
res = hfs_brec_read(&fd, &rec, sizeof(rec)); res = hfs_brec_read(&fd, &rec, sizeof(rec));
if (res) { if (res) {
hfs_find_exit(&fd); if (res != -ENOENT)
if (res == -ENOENT) { inode = ERR_PTR(res);
/* No such entry */ } else {
inode = NULL; inode = hfs_iget(dir->i_sb, &fd.search_key->cat, &rec);
goto done; if (!inode)
} inode = ERR_PTR(-EACCES);
return ERR_PTR(res);
} }
inode = hfs_iget(dir->i_sb, &fd.search_key->cat, &rec);
hfs_find_exit(&fd); hfs_find_exit(&fd);
if (!inode) return d_splice_alias(inode, dentry);
return ERR_PTR(-EACCES);
done:
d_add(dentry, inode);
return NULL;
} }
/* /*
......
...@@ -544,8 +544,7 @@ static struct dentry *hfs_file_lookup(struct inode *dir, struct dentry *dentry, ...@@ -544,8 +544,7 @@ static struct dentry *hfs_file_lookup(struct inode *dir, struct dentry *dentry,
hlist_add_fake(&inode->i_hash); hlist_add_fake(&inode->i_hash);
mark_inode_dirty(inode); mark_inode_dirty(inode);
out: out:
d_add(dentry, inode); return d_splice_alias(inode, dentry);
return NULL;
} }
void hfs_evict_inode(struct inode *inode) void hfs_evict_inode(struct inode *inode)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment