get rid of kern_path_parent()

all callers want the same thing, actually - a kinda-sorta analog of
kern_path_create().  I.e. they want parent vfsmount/dentry (with
->i_mutex held, to make sure the child dentry is still their child)
+ the child dentry.

Signed-off-by Al Viro <viro@zeniv.linux.org.uk>
Šī revīzija ir iekļauta:
Al Viro
2012-06-15 03:01:42 +04:00
vecāks 1acf0af9b9
revīzija 79714f72d3
4 mainīti faili ar 65 papildinājumiem un 82 dzēšanām

Parādīt failu

@@ -1814,9 +1814,27 @@ static int do_path_lookup(int dfd, const char *name,
return retval;
}
int kern_path_parent(const char *name, struct nameidata *nd)
/* does lookup, returns the object with parent locked */
struct dentry *kern_path_locked(const char *name, struct path *path)
{
return do_path_lookup(AT_FDCWD, name, LOOKUP_PARENT, nd);
struct nameidata nd;
struct dentry *d;
int err = do_path_lookup(AT_FDCWD, name, LOOKUP_PARENT, &nd);
if (err)
return ERR_PTR(err);
if (nd.last_type != LAST_NORM) {
path_put(&nd.path);
return ERR_PTR(-EINVAL);
}
mutex_lock_nested(&nd.path.dentry->d_inode->i_mutex, I_MUTEX_PARENT);
d = lookup_one_len(nd.last.name, nd.path.dentry, nd.last.len);
if (IS_ERR(d)) {
mutex_unlock(&nd.path.dentry->d_inode->i_mutex);
path_put(&nd.path);
return d;
}
*path = nd.path;
return d;
}
int kern_path(const char *name, unsigned int flags, struct path *path)