mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08:00
get rid of pointless checks after simple_pin_fs()
if we'd just got success from it, vfsmount won't be NULL Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
5998649f77
commit
ef52c75e4b
@ -160,15 +160,8 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
|
|||||||
* block. A pointer to that is in the struct vfsmount that we
|
* block. A pointer to that is in the struct vfsmount that we
|
||||||
* have around.
|
* have around.
|
||||||
*/
|
*/
|
||||||
if (!parent) {
|
if (!parent)
|
||||||
if (debugfs_mount && debugfs_mount->mnt_sb) {
|
parent = debugfs_mount->mnt_sb->s_root;
|
||||||
parent = debugfs_mount->mnt_sb->s_root;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!parent) {
|
|
||||||
pr_debug("debugfs: Ah! can not find a parent!\n");
|
|
||||||
return -EFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
*dentry = NULL;
|
*dentry = NULL;
|
||||||
mutex_lock(&parent->d_inode->i_mutex);
|
mutex_lock(&parent->d_inode->i_mutex);
|
||||||
|
@ -156,15 +156,8 @@ static int create_by_name(const char *name, mode_t mode,
|
|||||||
* block. A pointer to that is in the struct vfsmount that we
|
* block. A pointer to that is in the struct vfsmount that we
|
||||||
* have around.
|
* have around.
|
||||||
*/
|
*/
|
||||||
if (!parent ) {
|
if (!parent)
|
||||||
if (mount && mount->mnt_sb) {
|
parent = mount->mnt_sb->s_root;
|
||||||
parent = mount->mnt_sb->s_root;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!parent) {
|
|
||||||
pr_debug("securityfs: Ah! can not find a parent!\n");
|
|
||||||
return -EFAULT;
|
|
||||||
}
|
|
||||||
|
|
||||||
mutex_lock(&parent->d_inode->i_mutex);
|
mutex_lock(&parent->d_inode->i_mutex);
|
||||||
*dentry = lookup_one_len(name, parent, strlen(name));
|
*dentry = lookup_one_len(name, parent, strlen(name));
|
||||||
|
Loading…
Reference in New Issue
Block a user