@@ -614,9 +614,9 @@ static void free_ext_value(struct fuse_args *args)
614
614
* If the filesystem doesn't support this, then fall back to separate
615
615
* 'mknod' + 'open' requests.
616
616
*/
617
- static int fuse_create_open (struct inode * dir , struct dentry * entry ,
618
- struct file * file , unsigned int flags ,
619
- umode_t mode , u32 opcode )
617
+ static int fuse_create_open (struct mnt_idmap * idmap , struct inode * dir ,
618
+ struct dentry * entry , struct file * file ,
619
+ unsigned int flags , umode_t mode , u32 opcode )
620
620
{
621
621
int err ;
622
622
struct inode * inode ;
@@ -673,11 +673,11 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry,
673
673
args .out_args [1 ].size = sizeof (* outopenp );
674
674
args .out_args [1 ].value = outopenp ;
675
675
676
- err = get_create_ext (& nop_mnt_idmap , & args , dir , entry , mode );
676
+ err = get_create_ext (idmap , & args , dir , entry , mode );
677
677
if (err )
678
678
goto out_free_ff ;
679
679
680
- err = fuse_simple_request (NULL , fm , & args );
680
+ err = fuse_simple_request (idmap , fm , & args );
681
681
free_ext_value (& args );
682
682
if (err )
683
683
goto out_free_ff ;
@@ -734,6 +734,7 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry,
734
734
umode_t mode )
735
735
{
736
736
int err ;
737
+ struct mnt_idmap * idmap = file_mnt_idmap (file );
737
738
struct fuse_conn * fc = get_fuse_conn (dir );
738
739
struct dentry * res = NULL ;
739
740
@@ -758,7 +759,7 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry,
758
759
if (fc -> no_create )
759
760
goto mknod ;
760
761
761
- err = fuse_create_open (dir , entry , file , flags , mode , FUSE_CREATE );
762
+ err = fuse_create_open (idmap , dir , entry , file , flags , mode , FUSE_CREATE );
762
763
if (err == - ENOSYS ) {
763
764
fc -> no_create = 1 ;
764
765
goto mknod ;
@@ -769,7 +770,7 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry,
769
770
return err ;
770
771
771
772
mknod :
772
- err = fuse_mknod (& nop_mnt_idmap , dir , entry , mode , 0 );
773
+ err = fuse_mknod (idmap , dir , entry , mode , 0 );
773
774
if (err )
774
775
goto out_dput ;
775
776
no_open :
@@ -779,9 +780,9 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry,
779
780
/*
780
781
* Code shared between mknod, mkdir, symlink and link
781
782
*/
782
- static int create_new_entry (struct fuse_mount * fm , struct fuse_args * args ,
783
- struct inode * dir , struct dentry * entry ,
784
- umode_t mode )
783
+ static int create_new_entry (struct mnt_idmap * idmap , struct fuse_mount * fm ,
784
+ struct fuse_args * args , struct inode * dir ,
785
+ struct dentry * entry , umode_t mode )
785
786
{
786
787
struct fuse_entry_out outarg ;
787
788
struct inode * inode ;
@@ -803,12 +804,12 @@ static int create_new_entry(struct fuse_mount *fm, struct fuse_args *args,
803
804
args -> out_args [0 ].value = & outarg ;
804
805
805
806
if (args -> opcode != FUSE_LINK ) {
806
- err = get_create_ext (& nop_mnt_idmap , args , dir , entry , mode );
807
+ err = get_create_ext (idmap , args , dir , entry , mode );
807
808
if (err )
808
809
goto out_put_forget_req ;
809
810
}
810
811
811
- err = fuse_simple_request (NULL , fm , args );
812
+ err = fuse_simple_request (idmap , fm , args );
812
813
free_ext_value (args );
813
814
if (err )
814
815
goto out_put_forget_req ;
@@ -869,13 +870,13 @@ static int fuse_mknod(struct mnt_idmap *idmap, struct inode *dir,
869
870
args .in_args [0 ].value = & inarg ;
870
871
args .in_args [1 ].size = entry -> d_name .len + 1 ;
871
872
args .in_args [1 ].value = entry -> d_name .name ;
872
- return create_new_entry (fm , & args , dir , entry , mode );
873
+ return create_new_entry (idmap , fm , & args , dir , entry , mode );
873
874
}
874
875
875
876
static int fuse_create (struct mnt_idmap * idmap , struct inode * dir ,
876
877
struct dentry * entry , umode_t mode , bool excl )
877
878
{
878
- return fuse_mknod (& nop_mnt_idmap , dir , entry , mode , 0 );
879
+ return fuse_mknod (idmap , dir , entry , mode , 0 );
879
880
}
880
881
881
882
static int fuse_tmpfile (struct mnt_idmap * idmap , struct inode * dir ,
@@ -887,7 +888,8 @@ static int fuse_tmpfile(struct mnt_idmap *idmap, struct inode *dir,
887
888
if (fc -> no_tmpfile )
888
889
return - EOPNOTSUPP ;
889
890
890
- err = fuse_create_open (dir , file -> f_path .dentry , file , file -> f_flags , mode , FUSE_TMPFILE );
891
+ err = fuse_create_open (idmap , dir , file -> f_path .dentry , file ,
892
+ file -> f_flags , mode , FUSE_TMPFILE );
891
893
if (err == - ENOSYS ) {
892
894
fc -> no_tmpfile = 1 ;
893
895
err = - EOPNOTSUPP ;
@@ -914,7 +916,7 @@ static int fuse_mkdir(struct mnt_idmap *idmap, struct inode *dir,
914
916
args .in_args [0 ].value = & inarg ;
915
917
args .in_args [1 ].size = entry -> d_name .len + 1 ;
916
918
args .in_args [1 ].value = entry -> d_name .name ;
917
- return create_new_entry (fm , & args , dir , entry , S_IFDIR );
919
+ return create_new_entry (idmap , fm , & args , dir , entry , S_IFDIR );
918
920
}
919
921
920
922
static int fuse_symlink (struct mnt_idmap * idmap , struct inode * dir ,
@@ -930,7 +932,7 @@ static int fuse_symlink(struct mnt_idmap *idmap, struct inode *dir,
930
932
args .in_args [0 ].value = entry -> d_name .name ;
931
933
args .in_args [1 ].size = len ;
932
934
args .in_args [1 ].value = link ;
933
- return create_new_entry (fm , & args , dir , entry , S_IFLNK );
935
+ return create_new_entry (idmap , fm , & args , dir , entry , S_IFLNK );
934
936
}
935
937
936
938
void fuse_flush_time_update (struct inode * inode )
@@ -1124,7 +1126,7 @@ static int fuse_link(struct dentry *entry, struct inode *newdir,
1124
1126
args .in_args [0 ].value = & inarg ;
1125
1127
args .in_args [1 ].size = newent -> d_name .len + 1 ;
1126
1128
args .in_args [1 ].value = newent -> d_name .name ;
1127
- err = create_new_entry (fm , & args , newdir , newent , inode -> i_mode );
1129
+ err = create_new_entry (NULL , fm , & args , newdir , newent , inode -> i_mode );
1128
1130
if (!err )
1129
1131
fuse_update_ctime_in_cache (inode );
1130
1132
else if (err == - EINTR )
0 commit comments