aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifs_debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifs_debug.c')
-rw-r--r--fs/cifs/cifs_debug.c115
1 files changed, 35 insertions, 80 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index eb1ba493489f..2fe3cf13b2e9 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -63,7 +63,7 @@ void cifs_dump_detail(struct smb_hdr *smb)
63 cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d", 63 cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d",
64 smb->Command, smb->Status.CifsError, 64 smb->Command, smb->Status.CifsError,
65 smb->Flags, smb->Flags2, smb->Mid, smb->Pid); 65 smb->Flags, smb->Flags2, smb->Mid, smb->Pid);
66 cERROR(1, "smb buf %p len %d", smb, smbCalcSize_LE(smb)); 66 cERROR(1, "smb buf %p len %d", smb, smbCalcSize(smb));
67} 67}
68 68
69 69
@@ -79,11 +79,11 @@ void cifs_dump_mids(struct TCP_Server_Info *server)
79 spin_lock(&GlobalMid_Lock); 79 spin_lock(&GlobalMid_Lock);
80 list_for_each(tmp, &server->pending_mid_q) { 80 list_for_each(tmp, &server->pending_mid_q) {
81 mid_entry = list_entry(tmp, struct mid_q_entry, qhead); 81 mid_entry = list_entry(tmp, struct mid_q_entry, qhead);
82 cERROR(1, "State: %d Cmd: %d Pid: %d Tsk: %p Mid %d", 82 cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %d",
83 mid_entry->midState, 83 mid_entry->midState,
84 (int)mid_entry->command, 84 (int)mid_entry->command,
85 mid_entry->pid, 85 mid_entry->pid,
86 mid_entry->tsk, 86 mid_entry->callback_data,
87 mid_entry->mid); 87 mid_entry->mid);
88#ifdef CONFIG_CIFS_STATS2 88#ifdef CONFIG_CIFS_STATS2
89 cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld", 89 cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld",
@@ -110,8 +110,8 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
110 struct list_head *tmp1, *tmp2, *tmp3; 110 struct list_head *tmp1, *tmp2, *tmp3;
111 struct mid_q_entry *mid_entry; 111 struct mid_q_entry *mid_entry;
112 struct TCP_Server_Info *server; 112 struct TCP_Server_Info *server;
113 struct cifsSesInfo *ses; 113 struct cifs_ses *ses;
114 struct cifsTconInfo *tcon; 114 struct cifs_tcon *tcon;
115 int i, j; 115 int i, j;
116 __u32 dev_type; 116 __u32 dev_type;
117 117
@@ -119,42 +119,40 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
119 "Display Internal CIFS Data Structures for Debugging\n" 119 "Display Internal CIFS Data Structures for Debugging\n"
120 "---------------------------------------------------\n"); 120 "---------------------------------------------------\n");
121 seq_printf(m, "CIFS Version %s\n", CIFS_VERSION); 121 seq_printf(m, "CIFS Version %s\n", CIFS_VERSION);
122 seq_printf(m, "Features: "); 122 seq_printf(m, "Features:");
123#ifdef CONFIG_CIFS_DFS_UPCALL 123#ifdef CONFIG_CIFS_DFS_UPCALL
124 seq_printf(m, "dfs"); 124 seq_printf(m, " dfs");
125 seq_putc(m, ' ');
126#endif 125#endif
127#ifdef CONFIG_CIFS_FSCACHE 126#ifdef CONFIG_CIFS_FSCACHE
128 seq_printf(m, "fscache"); 127 seq_printf(m, " fscache");
129 seq_putc(m, ' ');
130#endif 128#endif
131#ifdef CONFIG_CIFS_WEAK_PW_HASH 129#ifdef CONFIG_CIFS_WEAK_PW_HASH
132 seq_printf(m, "lanman"); 130 seq_printf(m, " lanman");
133 seq_putc(m, ' ');
134#endif 131#endif
135#ifdef CONFIG_CIFS_POSIX 132#ifdef CONFIG_CIFS_POSIX
136 seq_printf(m, "posix"); 133 seq_printf(m, " posix");
137 seq_putc(m, ' ');
138#endif 134#endif
139#ifdef CONFIG_CIFS_UPCALL 135#ifdef CONFIG_CIFS_UPCALL
140 seq_printf(m, "spnego"); 136 seq_printf(m, " spnego");
141 seq_putc(m, ' ');
142#endif 137#endif
143#ifdef CONFIG_CIFS_XATTR 138#ifdef CONFIG_CIFS_XATTR
144 seq_printf(m, "xattr"); 139 seq_printf(m, " xattr");
140#endif
141#ifdef CONFIG_CIFS_ACL
142 seq_printf(m, " acl");
145#endif 143#endif
146 seq_putc(m, '\n'); 144 seq_putc(m, '\n');
147 seq_printf(m, "Active VFS Requests: %d\n", GlobalTotalActiveXid); 145 seq_printf(m, "Active VFS Requests: %d\n", GlobalTotalActiveXid);
148 seq_printf(m, "Servers:"); 146 seq_printf(m, "Servers:");
149 147
150 i = 0; 148 i = 0;
151 read_lock(&cifs_tcp_ses_lock); 149 spin_lock(&cifs_tcp_ses_lock);
152 list_for_each(tmp1, &cifs_tcp_ses_list) { 150 list_for_each(tmp1, &cifs_tcp_ses_list) {
153 server = list_entry(tmp1, struct TCP_Server_Info, 151 server = list_entry(tmp1, struct TCP_Server_Info,
154 tcp_ses_list); 152 tcp_ses_list);
155 i++; 153 i++;
156 list_for_each(tmp2, &server->smb_ses_list) { 154 list_for_each(tmp2, &server->smb_ses_list) {
157 ses = list_entry(tmp2, struct cifsSesInfo, 155 ses = list_entry(tmp2, struct cifs_ses,
158 smb_ses_list); 156 smb_ses_list);
159 if ((ses->serverDomain == NULL) || 157 if ((ses->serverDomain == NULL) ||
160 (ses->serverOS == NULL) || 158 (ses->serverOS == NULL) ||
@@ -173,7 +171,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
173 seq_printf(m, "TCP status: %d\n\tLocal Users To " 171 seq_printf(m, "TCP status: %d\n\tLocal Users To "
174 "Server: %d SecMode: 0x%x Req On Wire: %d", 172 "Server: %d SecMode: 0x%x Req On Wire: %d",
175 server->tcpStatus, server->srv_count, 173 server->tcpStatus, server->srv_count,
176 server->secMode, 174 server->sec_mode,
177 atomic_read(&server->inFlight)); 175 atomic_read(&server->inFlight));
178 176
179#ifdef CONFIG_CIFS_STATS2 177#ifdef CONFIG_CIFS_STATS2
@@ -185,7 +183,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
185 seq_puts(m, "\n\tShares:"); 183 seq_puts(m, "\n\tShares:");
186 j = 0; 184 j = 0;
187 list_for_each(tmp3, &ses->tcon_list) { 185 list_for_each(tmp3, &ses->tcon_list) {
188 tcon = list_entry(tmp3, struct cifsTconInfo, 186 tcon = list_entry(tmp3, struct cifs_tcon,
189 tcon_list); 187 tcon_list);
190 ++j; 188 ++j;
191 dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType); 189 dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType);
@@ -220,17 +218,17 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
220 mid_entry = list_entry(tmp3, struct mid_q_entry, 218 mid_entry = list_entry(tmp3, struct mid_q_entry,
221 qhead); 219 qhead);
222 seq_printf(m, "\tState: %d com: %d pid:" 220 seq_printf(m, "\tState: %d com: %d pid:"
223 " %d tsk: %p mid %d\n", 221 " %d cbdata: %p mid %d\n",
224 mid_entry->midState, 222 mid_entry->midState,
225 (int)mid_entry->command, 223 (int)mid_entry->command,
226 mid_entry->pid, 224 mid_entry->pid,
227 mid_entry->tsk, 225 mid_entry->callback_data,
228 mid_entry->mid); 226 mid_entry->mid);
229 } 227 }
230 spin_unlock(&GlobalMid_Lock); 228 spin_unlock(&GlobalMid_Lock);
231 } 229 }
232 } 230 }
233 read_unlock(&cifs_tcp_ses_lock); 231 spin_unlock(&cifs_tcp_ses_lock);
234 seq_putc(m, '\n'); 232 seq_putc(m, '\n');
235 233
236 /* BB add code to dump additional info such as TCP session info now */ 234 /* BB add code to dump additional info such as TCP session info now */
@@ -258,8 +256,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
258 int rc; 256 int rc;
259 struct list_head *tmp1, *tmp2, *tmp3; 257 struct list_head *tmp1, *tmp2, *tmp3;
260 struct TCP_Server_Info *server; 258 struct TCP_Server_Info *server;
261 struct cifsSesInfo *ses; 259 struct cifs_ses *ses;
262 struct cifsTconInfo *tcon; 260 struct cifs_tcon *tcon;
263 261
264 rc = get_user(c, buffer); 262 rc = get_user(c, buffer);
265 if (rc) 263 if (rc)
@@ -270,16 +268,16 @@ static ssize_t cifs_stats_proc_write(struct file *file,
270 atomic_set(&totBufAllocCount, 0); 268 atomic_set(&totBufAllocCount, 0);
271 atomic_set(&totSmBufAllocCount, 0); 269 atomic_set(&totSmBufAllocCount, 0);
272#endif /* CONFIG_CIFS_STATS2 */ 270#endif /* CONFIG_CIFS_STATS2 */
273 read_lock(&cifs_tcp_ses_lock); 271 spin_lock(&cifs_tcp_ses_lock);
274 list_for_each(tmp1, &cifs_tcp_ses_list) { 272 list_for_each(tmp1, &cifs_tcp_ses_list) {
275 server = list_entry(tmp1, struct TCP_Server_Info, 273 server = list_entry(tmp1, struct TCP_Server_Info,
276 tcp_ses_list); 274 tcp_ses_list);
277 list_for_each(tmp2, &server->smb_ses_list) { 275 list_for_each(tmp2, &server->smb_ses_list) {
278 ses = list_entry(tmp2, struct cifsSesInfo, 276 ses = list_entry(tmp2, struct cifs_ses,
279 smb_ses_list); 277 smb_ses_list);
280 list_for_each(tmp3, &ses->tcon_list) { 278 list_for_each(tmp3, &ses->tcon_list) {
281 tcon = list_entry(tmp3, 279 tcon = list_entry(tmp3,
282 struct cifsTconInfo, 280 struct cifs_tcon,
283 tcon_list); 281 tcon_list);
284 atomic_set(&tcon->num_smbs_sent, 0); 282 atomic_set(&tcon->num_smbs_sent, 0);
285 atomic_set(&tcon->num_writes, 0); 283 atomic_set(&tcon->num_writes, 0);
@@ -303,7 +301,7 @@ static ssize_t cifs_stats_proc_write(struct file *file,
303 } 301 }
304 } 302 }
305 } 303 }
306 read_unlock(&cifs_tcp_ses_lock); 304 spin_unlock(&cifs_tcp_ses_lock);
307 } 305 }
308 306
309 return count; 307 return count;
@@ -314,8 +312,8 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
314 int i; 312 int i;
315 struct list_head *tmp1, *tmp2, *tmp3; 313 struct list_head *tmp1, *tmp2, *tmp3;
316 struct TCP_Server_Info *server; 314 struct TCP_Server_Info *server;
317 struct cifsSesInfo *ses; 315 struct cifs_ses *ses;
318 struct cifsTconInfo *tcon; 316 struct cifs_tcon *tcon;
319 317
320 seq_printf(m, 318 seq_printf(m,
321 "Resources in use\nCIFS Session: %d\n", 319 "Resources in use\nCIFS Session: %d\n",
@@ -333,7 +331,7 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
333 atomic_read(&totSmBufAllocCount)); 331 atomic_read(&totSmBufAllocCount));
334#endif /* CONFIG_CIFS_STATS2 */ 332#endif /* CONFIG_CIFS_STATS2 */
335 333
336 seq_printf(m, "Operations (MIDs): %d\n", midCount.counter); 334 seq_printf(m, "Operations (MIDs): %d\n", atomic_read(&midCount));
337 seq_printf(m, 335 seq_printf(m,
338 "\n%d session %d share reconnects\n", 336 "\n%d session %d share reconnects\n",
339 tcpSesReconnectCount.counter, tconInfoReconnectCount.counter); 337 tcpSesReconnectCount.counter, tconInfoReconnectCount.counter);
@@ -343,16 +341,16 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
343 GlobalCurrentXid, GlobalMaxActiveXid); 341 GlobalCurrentXid, GlobalMaxActiveXid);
344 342
345 i = 0; 343 i = 0;
346 read_lock(&cifs_tcp_ses_lock); 344 spin_lock(&cifs_tcp_ses_lock);
347 list_for_each(tmp1, &cifs_tcp_ses_list) { 345 list_for_each(tmp1, &cifs_tcp_ses_list) {
348 server = list_entry(tmp1, struct TCP_Server_Info, 346 server = list_entry(tmp1, struct TCP_Server_Info,
349 tcp_ses_list); 347 tcp_ses_list);
350 list_for_each(tmp2, &server->smb_ses_list) { 348 list_for_each(tmp2, &server->smb_ses_list) {
351 ses = list_entry(tmp2, struct cifsSesInfo, 349 ses = list_entry(tmp2, struct cifs_ses,
352 smb_ses_list); 350 smb_ses_list);
353 list_for_each(tmp3, &ses->tcon_list) { 351 list_for_each(tmp3, &ses->tcon_list) {
354 tcon = list_entry(tmp3, 352 tcon = list_entry(tmp3,
355 struct cifsTconInfo, 353 struct cifs_tcon,
356 tcon_list); 354 tcon_list);
357 i++; 355 i++;
358 seq_printf(m, "\n%d) %s", i, tcon->treeName); 356 seq_printf(m, "\n%d) %s", i, tcon->treeName);
@@ -397,7 +395,7 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
397 } 395 }
398 } 396 }
399 } 397 }
400 read_unlock(&cifs_tcp_ses_lock); 398 spin_unlock(&cifs_tcp_ses_lock);
401 399
402 seq_putc(m, '\n'); 400 seq_putc(m, '\n');
403 return 0; 401 return 0;
@@ -425,7 +423,6 @@ static const struct file_operations cifs_lookup_cache_proc_fops;
425static const struct file_operations traceSMB_proc_fops; 423static const struct file_operations traceSMB_proc_fops;
426static const struct file_operations cifs_multiuser_mount_proc_fops; 424static const struct file_operations cifs_multiuser_mount_proc_fops;
427static const struct file_operations cifs_security_flags_proc_fops; 425static const struct file_operations cifs_security_flags_proc_fops;
428static const struct file_operations cifs_experimental_proc_fops;
429static const struct file_operations cifs_linux_ext_proc_fops; 426static const struct file_operations cifs_linux_ext_proc_fops;
430 427
431void 428void
@@ -443,8 +440,6 @@ cifs_proc_init(void)
443 proc_create("cifsFYI", 0, proc_fs_cifs, &cifsFYI_proc_fops); 440 proc_create("cifsFYI", 0, proc_fs_cifs, &cifsFYI_proc_fops);
444 proc_create("traceSMB", 0, proc_fs_cifs, &traceSMB_proc_fops); 441 proc_create("traceSMB", 0, proc_fs_cifs, &traceSMB_proc_fops);
445 proc_create("OplockEnabled", 0, proc_fs_cifs, &cifs_oplock_proc_fops); 442 proc_create("OplockEnabled", 0, proc_fs_cifs, &cifs_oplock_proc_fops);
446 proc_create("Experimental", 0, proc_fs_cifs,
447 &cifs_experimental_proc_fops);
448 proc_create("LinuxExtensionsEnabled", 0, proc_fs_cifs, 443 proc_create("LinuxExtensionsEnabled", 0, proc_fs_cifs,
449 &cifs_linux_ext_proc_fops); 444 &cifs_linux_ext_proc_fops);
450 proc_create("MultiuserMount", 0, proc_fs_cifs, 445 proc_create("MultiuserMount", 0, proc_fs_cifs,
@@ -471,7 +466,6 @@ cifs_proc_clean(void)
471 remove_proc_entry("OplockEnabled", proc_fs_cifs); 466 remove_proc_entry("OplockEnabled", proc_fs_cifs);
472 remove_proc_entry("SecurityFlags", proc_fs_cifs); 467 remove_proc_entry("SecurityFlags", proc_fs_cifs);
473 remove_proc_entry("LinuxExtensionsEnabled", proc_fs_cifs); 468 remove_proc_entry("LinuxExtensionsEnabled", proc_fs_cifs);
474 remove_proc_entry("Experimental", proc_fs_cifs);
475 remove_proc_entry("LookupCacheEnabled", proc_fs_cifs); 469 remove_proc_entry("LookupCacheEnabled", proc_fs_cifs);
476 remove_proc_entry("fs/cifs", NULL); 470 remove_proc_entry("fs/cifs", NULL);
477} 471}
@@ -552,45 +546,6 @@ static const struct file_operations cifs_oplock_proc_fops = {
552 .write = cifs_oplock_proc_write, 546 .write = cifs_oplock_proc_write,
553}; 547};
554 548
555static int cifs_experimental_proc_show(struct seq_file *m, void *v)
556{
557 seq_printf(m, "%d\n", experimEnabled);
558 return 0;
559}
560
561static int cifs_experimental_proc_open(struct inode *inode, struct file *file)
562{
563 return single_open(file, cifs_experimental_proc_show, NULL);
564}
565
566static ssize_t cifs_experimental_proc_write(struct file *file,
567 const char __user *buffer, size_t count, loff_t *ppos)
568{
569 char c;
570 int rc;
571
572 rc = get_user(c, buffer);
573 if (rc)
574 return rc;
575 if (c == '0' || c == 'n' || c == 'N')
576 experimEnabled = 0;
577 else if (c == '1' || c == 'y' || c == 'Y')
578 experimEnabled = 1;
579 else if (c == '2')
580 experimEnabled = 2;
581
582 return count;
583}
584
585static const struct file_operations cifs_experimental_proc_fops = {
586 .owner = THIS_MODULE,
587 .open = cifs_experimental_proc_open,
588 .read = seq_read,
589 .llseek = seq_lseek,
590 .release = single_release,
591 .write = cifs_experimental_proc_write,
592};
593
594static int cifs_linux_ext_proc_show(struct seq_file *m, void *v) 549static int cifs_linux_ext_proc_show(struct seq_file *m, void *v)
595{ 550{
596 seq_printf(m, "%d\n", linuxExtEnabled); 551 seq_printf(m, "%d\n", linuxExtEnabled);