diff options
Diffstat (limited to 'fs/cifs/cifs_debug.c')
-rw-r--r-- | fs/cifs/cifs_debug.c | 68 |
1 files changed, 13 insertions, 55 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 573b899b5a5..27046462941 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -58,15 +58,16 @@ cifs_dump_mem(char *label, void *data, int length) | |||
58 | } | 58 | } |
59 | 59 | ||
60 | #ifdef CONFIG_CIFS_DEBUG2 | 60 | #ifdef CONFIG_CIFS_DEBUG2 |
61 | void cifs_dump_detail(struct smb_hdr *smb) | 61 | void cifs_dump_detail(void *buf) |
62 | { | 62 | { |
63 | struct smb_hdr *smb = (struct smb_hdr *)buf; | ||
64 | |||
63 | cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d", | 65 | cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d", |
64 | smb->Command, smb->Status.CifsError, | 66 | smb->Command, smb->Status.CifsError, |
65 | smb->Flags, smb->Flags2, smb->Mid, smb->Pid); | 67 | smb->Flags, smb->Flags2, smb->Mid, smb->Pid); |
66 | cERROR(1, "smb buf %p len %d", smb, smbCalcSize(smb)); | 68 | cERROR(1, "smb buf %p len %d", smb, smbCalcSize(smb)); |
67 | } | 69 | } |
68 | 70 | ||
69 | |||
70 | void cifs_dump_mids(struct TCP_Server_Info *server) | 71 | void cifs_dump_mids(struct TCP_Server_Info *server) |
71 | { | 72 | { |
72 | struct list_head *tmp; | 73 | struct list_head *tmp; |
@@ -79,15 +80,15 @@ void cifs_dump_mids(struct TCP_Server_Info *server) | |||
79 | spin_lock(&GlobalMid_Lock); | 80 | spin_lock(&GlobalMid_Lock); |
80 | list_for_each(tmp, &server->pending_mid_q) { | 81 | list_for_each(tmp, &server->pending_mid_q) { |
81 | mid_entry = list_entry(tmp, struct mid_q_entry, qhead); | 82 | mid_entry = list_entry(tmp, struct mid_q_entry, qhead); |
82 | cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %d", | 83 | cERROR(1, "State: %d Cmd: %d Pid: %d Cbdata: %p Mid %llu", |
83 | mid_entry->midState, | 84 | mid_entry->mid_state, |
84 | (int)mid_entry->command, | 85 | le16_to_cpu(mid_entry->command), |
85 | mid_entry->pid, | 86 | mid_entry->pid, |
86 | mid_entry->callback_data, | 87 | mid_entry->callback_data, |
87 | mid_entry->mid); | 88 | mid_entry->mid); |
88 | #ifdef CONFIG_CIFS_STATS2 | 89 | #ifdef CONFIG_CIFS_STATS2 |
89 | cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld", | 90 | cERROR(1, "IsLarge: %d buf: %p time rcv: %ld now: %ld", |
90 | mid_entry->largeBuf, | 91 | mid_entry->large_buf, |
91 | mid_entry->resp_buf, | 92 | mid_entry->resp_buf, |
92 | mid_entry->when_received, | 93 | mid_entry->when_received, |
93 | jiffies); | 94 | jiffies); |
@@ -217,12 +218,12 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v) | |||
217 | mid_entry = list_entry(tmp3, struct mid_q_entry, | 218 | mid_entry = list_entry(tmp3, struct mid_q_entry, |
218 | qhead); | 219 | qhead); |
219 | seq_printf(m, "\tState: %d com: %d pid:" | 220 | seq_printf(m, "\tState: %d com: %d pid:" |
220 | " %d cbdata: %p mid %d\n", | 221 | " %d cbdata: %p mid %llu\n", |
221 | mid_entry->midState, | 222 | mid_entry->mid_state, |
222 | (int)mid_entry->command, | 223 | le16_to_cpu(mid_entry->command), |
223 | mid_entry->pid, | 224 | mid_entry->pid, |
224 | mid_entry->callback_data, | 225 | mid_entry->callback_data, |
225 | mid_entry->mid); | 226 | mid_entry->mid); |
226 | } | 227 | } |
227 | spin_unlock(&GlobalMid_Lock); | 228 | spin_unlock(&GlobalMid_Lock); |
228 | } | 229 | } |
@@ -417,7 +418,6 @@ static const struct file_operations cifs_stats_proc_fops = { | |||
417 | 418 | ||
418 | static struct proc_dir_entry *proc_fs_cifs; | 419 | static struct proc_dir_entry *proc_fs_cifs; |
419 | static const struct file_operations cifsFYI_proc_fops; | 420 | static const struct file_operations cifsFYI_proc_fops; |
420 | static const struct file_operations cifs_oplock_proc_fops; | ||
421 | static const struct file_operations cifs_lookup_cache_proc_fops; | 421 | static const struct file_operations cifs_lookup_cache_proc_fops; |
422 | static const struct file_operations traceSMB_proc_fops; | 422 | static const struct file_operations traceSMB_proc_fops; |
423 | static const struct file_operations cifs_multiuser_mount_proc_fops; | 423 | static const struct file_operations cifs_multiuser_mount_proc_fops; |
@@ -438,7 +438,6 @@ cifs_proc_init(void) | |||
438 | #endif /* STATS */ | 438 | #endif /* STATS */ |
439 | proc_create("cifsFYI", 0, proc_fs_cifs, &cifsFYI_proc_fops); | 439 | proc_create("cifsFYI", 0, proc_fs_cifs, &cifsFYI_proc_fops); |
440 | proc_create("traceSMB", 0, proc_fs_cifs, &traceSMB_proc_fops); | 440 | proc_create("traceSMB", 0, proc_fs_cifs, &traceSMB_proc_fops); |
441 | proc_create("OplockEnabled", 0, proc_fs_cifs, &cifs_oplock_proc_fops); | ||
442 | proc_create("LinuxExtensionsEnabled", 0, proc_fs_cifs, | 441 | proc_create("LinuxExtensionsEnabled", 0, proc_fs_cifs, |
443 | &cifs_linux_ext_proc_fops); | 442 | &cifs_linux_ext_proc_fops); |
444 | proc_create("MultiuserMount", 0, proc_fs_cifs, | 443 | proc_create("MultiuserMount", 0, proc_fs_cifs, |
@@ -462,7 +461,6 @@ cifs_proc_clean(void) | |||
462 | remove_proc_entry("Stats", proc_fs_cifs); | 461 | remove_proc_entry("Stats", proc_fs_cifs); |
463 | #endif | 462 | #endif |
464 | remove_proc_entry("MultiuserMount", proc_fs_cifs); | 463 | remove_proc_entry("MultiuserMount", proc_fs_cifs); |
465 | remove_proc_entry("OplockEnabled", proc_fs_cifs); | ||
466 | remove_proc_entry("SecurityFlags", proc_fs_cifs); | 464 | remove_proc_entry("SecurityFlags", proc_fs_cifs); |
467 | remove_proc_entry("LinuxExtensionsEnabled", proc_fs_cifs); | 465 | remove_proc_entry("LinuxExtensionsEnabled", proc_fs_cifs); |
468 | remove_proc_entry("LookupCacheEnabled", proc_fs_cifs); | 466 | remove_proc_entry("LookupCacheEnabled", proc_fs_cifs); |
@@ -508,46 +506,6 @@ static const struct file_operations cifsFYI_proc_fops = { | |||
508 | .write = cifsFYI_proc_write, | 506 | .write = cifsFYI_proc_write, |
509 | }; | 507 | }; |
510 | 508 | ||
511 | static int cifs_oplock_proc_show(struct seq_file *m, void *v) | ||
512 | { | ||
513 | seq_printf(m, "%d\n", enable_oplocks); | ||
514 | return 0; | ||
515 | } | ||
516 | |||
517 | static int cifs_oplock_proc_open(struct inode *inode, struct file *file) | ||
518 | { | ||
519 | return single_open(file, cifs_oplock_proc_show, NULL); | ||
520 | } | ||
521 | |||
522 | static ssize_t cifs_oplock_proc_write(struct file *file, | ||
523 | const char __user *buffer, size_t count, loff_t *ppos) | ||
524 | { | ||
525 | char c; | ||
526 | int rc; | ||
527 | |||
528 | printk(KERN_WARNING "CIFS: The /proc/fs/cifs/OplockEnabled interface " | ||
529 | "will be removed in kernel version 3.4. Please migrate to " | ||
530 | "using the 'enable_oplocks' module parameter in cifs.ko.\n"); | ||
531 | rc = get_user(c, buffer); | ||
532 | if (rc) | ||
533 | return rc; | ||
534 | if (c == '0' || c == 'n' || c == 'N') | ||
535 | enable_oplocks = false; | ||
536 | else if (c == '1' || c == 'y' || c == 'Y') | ||
537 | enable_oplocks = true; | ||
538 | |||
539 | return count; | ||
540 | } | ||
541 | |||
542 | static const struct file_operations cifs_oplock_proc_fops = { | ||
543 | .owner = THIS_MODULE, | ||
544 | .open = cifs_oplock_proc_open, | ||
545 | .read = seq_read, | ||
546 | .llseek = seq_lseek, | ||
547 | .release = single_release, | ||
548 | .write = cifs_oplock_proc_write, | ||
549 | }; | ||
550 | |||
551 | static int cifs_linux_ext_proc_show(struct seq_file *m, void *v) | 509 | static int cifs_linux_ext_proc_show(struct seq_file *m, void *v) |
552 | { | 510 | { |
553 | seq_printf(m, "%d\n", linuxExtEnabled); | 511 | seq_printf(m, "%d\n", linuxExtEnabled); |