aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorSteve French <sfrench@us.ibm.com>2006-02-27 22:45:48 -0500
committerSteve French <sfrench@us.ibm.com>2006-02-27 22:45:48 -0500
commitd47d7c1a850b867047fe17140fabd0376894e849 (patch)
tree267b5a68a3182c937a9958ea507712f2d78db7bf /fs
parent4b8f930ff83aaed39fd5f935aeacc25f2549a51e (diff)
[CIFS] CIFS readdir perf optimizations part 1
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/cifssmb.c8
-rw-r--r--fs/cifs/file.c23
-rw-r--r--fs/cifs/readdir.c7
3 files changed, 27 insertions, 11 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index e567f4e6196a..0ddd97b1d87d 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -3026,6 +3026,7 @@ findFirstRetry:
3026 psrch_inf->unicode = FALSE; 3026 psrch_inf->unicode = FALSE;
3027 3027
3028 psrch_inf->ntwrk_buf_start = (char *)pSMBr; 3028 psrch_inf->ntwrk_buf_start = (char *)pSMBr;
3029 psrch_inf->smallBuf = 0;
3029 psrch_inf->srch_entries_start = 3030 psrch_inf->srch_entries_start =
3030 (char *) &pSMBr->hdr.Protocol + 3031 (char *) &pSMBr->hdr.Protocol +
3031 le16_to_cpu(pSMBr->t2.DataOffset); 3032 le16_to_cpu(pSMBr->t2.DataOffset);
@@ -3146,9 +3147,14 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon,
3146 parms = (T2_FNEXT_RSP_PARMS *)response_data; 3147 parms = (T2_FNEXT_RSP_PARMS *)response_data;
3147 response_data = (char *)&pSMBr->hdr.Protocol + 3148 response_data = (char *)&pSMBr->hdr.Protocol +
3148 le16_to_cpu(pSMBr->t2.DataOffset); 3149 le16_to_cpu(pSMBr->t2.DataOffset);
3149 cifs_buf_release(psrch_inf->ntwrk_buf_start); 3150 if(psrch_inf->smallBuf)
3151 cifs_small_buf_release(
3152 psrch_inf->ntwrk_buf_start);
3153 else
3154 cifs_buf_release(psrch_inf->ntwrk_buf_start);
3150 psrch_inf->srch_entries_start = response_data; 3155 psrch_inf->srch_entries_start = response_data;
3151 psrch_inf->ntwrk_buf_start = (char *)pSMB; 3156 psrch_inf->ntwrk_buf_start = (char *)pSMB;
3157 psrch_inf->smallBuf = 0;
3152 if(parms->EndofSearch) 3158 if(parms->EndofSearch)
3153 psrch_inf->endOfSearch = TRUE; 3159 psrch_inf->endOfSearch = TRUE;
3154 else 3160 else
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 675bd2568297..e5bf1ad540d9 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -555,7 +555,10 @@ int cifs_closedir(struct inode *inode, struct file *file)
555 if (ptmp) { 555 if (ptmp) {
556 cFYI(1, ("closedir free smb buf in srch struct")); 556 cFYI(1, ("closedir free smb buf in srch struct"));
557 pCFileStruct->srch_inf.ntwrk_buf_start = NULL; 557 pCFileStruct->srch_inf.ntwrk_buf_start = NULL;
558 cifs_buf_release(ptmp); 558 if(pCFileStruct->srch_inf.smallBuf)
559 cifs_small_buf_release(ptmp);
560 else
561 cifs_buf_release(ptmp);
559 } 562 }
560 ptmp = pCFileStruct->search_resume_name; 563 ptmp = pCFileStruct->search_resume_name;
561 if (ptmp) { 564 if (ptmp) {
@@ -592,11 +595,11 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
592 pfLock->fl_end)); 595 pfLock->fl_end));
593 596
594 if (pfLock->fl_flags & FL_POSIX) 597 if (pfLock->fl_flags & FL_POSIX)
595 cFYI(1, ("Posix ")); 598 cFYI(1, ("Posix"));
596 if (pfLock->fl_flags & FL_FLOCK) 599 if (pfLock->fl_flags & FL_FLOCK)
597 cFYI(1, ("Flock ")); 600 cFYI(1, ("Flock"));
598 if (pfLock->fl_flags & FL_SLEEP) { 601 if (pfLock->fl_flags & FL_SLEEP) {
599 cFYI(1, ("Blocking lock ")); 602 cFYI(1, ("Blocking lock"));
600 wait_flag = TRUE; 603 wait_flag = TRUE;
601 } 604 }
602 if (pfLock->fl_flags & FL_ACCESS) 605 if (pfLock->fl_flags & FL_ACCESS)
@@ -612,21 +615,23 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
612 cFYI(1, ("F_WRLCK ")); 615 cFYI(1, ("F_WRLCK "));
613 numLock = 1; 616 numLock = 1;
614 } else if (pfLock->fl_type == F_UNLCK) { 617 } else if (pfLock->fl_type == F_UNLCK) {
615 cFYI(1, ("F_UNLCK ")); 618 cFYI(1, ("F_UNLCK"));
616 numUnlock = 1; 619 numUnlock = 1;
620 /* Check if unlock includes more than
621 one lock range */
617 } else if (pfLock->fl_type == F_RDLCK) { 622 } else if (pfLock->fl_type == F_RDLCK) {
618 cFYI(1, ("F_RDLCK ")); 623 cFYI(1, ("F_RDLCK"));
619 lockType |= LOCKING_ANDX_SHARED_LOCK; 624 lockType |= LOCKING_ANDX_SHARED_LOCK;
620 numLock = 1; 625 numLock = 1;
621 } else if (pfLock->fl_type == F_EXLCK) { 626 } else if (pfLock->fl_type == F_EXLCK) {
622 cFYI(1, ("F_EXLCK ")); 627 cFYI(1, ("F_EXLCK"));
623 numLock = 1; 628 numLock = 1;
624 } else if (pfLock->fl_type == F_SHLCK) { 629 } else if (pfLock->fl_type == F_SHLCK) {
625 cFYI(1, ("F_SHLCK ")); 630 cFYI(1, ("F_SHLCK"));
626 lockType |= LOCKING_ANDX_SHARED_LOCK; 631 lockType |= LOCKING_ANDX_SHARED_LOCK;
627 numLock = 1; 632 numLock = 1;
628 } else 633 } else
629 cFYI(1, ("Unknown type of lock ")); 634 cFYI(1, ("Unknown type of lock"));
630 635
631 cifs_sb = CIFS_SB(file->f_dentry->d_sb); 636 cifs_sb = CIFS_SB(file->f_dentry->d_sb);
632 pTcon = cifs_sb->tcon; 637 pTcon = cifs_sb->tcon;
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index 288cc048d37f..405d4b7ec3ac 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -604,7 +604,12 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon,
604 cifsFile->search_resume_name = NULL; 604 cifsFile->search_resume_name = NULL;
605 if(cifsFile->srch_inf.ntwrk_buf_start) { 605 if(cifsFile->srch_inf.ntwrk_buf_start) {
606 cFYI(1,("freeing SMB ff cache buf on search rewind")); 606 cFYI(1,("freeing SMB ff cache buf on search rewind"));
607 cifs_buf_release(cifsFile->srch_inf.ntwrk_buf_start); 607 if(cifsFile->srch_inf.smallBuf)
608 cifs_small_buf_release(cifsFile->srch_inf.
609 ntwrk_buf_start);
610 else
611 cifs_buf_release(cifsFile->srch_inf.
612 ntwrk_buf_start);
608 } 613 }
609 rc = initiate_cifs_search(xid,file); 614 rc = initiate_cifs_search(xid,file);
610 if(rc) { 615 if(rc) {