Commit af569596a9b85626564149c5c4c0c17d05baa2da
1 parent
cc1dad7183
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
kill v9fs_dentry_from_dir_inode()
In *all* callers we have a dentry of child of that directory. Just use ->d_parent of that one, for fsck sake... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 1 changed file with 3 additions and 21 deletions Side-by-side Diff
fs/9p/vfs_inode_dotl.c
... | ... | @@ -68,24 +68,6 @@ |
68 | 68 | return current_fsgid(); |
69 | 69 | } |
70 | 70 | |
71 | -/** | |
72 | - * v9fs_dentry_from_dir_inode - helper function to get the dentry from | |
73 | - * dir inode. | |
74 | - * | |
75 | - */ | |
76 | - | |
77 | -static struct dentry *v9fs_dentry_from_dir_inode(struct inode *inode) | |
78 | -{ | |
79 | - struct dentry *dentry; | |
80 | - | |
81 | - spin_lock(&inode->i_lock); | |
82 | - /* Directory should have only one entry. */ | |
83 | - BUG_ON(S_ISDIR(inode->i_mode) && !list_is_singular(&inode->i_dentry)); | |
84 | - dentry = list_entry(inode->i_dentry.next, struct dentry, d_alias); | |
85 | - spin_unlock(&inode->i_lock); | |
86 | - return dentry; | |
87 | -} | |
88 | - | |
89 | 71 | static int v9fs_test_inode_dotl(struct inode *inode, void *data) |
90 | 72 | { |
91 | 73 | struct v9fs_inode *v9inode = V9FS_I(inode); |
... | ... | @@ -415,7 +397,7 @@ |
415 | 397 | if (dir->i_mode & S_ISGID) |
416 | 398 | omode |= S_ISGID; |
417 | 399 | |
418 | - dir_dentry = v9fs_dentry_from_dir_inode(dir); | |
400 | + dir_dentry = dentry->d_parent; | |
419 | 401 | dfid = v9fs_fid_lookup(dir_dentry); |
420 | 402 | if (IS_ERR(dfid)) { |
421 | 403 | err = PTR_ERR(dfid); |
... | ... | @@ -793,7 +775,7 @@ |
793 | 775 | dir->i_ino, old_dentry->d_name.name, dentry->d_name.name); |
794 | 776 | |
795 | 777 | v9ses = v9fs_inode2v9ses(dir); |
796 | - dir_dentry = v9fs_dentry_from_dir_inode(dir); | |
778 | + dir_dentry = dentry->d_parent; | |
797 | 779 | dfid = v9fs_fid_lookup(dir_dentry); |
798 | 780 | if (IS_ERR(dfid)) |
799 | 781 | return PTR_ERR(dfid); |
... | ... | @@ -858,7 +840,7 @@ |
858 | 840 | return -EINVAL; |
859 | 841 | |
860 | 842 | v9ses = v9fs_inode2v9ses(dir); |
861 | - dir_dentry = v9fs_dentry_from_dir_inode(dir); | |
843 | + dir_dentry = dentry->d_parent; | |
862 | 844 | dfid = v9fs_fid_lookup(dir_dentry); |
863 | 845 | if (IS_ERR(dfid)) { |
864 | 846 | err = PTR_ERR(dfid); |