@@ -3620,8 +3620,8 @@ struct file *do_file_open_root(const struct path *root,
3620
3620
return file ;
3621
3621
}
3622
3622
3623
- static struct dentry * __filename_create (int dfd , struct filename * name ,
3624
- struct path * path , unsigned int lookup_flags )
3623
+ static struct dentry * filename_create (int dfd , struct filename * name ,
3624
+ struct path * path , unsigned int lookup_flags )
3625
3625
{
3626
3626
struct dentry * dentry = ERR_PTR (- EEXIST );
3627
3627
struct qstr last ;
@@ -3689,21 +3689,15 @@ static struct dentry *__filename_create(int dfd, struct filename *name,
3689
3689
return dentry ;
3690
3690
}
3691
3691
3692
- static inline struct dentry * filename_create (int dfd , struct filename * name ,
3692
+ struct dentry * kern_path_create (int dfd , const char * pathname ,
3693
3693
struct path * path , unsigned int lookup_flags )
3694
3694
{
3695
- struct dentry * res = __filename_create (dfd , name , path , lookup_flags );
3695
+ struct filename * filename = getname_kernel (pathname );
3696
+ struct dentry * res = filename_create (dfd , filename , path , lookup_flags );
3696
3697
3697
- putname (name );
3698
+ putname (filename );
3698
3699
return res ;
3699
3700
}
3700
-
3701
- struct dentry * kern_path_create (int dfd , const char * pathname ,
3702
- struct path * path , unsigned int lookup_flags )
3703
- {
3704
- return filename_create (dfd , getname_kernel (pathname ),
3705
- path , lookup_flags );
3706
- }
3707
3701
EXPORT_SYMBOL (kern_path_create );
3708
3702
3709
3703
void done_path_create (struct path * path , struct dentry * dentry )
@@ -3718,7 +3712,11 @@ EXPORT_SYMBOL(done_path_create);
3718
3712
inline struct dentry * user_path_create (int dfd , const char __user * pathname ,
3719
3713
struct path * path , unsigned int lookup_flags )
3720
3714
{
3721
- return filename_create (dfd , getname (pathname ), path , lookup_flags );
3715
+ struct filename * filename = getname (pathname );
3716
+ struct dentry * res = filename_create (dfd , filename , path , lookup_flags );
3717
+
3718
+ putname (filename );
3719
+ return res ;
3722
3720
}
3723
3721
EXPORT_SYMBOL (user_path_create );
3724
3722
@@ -3799,7 +3797,7 @@ static int do_mknodat(int dfd, struct filename *name, umode_t mode,
3799
3797
if (error )
3800
3798
goto out1 ;
3801
3799
retry :
3802
- dentry = __filename_create (dfd , name , & path , lookup_flags );
3800
+ dentry = filename_create (dfd , name , & path , lookup_flags );
3803
3801
error = PTR_ERR (dentry );
3804
3802
if (IS_ERR (dentry ))
3805
3803
goto out1 ;
@@ -3899,7 +3897,7 @@ int do_mkdirat(int dfd, struct filename *name, umode_t mode)
3899
3897
unsigned int lookup_flags = LOOKUP_DIRECTORY ;
3900
3898
3901
3899
retry :
3902
- dentry = __filename_create (dfd , name , & path , lookup_flags );
3900
+ dentry = filename_create (dfd , name , & path , lookup_flags );
3903
3901
error = PTR_ERR (dentry );
3904
3902
if (IS_ERR (dentry ))
3905
3903
goto out_putname ;
@@ -4268,7 +4266,7 @@ int do_symlinkat(struct filename *from, int newdfd, struct filename *to)
4268
4266
goto out_putnames ;
4269
4267
}
4270
4268
retry :
4271
- dentry = __filename_create (newdfd , to , & path , lookup_flags );
4269
+ dentry = filename_create (newdfd , to , & path , lookup_flags );
4272
4270
error = PTR_ERR (dentry );
4273
4271
if (IS_ERR (dentry ))
4274
4272
goto out_putnames ;
@@ -4432,7 +4430,7 @@ int do_linkat(int olddfd, struct filename *old, int newdfd,
4432
4430
if (error )
4433
4431
goto out_putnames ;
4434
4432
4435
- new_dentry = __filename_create (newdfd , new , & new_path ,
4433
+ new_dentry = filename_create (newdfd , new , & new_path ,
4436
4434
(how & LOOKUP_REVAL ));
4437
4435
error = PTR_ERR (new_dentry );
4438
4436
if (IS_ERR (new_dentry ))
0 commit comments