Loading fs/cifs/cifs_debug.c +4 −0 Original line number Original line Diff line number Diff line Loading @@ -219,6 +219,10 @@ cifs_stats_write(struct file *file, const char __user *buffer, if (c == '1' || c == 'y' || c == 'Y' || c == '0') { if (c == '1' || c == 'y' || c == 'Y' || c == '0') { read_lock(&GlobalSMBSeslock); read_lock(&GlobalSMBSeslock); #ifdef CONFIG_CIFS_STATS2 atomic_set(&totBufAllocCount, 0); atomic_set(&totSmBufAllocCount, 0); #endif /* CONFIG_CIFS_STATS2 */ list_for_each(tmp, &GlobalTreeConnectionList) { list_for_each(tmp, &GlobalTreeConnectionList) { tcon = list_entry(tmp, struct cifsTconInfo, tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); cifsConnectionList); Loading fs/cifs/cifsfs.c +6 −0 Original line number Original line Diff line number Diff line Loading @@ -954,6 +954,12 @@ init_cifs(void) atomic_set(&tconInfoReconnectCount, 0); atomic_set(&tconInfoReconnectCount, 0); atomic_set(&bufAllocCount, 0); atomic_set(&bufAllocCount, 0); atomic_set(&smBufAllocCount, 0); #ifdef CONFIG_CIFS_STATS2 atomic_set(&totBufAllocCount, 0); atomic_set(&totSmBufAllocCount, 0); #endif /* CONFIG_CIFS_STATS2 */ atomic_set(&midCount, 0); atomic_set(&midCount, 0); GlobalCurrentXid = 0; GlobalCurrentXid = 0; GlobalTotalActiveXid = 0; GlobalTotalActiveXid = 0; Loading fs/cifs/cifsglob.h +6 −2 Original line number Original line Diff line number Diff line Loading @@ -505,7 +505,11 @@ GLOBAL_EXTERN atomic_t tcpSesReconnectCount; GLOBAL_EXTERN atomic_t tconInfoReconnectCount; GLOBAL_EXTERN atomic_t tconInfoReconnectCount; /* Various Debug counters to remove someday (BB) */ /* Various Debug counters to remove someday (BB) */ GLOBAL_EXTERN atomic_t bufAllocCount; GLOBAL_EXTERN atomic_t bufAllocCount; /* current number allocated */ #ifdef CONFIG_CIFS_STATS2 GLOBAL_EXTERN atomic_t totBufAllocCount; /* total allocated over all time */ GLOBAL_EXTERN atomic_t totSmBufAllocCount; #endif GLOBAL_EXTERN atomic_t smBufAllocCount; GLOBAL_EXTERN atomic_t smBufAllocCount; GLOBAL_EXTERN atomic_t midCount; GLOBAL_EXTERN atomic_t midCount; Loading fs/cifs/misc.c +7 −0 Original line number Original line Diff line number Diff line Loading @@ -161,6 +161,9 @@ cifs_buf_get(void) if (ret_buf) { if (ret_buf) { memset(ret_buf, 0, sizeof(struct smb_hdr) + 3); memset(ret_buf, 0, sizeof(struct smb_hdr) + 3); atomic_inc(&bufAllocCount); atomic_inc(&bufAllocCount); #ifdef CONFIG_CIFS_STATS2 atomic_inc(&totBufAllocCount); #endif /* CONFIG_CIFS_STATS2 */ } } return ret_buf; return ret_buf; Loading Loading @@ -195,6 +198,10 @@ cifs_small_buf_get(void) /* No need to clear memory here, cleared in header assemble */ /* No need to clear memory here, cleared in header assemble */ /* memset(ret_buf, 0, sizeof(struct smb_hdr) + 27);*/ /* memset(ret_buf, 0, sizeof(struct smb_hdr) + 27);*/ atomic_inc(&smBufAllocCount); atomic_inc(&smBufAllocCount); #ifdef CONFIG_CIFS_STATS2 atomic_inc(&totSmBufAllocCount); #endif /* CONFIG_CIFS_STATS2 */ } } return ret_buf; return ret_buf; } } Loading Loading
fs/cifs/cifs_debug.c +4 −0 Original line number Original line Diff line number Diff line Loading @@ -219,6 +219,10 @@ cifs_stats_write(struct file *file, const char __user *buffer, if (c == '1' || c == 'y' || c == 'Y' || c == '0') { if (c == '1' || c == 'y' || c == 'Y' || c == '0') { read_lock(&GlobalSMBSeslock); read_lock(&GlobalSMBSeslock); #ifdef CONFIG_CIFS_STATS2 atomic_set(&totBufAllocCount, 0); atomic_set(&totSmBufAllocCount, 0); #endif /* CONFIG_CIFS_STATS2 */ list_for_each(tmp, &GlobalTreeConnectionList) { list_for_each(tmp, &GlobalTreeConnectionList) { tcon = list_entry(tmp, struct cifsTconInfo, tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); cifsConnectionList); Loading
fs/cifs/cifsfs.c +6 −0 Original line number Original line Diff line number Diff line Loading @@ -954,6 +954,12 @@ init_cifs(void) atomic_set(&tconInfoReconnectCount, 0); atomic_set(&tconInfoReconnectCount, 0); atomic_set(&bufAllocCount, 0); atomic_set(&bufAllocCount, 0); atomic_set(&smBufAllocCount, 0); #ifdef CONFIG_CIFS_STATS2 atomic_set(&totBufAllocCount, 0); atomic_set(&totSmBufAllocCount, 0); #endif /* CONFIG_CIFS_STATS2 */ atomic_set(&midCount, 0); atomic_set(&midCount, 0); GlobalCurrentXid = 0; GlobalCurrentXid = 0; GlobalTotalActiveXid = 0; GlobalTotalActiveXid = 0; Loading
fs/cifs/cifsglob.h +6 −2 Original line number Original line Diff line number Diff line Loading @@ -505,7 +505,11 @@ GLOBAL_EXTERN atomic_t tcpSesReconnectCount; GLOBAL_EXTERN atomic_t tconInfoReconnectCount; GLOBAL_EXTERN atomic_t tconInfoReconnectCount; /* Various Debug counters to remove someday (BB) */ /* Various Debug counters to remove someday (BB) */ GLOBAL_EXTERN atomic_t bufAllocCount; GLOBAL_EXTERN atomic_t bufAllocCount; /* current number allocated */ #ifdef CONFIG_CIFS_STATS2 GLOBAL_EXTERN atomic_t totBufAllocCount; /* total allocated over all time */ GLOBAL_EXTERN atomic_t totSmBufAllocCount; #endif GLOBAL_EXTERN atomic_t smBufAllocCount; GLOBAL_EXTERN atomic_t smBufAllocCount; GLOBAL_EXTERN atomic_t midCount; GLOBAL_EXTERN atomic_t midCount; Loading
fs/cifs/misc.c +7 −0 Original line number Original line Diff line number Diff line Loading @@ -161,6 +161,9 @@ cifs_buf_get(void) if (ret_buf) { if (ret_buf) { memset(ret_buf, 0, sizeof(struct smb_hdr) + 3); memset(ret_buf, 0, sizeof(struct smb_hdr) + 3); atomic_inc(&bufAllocCount); atomic_inc(&bufAllocCount); #ifdef CONFIG_CIFS_STATS2 atomic_inc(&totBufAllocCount); #endif /* CONFIG_CIFS_STATS2 */ } } return ret_buf; return ret_buf; Loading Loading @@ -195,6 +198,10 @@ cifs_small_buf_get(void) /* No need to clear memory here, cleared in header assemble */ /* No need to clear memory here, cleared in header assemble */ /* memset(ret_buf, 0, sizeof(struct smb_hdr) + 27);*/ /* memset(ret_buf, 0, sizeof(struct smb_hdr) + 27);*/ atomic_inc(&smBufAllocCount); atomic_inc(&smBufAllocCount); #ifdef CONFIG_CIFS_STATS2 atomic_inc(&totSmBufAllocCount); #endif /* CONFIG_CIFS_STATS2 */ } } return ret_buf; return ret_buf; } } Loading