@@ -632,10 +632,11 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
632
632
}
633
633
634
634
/* Fill a cifs_fattr struct with info from POSIX info struct */
635
- static void smb311_posix_info_to_fattr (struct cifs_fattr * fattr , struct cifs_open_info_data * data ,
635
+ static void smb311_posix_info_to_fattr (struct cifs_fattr * fattr ,
636
+ struct cifs_open_info_data * data ,
636
637
struct cifs_sid * owner ,
637
638
struct cifs_sid * group ,
638
- struct super_block * sb , bool adjust_tz , bool symlink )
639
+ struct super_block * sb )
639
640
{
640
641
struct smb311_posix_qinfo * info = & data -> posix_fi ;
641
642
struct cifs_sb_info * cifs_sb = CIFS_SB (sb );
@@ -655,7 +656,7 @@ static void smb311_posix_info_to_fattr(struct cifs_fattr *fattr, struct cifs_ope
655
656
fattr -> cf_ctime = cifs_NTtimeToUnix (info -> ChangeTime );
656
657
fattr -> cf_mtime = cifs_NTtimeToUnix (info -> LastWriteTime );
657
658
658
- if (adjust_tz ) {
659
+ if (data -> adjust_tz ) {
659
660
fattr -> cf_ctime .tv_sec += tcon -> ses -> server -> timeAdj ;
660
661
fattr -> cf_mtime .tv_sec += tcon -> ses -> server -> timeAdj ;
661
662
}
@@ -669,7 +670,7 @@ static void smb311_posix_info_to_fattr(struct cifs_fattr *fattr, struct cifs_ope
669
670
/* The srv fs device id is overridden on network mount so setting rdev isn't needed here */
670
671
/* fattr->cf_rdev = le32_to_cpu(info->DeviceId); */
671
672
672
- if (symlink ) {
673
+ if (data -> symlink ) {
673
674
fattr -> cf_mode |= S_IFLNK ;
674
675
fattr -> cf_dtype = DT_LNK ;
675
676
fattr -> cf_symlink_target = data -> symlink_target ;
@@ -690,13 +691,14 @@ static void smb311_posix_info_to_fattr(struct cifs_fattr *fattr, struct cifs_ope
690
691
fattr -> cf_mode , fattr -> cf_uniqueid , fattr -> cf_nlink );
691
692
}
692
693
693
- static void cifs_open_info_to_fattr (struct cifs_fattr * fattr , struct cifs_open_info_data * data ,
694
- struct super_block * sb , bool adjust_tz , bool symlink ,
695
- u32 reparse_tag )
694
+ static void cifs_open_info_to_fattr (struct cifs_fattr * fattr ,
695
+ struct cifs_open_info_data * data ,
696
+ struct super_block * sb )
696
697
{
697
698
struct smb2_file_all_info * info = & data -> fi ;
698
699
struct cifs_sb_info * cifs_sb = CIFS_SB (sb );
699
700
struct cifs_tcon * tcon = cifs_sb_master_tcon (cifs_sb );
701
+ u32 reparse_tag = data -> reparse_tag ;
700
702
701
703
memset (fattr , 0 , sizeof (* fattr ));
702
704
fattr -> cf_cifsattrs = le32_to_cpu (info -> Attributes );
@@ -711,7 +713,7 @@ static void cifs_open_info_to_fattr(struct cifs_fattr *fattr, struct cifs_open_i
711
713
fattr -> cf_ctime = cifs_NTtimeToUnix (info -> ChangeTime );
712
714
fattr -> cf_mtime = cifs_NTtimeToUnix (info -> LastWriteTime );
713
715
714
- if (adjust_tz ) {
716
+ if (data -> adjust_tz ) {
715
717
fattr -> cf_ctime .tv_sec += tcon -> ses -> server -> timeAdj ;
716
718
fattr -> cf_mtime .tv_sec += tcon -> ses -> server -> timeAdj ;
717
719
}
@@ -736,7 +738,7 @@ static void cifs_open_info_to_fattr(struct cifs_fattr *fattr, struct cifs_open_i
736
738
} else if (reparse_tag == IO_REPARSE_TAG_LX_BLK ) {
737
739
fattr -> cf_mode |= S_IFBLK | cifs_sb -> ctx -> file_mode ;
738
740
fattr -> cf_dtype = DT_BLK ;
739
- } else if (symlink || reparse_tag == IO_REPARSE_TAG_SYMLINK ||
741
+ } else if (data -> symlink || reparse_tag == IO_REPARSE_TAG_SYMLINK ||
740
742
reparse_tag == IO_REPARSE_TAG_NFS ) {
741
743
fattr -> cf_mode = S_IFLNK ;
742
744
fattr -> cf_dtype = DT_LNK ;
@@ -789,8 +791,6 @@ cifs_get_file_info(struct file *filp)
789
791
struct cifsFileInfo * cfile = filp -> private_data ;
790
792
struct cifs_tcon * tcon = tlink_tcon (cfile -> tlink );
791
793
struct TCP_Server_Info * server = tcon -> ses -> server ;
792
- bool symlink = false;
793
- u32 tag = 0 ;
794
794
795
795
if (!server -> ops -> query_file_info )
796
796
return - ENOSYS ;
@@ -800,11 +800,12 @@ cifs_get_file_info(struct file *filp)
800
800
switch (rc ) {
801
801
case 0 :
802
802
/* TODO: add support to query reparse tag */
803
+ data .adjust_tz = false;
803
804
if (data .symlink_target ) {
804
- symlink = true;
805
- tag = IO_REPARSE_TAG_SYMLINK ;
805
+ data . symlink = true;
806
+ data . reparse_tag = IO_REPARSE_TAG_SYMLINK ;
806
807
}
807
- cifs_open_info_to_fattr (& fattr , & data , inode -> i_sb , false, symlink , tag );
808
+ cifs_open_info_to_fattr (& fattr , & data , inode -> i_sb );
808
809
break ;
809
810
case - EREMOTE :
810
811
cifs_create_dfs_fattr (& fattr , inode -> i_sb );
@@ -968,14 +969,11 @@ int cifs_get_inode_info(struct inode **inode, const char *full_path,
968
969
struct TCP_Server_Info * server ;
969
970
struct tcon_link * tlink ;
970
971
struct cifs_sb_info * cifs_sb = CIFS_SB (sb );
971
- bool adjust_tz = false;
972
972
struct cifs_fattr fattr = {0 };
973
- bool is_reparse_point = false;
974
973
struct cifs_open_info_data tmp_data = {};
975
974
void * smb1_backup_rsp_buf = NULL ;
976
975
int rc = 0 ;
977
976
int tmprc = 0 ;
978
- __u32 reparse_tag = 0 ;
979
977
980
978
tlink = cifs_sb_tlink (cifs_sb );
981
979
if (IS_ERR (tlink ))
@@ -992,8 +990,8 @@ int cifs_get_inode_info(struct inode **inode, const char *full_path,
992
990
cifs_dbg (FYI , "No need to revalidate cached inode sizes\n" );
993
991
goto out ;
994
992
}
995
- rc = server -> ops -> query_path_info (xid , tcon , cifs_sb , full_path , & tmp_data ,
996
- & adjust_tz , & is_reparse_point );
993
+ rc = server -> ops -> query_path_info (xid , tcon , cifs_sb ,
994
+ full_path , & tmp_data );
997
995
data = & tmp_data ;
998
996
}
999
997
@@ -1008,24 +1006,23 @@ int cifs_get_inode_info(struct inode **inode, const char *full_path,
1008
1006
* since we have to check if its reparse tag matches a known
1009
1007
* special file type e.g. symlink or fifo or char etc.
1010
1008
*/
1011
- if (is_reparse_point && data -> symlink_target ) {
1012
- reparse_tag = IO_REPARSE_TAG_SYMLINK ;
1009
+ if (data -> reparse_point && data -> symlink_target ) {
1010
+ data -> reparse_tag = IO_REPARSE_TAG_SYMLINK ;
1013
1011
} else if ((le32_to_cpu (data -> fi .Attributes ) & ATTR_REPARSE ) &&
1014
1012
server -> ops -> query_reparse_tag ) {
1015
1013
tmprc = server -> ops -> query_reparse_tag (xid , tcon , cifs_sb , full_path ,
1016
- & reparse_tag );
1017
- if (tmprc )
1018
- cifs_dbg (FYI , "%s: query_reparse_tag: rc = %d\n" , __func__ , tmprc );
1014
+ & data -> reparse_tag );
1015
+ cifs_dbg (FYI , "%s: query_reparse_tag: rc = %d\n" , __func__ , tmprc );
1019
1016
if (server -> ops -> query_symlink ) {
1020
- tmprc = server -> ops -> query_symlink (xid , tcon , cifs_sb , full_path ,
1017
+ tmprc = server -> ops -> query_symlink (xid , tcon , cifs_sb ,
1018
+ full_path ,
1021
1019
& data -> symlink_target ,
1022
- is_reparse_point );
1023
- if (tmprc )
1024
- cifs_dbg (FYI , "%s: query_symlink: rc = %d\n" , __func__ ,
1025
- tmprc );
1020
+ data -> reparse_point );
1021
+ cifs_dbg (FYI , "%s: query_symlink: rc = %d\n" ,
1022
+ __func__ , tmprc );
1026
1023
}
1027
1024
}
1028
- cifs_open_info_to_fattr (& fattr , data , sb , adjust_tz , is_reparse_point , reparse_tag );
1025
+ cifs_open_info_to_fattr (& fattr , data , sb );
1029
1026
break ;
1030
1027
case - EREMOTE :
1031
1028
/* DFS link, no metadata available on this server */
@@ -1168,9 +1165,7 @@ smb311_posix_get_inode_info(struct inode **inode,
1168
1165
struct cifs_tcon * tcon ;
1169
1166
struct tcon_link * tlink ;
1170
1167
struct cifs_sb_info * cifs_sb = CIFS_SB (sb );
1171
- bool adjust_tz = false;
1172
1168
struct cifs_fattr fattr = {0 };
1173
- bool symlink = false;
1174
1169
struct cifs_open_info_data data = {};
1175
1170
struct cifs_sid owner , group ;
1176
1171
int rc = 0 ;
@@ -1190,18 +1185,17 @@ smb311_posix_get_inode_info(struct inode **inode,
1190
1185
goto out ;
1191
1186
}
1192
1187
1193
- rc = smb311_posix_query_path_info (xid , tcon , cifs_sb , full_path , & data ,
1194
- & owner , & group , & adjust_tz ,
1195
- & symlink );
1188
+ rc = smb311_posix_query_path_info (xid , tcon , cifs_sb ,
1189
+ full_path , & data ,
1190
+ & owner , & group );
1196
1191
1197
1192
/*
1198
1193
* 2. Convert it to internal cifs metadata (fattr)
1199
1194
*/
1200
1195
1201
1196
switch (rc ) {
1202
1197
case 0 :
1203
- smb311_posix_info_to_fattr (& fattr , & data , & owner , & group ,
1204
- sb , adjust_tz , symlink );
1198
+ smb311_posix_info_to_fattr (& fattr , & data , & owner , & group , sb );
1205
1199
break ;
1206
1200
case - EREMOTE :
1207
1201
/* DFS link, no metadata available on this server */
0 commit comments