diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-04-02 20:02:53 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-05-29 23:28:34 -0400 |
commit | af569596a9b85626564149c5c4c0c17d05baa2da (patch) | |
tree | 19e3da1fc79d98451c2ac3bbbce0f1633a0e0746 /fs/9p | |
parent | cc1dad7183e4cb7f5d313b6942f2059fc0eabab6 (diff) |
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>
Diffstat (limited to 'fs/9p')
-rw-r--r-- | fs/9p/vfs_inode_dotl.c | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index a1e6c990cd41..e3dd2a1e2bfc 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c | |||
@@ -68,24 +68,6 @@ static gid_t v9fs_get_fsgid_for_create(struct inode *dir_inode) | |||
68 | return current_fsgid(); | 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 | static int v9fs_test_inode_dotl(struct inode *inode, void *data) | 71 | static int v9fs_test_inode_dotl(struct inode *inode, void *data) |
90 | { | 72 | { |
91 | struct v9fs_inode *v9inode = V9FS_I(inode); | 73 | struct v9fs_inode *v9inode = V9FS_I(inode); |
@@ -415,7 +397,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir, | |||
415 | if (dir->i_mode & S_ISGID) | 397 | if (dir->i_mode & S_ISGID) |
416 | omode |= S_ISGID; | 398 | omode |= S_ISGID; |
417 | 399 | ||
418 | dir_dentry = v9fs_dentry_from_dir_inode(dir); | 400 | dir_dentry = dentry->d_parent; |
419 | dfid = v9fs_fid_lookup(dir_dentry); | 401 | dfid = v9fs_fid_lookup(dir_dentry); |
420 | if (IS_ERR(dfid)) { | 402 | if (IS_ERR(dfid)) { |
421 | err = PTR_ERR(dfid); | 403 | err = PTR_ERR(dfid); |
@@ -793,7 +775,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir, | |||
793 | dir->i_ino, old_dentry->d_name.name, dentry->d_name.name); | 775 | dir->i_ino, old_dentry->d_name.name, dentry->d_name.name); |
794 | 776 | ||
795 | v9ses = v9fs_inode2v9ses(dir); | 777 | v9ses = v9fs_inode2v9ses(dir); |
796 | dir_dentry = v9fs_dentry_from_dir_inode(dir); | 778 | dir_dentry = dentry->d_parent; |
797 | dfid = v9fs_fid_lookup(dir_dentry); | 779 | dfid = v9fs_fid_lookup(dir_dentry); |
798 | if (IS_ERR(dfid)) | 780 | if (IS_ERR(dfid)) |
799 | return PTR_ERR(dfid); | 781 | return PTR_ERR(dfid); |
@@ -858,7 +840,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, umode_t omode, | |||
858 | return -EINVAL; | 840 | return -EINVAL; |
859 | 841 | ||
860 | v9ses = v9fs_inode2v9ses(dir); | 842 | v9ses = v9fs_inode2v9ses(dir); |
861 | dir_dentry = v9fs_dentry_from_dir_inode(dir); | 843 | dir_dentry = dentry->d_parent; |
862 | dfid = v9fs_fid_lookup(dir_dentry); | 844 | dfid = v9fs_fid_lookup(dir_dentry); |
863 | if (IS_ERR(dfid)) { | 845 | if (IS_ERR(dfid)) { |
864 | err = PTR_ERR(dfid); | 846 | err = PTR_ERR(dfid); |