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:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user