diff options
Diffstat (limited to 'fs/cifs/cifs_debug.c')
| -rw-r--r-- | fs/cifs/cifs_debug.c | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index db28b561cd4b..4061e43471c1 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * fs/cifs_debug.c | 2 | * fs/cifs_debug.c |
| 3 | * | 3 | * |
| 4 | * Copyright (C) International Business Machines Corp., 2000,2003 | 4 | * Copyright (C) International Business Machines Corp., 2000,2005 |
| 5 | * | 5 | * |
| 6 | * Modified by Steve French (sfrench@us.ibm.com) | 6 | * Modified by Steve French (sfrench@us.ibm.com) |
| 7 | * | 7 | * |
| @@ -29,6 +29,7 @@ | |||
| 29 | #include "cifsglob.h" | 29 | #include "cifsglob.h" |
| 30 | #include "cifsproto.h" | 30 | #include "cifsproto.h" |
| 31 | #include "cifs_debug.h" | 31 | #include "cifs_debug.h" |
| 32 | #include "cifsfs.h" | ||
| 32 | 33 | ||
| 33 | void | 34 | void |
| 34 | cifs_dump_mem(char *label, void *data, int length) | 35 | cifs_dump_mem(char *label, void *data, int length) |
| @@ -78,8 +79,9 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
| 78 | "Display Internal CIFS Data Structures for Debugging\n" | 79 | "Display Internal CIFS Data Structures for Debugging\n" |
| 79 | "---------------------------------------------------\n"); | 80 | "---------------------------------------------------\n"); |
| 80 | buf += length; | 81 | buf += length; |
| 81 | 82 | length = sprintf(buf,"CIFS Version %s\n",CIFS_VERSION); | |
| 82 | length = sprintf(buf, "Servers:\n"); | 83 | buf += length; |
| 84 | length = sprintf(buf, "Servers:"); | ||
| 83 | buf += length; | 85 | buf += length; |
| 84 | 86 | ||
| 85 | i = 0; | 87 | i = 0; |
| @@ -87,12 +89,21 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
| 87 | list_for_each(tmp, &GlobalSMBSessionList) { | 89 | list_for_each(tmp, &GlobalSMBSessionList) { |
| 88 | i++; | 90 | i++; |
| 89 | ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); | 91 | ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); |
| 90 | length = | 92 | if((ses->serverDomain == NULL) || (ses->serverOS == NULL) || |
| 91 | sprintf(buf, | 93 | (ses->serverNOS == NULL)) { |
| 92 | "\n%d) Name: %s Domain: %s Mounts: %d ServerOS: %s \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\t", | 94 | buf += sprintf("\nentry for %s not fully displayed\n\t", |
| 93 | i, ses->serverName, ses->serverDomain, atomic_read(&ses->inUse), | 95 | ses->serverName); |
| 94 | ses->serverOS, ses->serverNOS, ses->capabilities,ses->status); | 96 | |
| 95 | buf += length; | 97 | } else { |
| 98 | length = | ||
| 99 | sprintf(buf, | ||
| 100 | "\n%d) Name: %s Domain: %s Mounts: %d ServerOS: %s \n\tServerNOS: %s\tCapabilities: 0x%x\n\tSMB session status: %d\t", | ||
| 101 | i, ses->serverName, ses->serverDomain, | ||
| 102 | atomic_read(&ses->inUse), | ||
| 103 | ses->serverOS, ses->serverNOS, | ||
| 104 | ses->capabilities,ses->status); | ||
| 105 | buf += length; | ||
| 106 | } | ||
| 96 | if(ses->server) { | 107 | if(ses->server) { |
| 97 | buf += sprintf(buf, "TCP status: %d\n\tLocal Users To Server: %d SecMode: 0x%x Req Active: %d", | 108 | buf += sprintf(buf, "TCP status: %d\n\tLocal Users To Server: %d SecMode: 0x%x Req Active: %d", |
| 98 | ses->server->tcpStatus, | 109 | ses->server->tcpStatus, |
| @@ -100,7 +111,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
| 100 | ses->server->secMode, | 111 | ses->server->secMode, |
| 101 | atomic_read(&ses->server->inFlight)); | 112 | atomic_read(&ses->server->inFlight)); |
| 102 | 113 | ||
| 103 | length = sprintf(buf, "\nMIDs: \n"); | 114 | length = sprintf(buf, "\nMIDs:\n"); |
| 104 | buf += length; | 115 | buf += length; |
| 105 | 116 | ||
| 106 | spin_lock(&GlobalMid_Lock); | 117 | spin_lock(&GlobalMid_Lock); |
| @@ -109,7 +120,12 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
| 109 | mid_q_entry, | 120 | mid_q_entry, |
| 110 | qhead); | 121 | qhead); |
| 111 | if(mid_entry) { | 122 | if(mid_entry) { |
| 112 | length = sprintf(buf,"State: %d com: %d pid: %d tsk: %p mid %d\n",mid_entry->midState,mid_entry->command,mid_entry->pid,mid_entry->tsk,mid_entry->mid); | 123 | length = sprintf(buf,"State: %d com: %d pid: %d tsk: %p mid %d\n", |
| 124 | mid_entry->midState, | ||
| 125 | (int)mid_entry->command, | ||
| 126 | mid_entry->pid, | ||
| 127 | mid_entry->tsk, | ||
| 128 | mid_entry->mid); | ||
| 113 | buf += length; | 129 | buf += length; |
| 114 | } | 130 | } |
| 115 | } | 131 | } |
| @@ -121,7 +137,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
| 121 | sprintf(buf, "\n"); | 137 | sprintf(buf, "\n"); |
| 122 | buf++; | 138 | buf++; |
| 123 | 139 | ||
| 124 | length = sprintf(buf, "\nShares:\n"); | 140 | length = sprintf(buf, "Shares:"); |
| 125 | buf += length; | 141 | buf += length; |
| 126 | 142 | ||
| 127 | i = 0; | 143 | i = 0; |
| @@ -200,7 +216,8 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, | |||
| 200 | buf += item_length; | 216 | buf += item_length; |
| 201 | item_length = | 217 | item_length = |
| 202 | sprintf(buf,"SMB Request/Response Buffer: %d Pool size: %d\n", | 218 | sprintf(buf,"SMB Request/Response Buffer: %d Pool size: %d\n", |
| 203 | bufAllocCount.counter,cifs_min_rcv + tcpSesAllocCount.counter); | 219 | bufAllocCount.counter, |
| 220 | cifs_min_rcv + tcpSesAllocCount.counter); | ||
| 204 | length += item_length; | 221 | length += item_length; |
| 205 | buf += item_length; | 222 | buf += item_length; |
| 206 | item_length = | 223 | item_length = |
