Skip to content

Commit b62a206

Browse files
palismfrench
authored andcommitted
cifs: Optimize CIFSFindFirst() response when not searching
When not searching for child entries with msearch wildcard pattern then ask server just for one output entry. There is no need to ask for more entries as we are interested only for one search result, as we are doing query on path. CIFSFindFirst() with msearch=false is called by the cifs_query_path_info() function. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent b460249 commit b62a206

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/smb/client/cifssmb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4067,7 +4067,7 @@ CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
40674067
pSMB->SearchAttributes =
40684068
cpu_to_le16(ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM |
40694069
ATTR_DIRECTORY);
4070-
pSMB->SearchCount = cpu_to_le16(CIFSMaxBufSize/sizeof(FILE_UNIX_INFO));
4070+
pSMB->SearchCount = cpu_to_le16(msearch ? CIFSMaxBufSize/sizeof(FILE_UNIX_INFO) : 1);
40714071
pSMB->SearchFlags = cpu_to_le16(search_flags);
40724072
pSMB->InformationLevel = cpu_to_le16(psrch_inf->info_level);
40734073

0 commit comments

Comments
 (0)