[CIFS] CIFS readdir perf optimizations part 1
Signed-off-by: Steve French <sfrench@us.ibm.com>
This commit is contained in:
parent
4b8f930ff8
commit
d47d7c1a85
|
@ -3026,6 +3026,7 @@ findFirstRetry:
|
||||||
psrch_inf->unicode = FALSE;
|
psrch_inf->unicode = FALSE;
|
||||||
|
|
||||||
psrch_inf->ntwrk_buf_start = (char *)pSMBr;
|
psrch_inf->ntwrk_buf_start = (char *)pSMBr;
|
||||||
|
psrch_inf->smallBuf = 0;
|
||||||
psrch_inf->srch_entries_start =
|
psrch_inf->srch_entries_start =
|
||||||
(char *) &pSMBr->hdr.Protocol +
|
(char *) &pSMBr->hdr.Protocol +
|
||||||
le16_to_cpu(pSMBr->t2.DataOffset);
|
le16_to_cpu(pSMBr->t2.DataOffset);
|
||||||
|
@ -3146,9 +3147,14 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
|
||||||
parms = (T2_FNEXT_RSP_PARMS *)response_data;
|
parms = (T2_FNEXT_RSP_PARMS *)response_data;
|
||||||
response_data = (char *)&pSMBr->hdr.Protocol +
|
response_data = (char *)&pSMBr->hdr.Protocol +
|
||||||
le16_to_cpu(pSMBr->t2.DataOffset);
|
le16_to_cpu(pSMBr->t2.DataOffset);
|
||||||
|
if(psrch_inf->smallBuf)
|
||||||
|
cifs_small_buf_release(
|
||||||
|
psrch_inf->ntwrk_buf_start);
|
||||||
|
else
|
||||||
cifs_buf_release(psrch_inf->ntwrk_buf_start);
|
cifs_buf_release(psrch_inf->ntwrk_buf_start);
|
||||||
psrch_inf->srch_entries_start = response_data;
|
psrch_inf->srch_entries_start = response_data;
|
||||||
psrch_inf->ntwrk_buf_start = (char *)pSMB;
|
psrch_inf->ntwrk_buf_start = (char *)pSMB;
|
||||||
|
psrch_inf->smallBuf = 0;
|
||||||
if(parms->EndofSearch)
|
if(parms->EndofSearch)
|
||||||
psrch_inf->endOfSearch = TRUE;
|
psrch_inf->endOfSearch = TRUE;
|
||||||
else
|
else
|
||||||
|
|
|
@ -555,6 +555,9 @@ int cifs_closedir(struct inode *inode, struct file *file)
|
||||||
if (ptmp) {
|
if (ptmp) {
|
||||||
cFYI(1, ("closedir free smb buf in srch struct"));
|
cFYI(1, ("closedir free smb buf in srch struct"));
|
||||||
pCFileStruct->srch_inf.ntwrk_buf_start = NULL;
|
pCFileStruct->srch_inf.ntwrk_buf_start = NULL;
|
||||||
|
if(pCFileStruct->srch_inf.smallBuf)
|
||||||
|
cifs_small_buf_release(ptmp);
|
||||||
|
else
|
||||||
cifs_buf_release(ptmp);
|
cifs_buf_release(ptmp);
|
||||||
}
|
}
|
||||||
ptmp = pCFileStruct->search_resume_name;
|
ptmp = pCFileStruct->search_resume_name;
|
||||||
|
@ -614,6 +617,8 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
|
||||||
} else if (pfLock->fl_type == F_UNLCK) {
|
} else if (pfLock->fl_type == F_UNLCK) {
|
||||||
cFYI(1, ("F_UNLCK"));
|
cFYI(1, ("F_UNLCK"));
|
||||||
numUnlock = 1;
|
numUnlock = 1;
|
||||||
|
/* Check if unlock includes more than
|
||||||
|
one lock range */
|
||||||
} else if (pfLock->fl_type == F_RDLCK) {
|
} else if (pfLock->fl_type == F_RDLCK) {
|
||||||
cFYI(1, ("F_RDLCK"));
|
cFYI(1, ("F_RDLCK"));
|
||||||
lockType |= LOCKING_ANDX_SHARED_LOCK;
|
lockType |= LOCKING_ANDX_SHARED_LOCK;
|
||||||
|
|
|
@ -604,7 +604,12 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
|
||||||
cifsFile->search_resume_name = NULL;
|
cifsFile->search_resume_name = NULL;
|
||||||
if(cifsFile->srch_inf.ntwrk_buf_start) {
|
if(cifsFile->srch_inf.ntwrk_buf_start) {
|
||||||
cFYI(1,("freeing SMB ff cache buf on search rewind"));
|
cFYI(1,("freeing SMB ff cache buf on search rewind"));
|
||||||
cifs_buf_release(cifsFile->srch_inf.ntwrk_buf_start);
|
if(cifsFile->srch_inf.smallBuf)
|
||||||
|
cifs_small_buf_release(cifsFile->srch_inf.
|
||||||
|
ntwrk_buf_start);
|
||||||
|
else
|
||||||
|
cifs_buf_release(cifsFile->srch_inf.
|
||||||
|
ntwrk_buf_start);
|
||||||
}
|
}
|
||||||
rc = initiate_cifs_search(xid,file);
|
rc = initiate_cifs_search(xid,file);
|
||||||
if(rc) {
|
if(rc) {
|
||||||
|
|
Loading…
Reference in a new issue