Reduce path_lookup() abuses

... use kern_path() where possible

[folded a fix from rdd]

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
Al Viro
2009-04-02 21:17:03 -04:00
parent 6b3304b531
commit e24977d45f
4 changed files with 25 additions and 25 deletions

View File

@@ -1282,21 +1282,21 @@ static int gfs2_get_sb(struct file_system_type *fs_type, int flags,
static struct super_block *get_gfs2_sb(const char *dev_name)
{
struct super_block *sb;
struct nameidata nd;
struct path path;
int error;
error = path_lookup(dev_name, LOOKUP_FOLLOW, &nd);
error = kern_path(dev_name, LOOKUP_FOLLOW, &path);
if (error) {
printk(KERN_WARNING "GFS2: path_lookup on %s returned error %d\n",
dev_name, error);
return NULL;
}
sb = nd.path.dentry->d_inode->i_sb;
sb = path.dentry->d_inode->i_sb;
if (sb && (sb->s_type == &gfs2_fs_type))
atomic_inc(&sb->s_active);
else
sb = NULL;
path_put(&nd.path);
path_put(&path);
return sb;
}