diff options
author | Steve French <stfrench@microsoft.com> | 2019-07-19 00:22:18 +0200 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-07-19 00:44:13 +0200 |
commit | 89a5bfa350faf87156acda4d7c457808bfecaa0e (patch) | |
tree | 9560165181bb65a6966bd21681ea9b777517447c /fs/cifs/smb2file.c | |
parent | cifs: copy_file_range needs to strip setuid bits and update timestamps (diff) | |
download | linux-89a5bfa350faf87156acda4d7c457808bfecaa0e.tar.xz linux-89a5bfa350faf87156acda4d7c457808bfecaa0e.zip |
smb3: optimize open to not send query file internal info
We can cut one third of the traffic on open by not querying the
inode number explicitly via SMB3 query_info since it is now
returned on open in the qfid context.
This is better in multiple ways, and
speeds up file open about 10% (more if network is slow).
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/smb2file.c')
-rw-r--r-- | fs/cifs/smb2file.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c index 54bffb2a1786..e6a1fc72018f 100644 --- a/fs/cifs/smb2file.c +++ b/fs/cifs/smb2file.c @@ -88,14 +88,20 @@ smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, } if (buf) { - /* open response does not have IndexNumber field - get it */ - rc = SMB2_get_srv_num(xid, oparms->tcon, fid->persistent_fid, + /* if open response does not have IndexNumber field - get it */ + if (smb2_data->IndexNumber == 0) { + rc = SMB2_get_srv_num(xid, oparms->tcon, + fid->persistent_fid, fid->volatile_fid, &smb2_data->IndexNumber); - if (rc) { - /* let get_inode_info disable server inode numbers */ - smb2_data->IndexNumber = 0; - rc = 0; + if (rc) { + /* + * let get_inode_info disable server inode + * numbers + */ + smb2_data->IndexNumber = 0; + rc = 0; + } } move_smb2_info_to_cifs(buf, smb2_data); } |