diff options
-rw-r--r-- | fs/cifs/cifsglob.h | 3 | ||||
-rw-r--r-- | fs/cifs/cifssmb.c | 13 | ||||
-rw-r--r-- | fs/cifs/readdir.c | 16 |
3 files changed, 25 insertions, 7 deletions
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 81babab265e1..4ed9c13fff55 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h | |||
@@ -219,6 +219,9 @@ struct cifsTconInfo { | |||
219 | atomic_t num_rmdirs; | 219 | atomic_t num_rmdirs; |
220 | atomic_t num_renames; | 220 | atomic_t num_renames; |
221 | atomic_t num_t2renames; | 221 | atomic_t num_t2renames; |
222 | atomic_t num_ffirst; | ||
223 | atomic_t num_fnext; | ||
224 | atomic_t num_fclose; | ||
222 | __u64 bytes_read; | 225 | __u64 bytes_read; |
223 | __u64 bytes_written; | 226 | __u64 bytes_written; |
224 | spinlock_t stat_lock; | 227 | spinlock_t stat_lock; |
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 3c628bf667a5..b31158a2643d 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c | |||
@@ -2396,7 +2396,9 @@ findUniqueRetry: | |||
2396 | if (rc) { | 2396 | if (rc) { |
2397 | cFYI(1, ("Send error in FindFileDirInfo = %d", rc)); | 2397 | cFYI(1, ("Send error in FindFileDirInfo = %d", rc)); |
2398 | } else { /* decode response */ | 2398 | } else { /* decode response */ |
2399 | 2399 | #ifdef CONFIG_CIFS_STATS | |
2400 | atomic_inc(&tcon->num_ffirst); | ||
2401 | #endif | ||
2400 | /* BB fill in */ | 2402 | /* BB fill in */ |
2401 | } | 2403 | } |
2402 | 2404 | ||
@@ -2509,6 +2511,9 @@ findFirstRetry: | |||
2509 | if (rc == -EAGAIN) | 2511 | if (rc == -EAGAIN) |
2510 | goto findFirstRetry; | 2512 | goto findFirstRetry; |
2511 | } else { /* decode response */ | 2513 | } else { /* decode response */ |
2514 | #ifdef CONFIG_CIFS_STATS | ||
2515 | atomic_inc(&tcon->num_ffirst); | ||
2516 | #endif | ||
2512 | /* BB remember to free buffer if error BB */ | 2517 | /* BB remember to free buffer if error BB */ |
2513 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 2518 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
2514 | if(rc == 0) { | 2519 | if(rc == 0) { |
@@ -2622,6 +2627,9 @@ int CIFSFindNext(const int xid, struct cifsTconInfo *tcon, | |||
2622 | } else | 2627 | } else |
2623 | cFYI(1, ("FindNext returned = %d", rc)); | 2628 | cFYI(1, ("FindNext returned = %d", rc)); |
2624 | } else { /* decode response */ | 2629 | } else { /* decode response */ |
2630 | #ifdef CONFIG_CIFS_STATS | ||
2631 | atomic_inc(&tcon->num_fnext); | ||
2632 | #endif | ||
2625 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); | 2633 | rc = validate_t2((struct smb_t2_rsp *)pSMBr); |
2626 | 2634 | ||
2627 | if(rc == 0) { | 2635 | if(rc == 0) { |
@@ -2691,6 +2699,9 @@ CIFSFindClose(const int xid, struct cifsTconInfo *tcon, const __u16 searchHandle | |||
2691 | if (rc) { | 2699 | if (rc) { |
2692 | cERROR(1, ("Send error in FindClose = %d", rc)); | 2700 | cERROR(1, ("Send error in FindClose = %d", rc)); |
2693 | } | 2701 | } |
2702 | #ifdef CONFIG_CIFS_STATS | ||
2703 | atomic_inc(&tcon->num_fclose); | ||
2704 | #endif | ||
2694 | cifs_small_buf_release(pSMB); | 2705 | cifs_small_buf_release(pSMB); |
2695 | 2706 | ||
2696 | /* Since session is dead, search handle closed on server already */ | 2707 | /* Since session is dead, search handle closed on server already */ |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 22557716f9af..487221eeddb7 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -190,8 +190,9 @@ static void fill_in_inode(struct inode *tmp_inode, | |||
190 | tmp_inode->i_data.a_ops = &cifs_addr_ops; | 190 | tmp_inode->i_data.a_ops = &cifs_addr_ops; |
191 | 191 | ||
192 | if(isNewInode) | 192 | if(isNewInode) |
193 | return; /* No sense invalidating pages for new inode since we | 193 | return; /* No sense invalidating pages for new inode |
194 | have not started caching readahead file data yet */ | 194 | since have not started caching readahead file |
195 | data yet */ | ||
195 | 196 | ||
196 | if (timespec_equal(&tmp_inode->i_mtime, &local_mtime) && | 197 | if (timespec_equal(&tmp_inode->i_mtime, &local_mtime) && |
197 | (local_size == tmp_inode->i_size)) { | 198 | (local_size == tmp_inode->i_size)) { |
@@ -536,7 +537,8 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon, | |||
536 | while((index_to_find >= cifsFile->srch_inf.index_of_last_entry) && | 537 | while((index_to_find >= cifsFile->srch_inf.index_of_last_entry) && |
537 | (rc == 0) && (cifsFile->srch_inf.endOfSearch == FALSE)){ | 538 | (rc == 0) && (cifsFile->srch_inf.endOfSearch == FALSE)){ |
538 | cFYI(1,("calling findnext2")); | 539 | cFYI(1,("calling findnext2")); |
539 | rc = CIFSFindNext(xid,pTcon,cifsFile->netfid, &cifsFile->srch_inf); | 540 | rc = CIFSFindNext(xid,pTcon,cifsFile->netfid, |
541 | &cifsFile->srch_inf); | ||
540 | if(rc) | 542 | if(rc) |
541 | return -ENOENT; | 543 | return -ENOENT; |
542 | } | 544 | } |
@@ -555,7 +557,7 @@ static int find_cifs_entry(const int xid, struct cifsTconInfo *pTcon, | |||
555 | cFYI(1,("found entry - pos_in_buf %d",pos_in_buf)); | 557 | cFYI(1,("found entry - pos_in_buf %d",pos_in_buf)); |
556 | current_entry = cifsFile->srch_inf.srch_entries_start; | 558 | current_entry = cifsFile->srch_inf.srch_entries_start; |
557 | for(i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) { | 559 | for(i=0;(i<(pos_in_buf)) && (current_entry != NULL);i++) { |
558 | /* go entry to next entry figuring out which we need to start with */ | 560 | /* go entry by entry figuring out which is first */ |
559 | /* if( . or ..) | 561 | /* if( . or ..) |
560 | skip */ | 562 | skip */ |
561 | rc = cifs_entry_is_dot(current_entry,cifsFile); | 563 | rc = cifs_entry_is_dot(current_entry,cifsFile); |
@@ -721,7 +723,8 @@ static int cifs_filldir(char *pfindEntry, struct file *file, | |||
721 | (FILE_DIRECTORY_INFO *)pfindEntry,&obj_type, rc); | 723 | (FILE_DIRECTORY_INFO *)pfindEntry,&obj_type, rc); |
722 | } | 724 | } |
723 | 725 | ||
724 | rc = filldir(direntry,qstring.name,qstring.len,file->f_pos,tmp_inode->i_ino,obj_type); | 726 | rc = filldir(direntry,qstring.name,qstring.len,file->f_pos, |
727 | tmp_inode->i_ino,obj_type); | ||
725 | if(rc) { | 728 | if(rc) { |
726 | cFYI(1,("filldir rc = %d",rc)); | 729 | cFYI(1,("filldir rc = %d",rc)); |
727 | } | 730 | } |
@@ -906,7 +909,8 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) | |||
906 | cifs_save_resume_key(current_entry,cifsFile); | 909 | cifs_save_resume_key(current_entry,cifsFile); |
907 | break; | 910 | break; |
908 | } else | 911 | } else |
909 | current_entry = nxt_dir_entry(current_entry,end_of_smb); | 912 | current_entry = nxt_dir_entry(current_entry, |
913 | end_of_smb); | ||
910 | } | 914 | } |
911 | kfree(tmp_buf); | 915 | kfree(tmp_buf); |
912 | break; | 916 | break; |