aboutsummaryrefslogtreecommitdiffstats
path: root/fs/configfs/symlink.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:22:40 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 13:22:40 -0400
commit5ed487bc2c44ca4e9668ef9cb54c830e2a9fac47 (patch)
treeaf19ed28db83e8f52690872ac99336da1cf2fd3b /fs/configfs/symlink.c
parent5b34653963de7a6d0d8c783527457d68fddc60fb (diff)
parentfd217f4d70172c526478f2bc76859e909fdfa674 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (46 commits) [PATCH] fs: add a sanity check in d_free [PATCH] i_version: remount support [patch] vfs: make security_inode_setattr() calling consistent [patch 1/3] FS_MBCACHE: don't needlessly make it built-in [PATCH] move executable checking into ->permission() [PATCH] fs/dcache.c: update comment of d_validate() [RFC PATCH] touch_mnt_namespace when the mount flags change [PATCH] reiserfs: add missing llseek method [PATCH] fix ->llseek for more directories [PATCH vfs-2.6 6/6] vfs: add LOOKUP_RENAME_TARGET intent [PATCH vfs-2.6 5/6] vfs: remove LOOKUP_PARENT from non LOOKUP_PARENT lookup [PATCH vfs-2.6 4/6] vfs: remove unnecessary fsnotify_d_instantiate() [PATCH vfs-2.6 3/6] vfs: add __d_instantiate() helper [PATCH vfs-2.6 2/6] vfs: add d_ancestor() [PATCH vfs-2.6 1/6] vfs: replace parent == dentry->d_parent by IS_ROOT() [PATCH] get rid of on-stack dentry in udf [PATCH 2/2] anondev: switch to IDA [PATCH 1/2] anondev: init IDR statically [JFFS2] Use d_splice_alias() not d_add() in jffs2_lookup() [PATCH] Optimise NFS readdir hack slightly. ...
Diffstat (limited to 'fs/configfs/symlink.c')
-rw-r--r--fs/configfs/symlink.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/configfs/symlink.c b/fs/configfs/symlink.c
index bf74973b0492..932a92b31483 100644
--- a/fs/configfs/symlink.c
+++ b/fs/configfs/symlink.c
@@ -108,18 +108,18 @@ out:
108} 108}
109 109
110 110
111static int get_target(const char *symname, struct nameidata *nd, 111static int get_target(const char *symname, struct path *path,
112 struct config_item **target) 112 struct config_item **target)
113{ 113{
114 int ret; 114 int ret;
115 115
116 ret = path_lookup(symname, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, nd); 116 ret = kern_path(symname, LOOKUP_FOLLOW|LOOKUP_DIRECTORY, path);
117 if (!ret) { 117 if (!ret) {
118 if (nd->path.dentry->d_sb == configfs_sb) { 118 if (path->dentry->d_sb == configfs_sb) {
119 *target = configfs_get_config_item(nd->path.dentry); 119 *target = configfs_get_config_item(path->dentry);
120 if (!*target) { 120 if (!*target) {
121 ret = -ENOENT; 121 ret = -ENOENT;
122 path_put(&nd->path); 122 path_put(path);
123 } 123 }
124 } else 124 } else
125 ret = -EPERM; 125 ret = -EPERM;
@@ -132,7 +132,7 @@ static int get_target(const char *symname, struct nameidata *nd,
132int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname) 132int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symname)
133{ 133{
134 int ret; 134 int ret;
135 struct nameidata nd; 135 struct path path;
136 struct configfs_dirent *sd; 136 struct configfs_dirent *sd;
137 struct config_item *parent_item; 137 struct config_item *parent_item;
138 struct config_item *target_item; 138 struct config_item *target_item;
@@ -159,7 +159,7 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna
159 !type->ct_item_ops->allow_link) 159 !type->ct_item_ops->allow_link)
160 goto out_put; 160 goto out_put;
161 161
162 ret = get_target(symname, &nd, &target_item); 162 ret = get_target(symname, &path, &target_item);
163 if (ret) 163 if (ret)
164 goto out_put; 164 goto out_put;
165 165
@@ -174,7 +174,7 @@ int configfs_symlink(struct inode *dir, struct dentry *dentry, const char *symna
174 } 174 }
175 175
176 config_item_put(target_item); 176 config_item_put(target_item);
177 path_put(&nd.path); 177 path_put(&path);
178 178
179out_put: 179out_put:
180 config_item_put(parent_item); 180 config_item_put(parent_item);