diff options
-rw-r--r-- | fs/cifs/cifs_debug.c | 252 | ||||
-rw-r--r-- | fs/cifs/cifs_unicode.c | 12 | ||||
-rw-r--r-- | fs/cifs/dir.c | 6 |
3 files changed, 138 insertions, 132 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 6017c465440e..07838b2ac1ce 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -7,16 +7,16 @@ | |||
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 9 | * it under the terms of the GNU General Public License as published by |
10 | * the Free Software Foundation; either version 2 of the License, or | 10 | * the Free Software Foundation; either version 2 of the License, or |
11 | * (at your option) any later version. | 11 | * (at your option) any later version. |
12 | * | 12 | * |
13 | * This program is distributed in the hope that it will be useful, | 13 | * This program is distributed in the hope that it will be useful, |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
16 | * the GNU General Public License for more details. | 16 | * the GNU General Public License for more details. |
17 | * | 17 | * |
18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License |
19 | * along with this program; if not, write to the Free Software | 19 | * along with this program; if not, write to the Free Software |
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | #include <linux/fs.h> | 22 | #include <linux/fs.h> |
@@ -39,7 +39,7 @@ cifs_dump_mem(char *label, void *data, int length) | |||
39 | char *charptr = data; | 39 | char *charptr = data; |
40 | char buf[10], line[80]; | 40 | char buf[10], line[80]; |
41 | 41 | ||
42 | printk(KERN_DEBUG "%s: dump of %d bytes of data at 0x%p\n", | 42 | printk(KERN_DEBUG "%s: dump of %d bytes of data at 0x%p\n", |
43 | label, length, data); | 43 | label, length, data); |
44 | for (i = 0; i < length; i += 16) { | 44 | for (i = 0; i < length; i += 16) { |
45 | line[0] = 0; | 45 | line[0] = 0; |
@@ -60,10 +60,10 @@ cifs_dump_mem(char *label, void *data, int length) | |||
60 | #ifdef CONFIG_CIFS_DEBUG2 | 60 | #ifdef CONFIG_CIFS_DEBUG2 |
61 | void cifs_dump_detail(struct smb_hdr * smb) | 61 | void cifs_dump_detail(struct smb_hdr * smb) |
62 | { | 62 | { |
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_LE(smb))); |
67 | } | 67 | } |
68 | 68 | ||
69 | 69 | ||
@@ -72,36 +72,35 @@ void cifs_dump_mids(struct TCP_Server_Info * server) | |||
72 | struct list_head *tmp; | 72 | struct list_head *tmp; |
73 | struct mid_q_entry * mid_entry; | 73 | struct mid_q_entry * mid_entry; |
74 | 74 | ||
75 | if(server == NULL) | 75 | if (server == NULL) |
76 | return; | 76 | return; |
77 | 77 | ||
78 | cERROR(1,("Dump pending requests:")); | 78 | cERROR(1, ("Dump pending requests:")); |
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 | if(mid_entry) { | 82 | if (mid_entry) { |
83 | cERROR(1,("State: %d Cmd: %d Pid: %d Tsk: %p Mid %d", | 83 | cERROR(1, ("State: %d Cmd: %d Pid: %d Tsk: %p Mid %d", |
84 | mid_entry->midState, | 84 | mid_entry->midState, |
85 | (int)mid_entry->command, | 85 | (int)mid_entry->command, |
86 | mid_entry->pid, | 86 | mid_entry->pid, |
87 | mid_entry->tsk, | 87 | mid_entry->tsk, |
88 | mid_entry->mid)); | 88 | mid_entry->mid)); |
89 | #ifdef CONFIG_CIFS_STATS2 | 89 | #ifdef CONFIG_CIFS_STATS2 |
90 | cERROR(1,("IsLarge: %d buf: %p time rcv: %ld now: %ld", | 90 | cERROR(1, ("IsLarge: %d buf: %p time rcv: %ld now: %ld", |
91 | mid_entry->largeBuf, | 91 | mid_entry->largeBuf, |
92 | mid_entry->resp_buf, | 92 | mid_entry->resp_buf, |
93 | mid_entry->when_received, | 93 | mid_entry->when_received, |
94 | jiffies)); | 94 | jiffies)); |
95 | #endif /* STATS2 */ | 95 | #endif /* STATS2 */ |
96 | cERROR(1,("IsMult: %d IsEnd: %d", mid_entry->multiRsp, | 96 | cERROR(1, ("IsMult: %d IsEnd: %d", mid_entry->multiRsp, |
97 | mid_entry->multiEnd)); | 97 | mid_entry->multiEnd)); |
98 | if(mid_entry->resp_buf) { | 98 | if (mid_entry->resp_buf) { |
99 | cifs_dump_detail(mid_entry->resp_buf); | 99 | cifs_dump_detail(mid_entry->resp_buf); |
100 | cifs_dump_mem("existing buf: ", | 100 | cifs_dump_mem("existing buf: ", |
101 | mid_entry->resp_buf, | 101 | mid_entry->resp_buf, |
102 | 62 /* fixme */); | 102 | 62 /* fixme */); |
103 | } | 103 | } |
104 | |||
105 | } | 104 | } |
106 | } | 105 | } |
107 | spin_unlock(&GlobalMid_Lock); | 106 | spin_unlock(&GlobalMid_Lock); |
@@ -129,9 +128,10 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
129 | "Display Internal CIFS Data Structures for Debugging\n" | 128 | "Display Internal CIFS Data Structures for Debugging\n" |
130 | "---------------------------------------------------\n"); | 129 | "---------------------------------------------------\n"); |
131 | buf += length; | 130 | buf += length; |
132 | length = sprintf(buf,"CIFS Version %s\n",CIFS_VERSION); | 131 | length = sprintf(buf, "CIFS Version %s\n", CIFS_VERSION); |
133 | buf += length; | 132 | buf += length; |
134 | length = sprintf(buf,"Active VFS Requests: %d\n", GlobalTotalActiveXid); | 133 | length = sprintf(buf, |
134 | "Active VFS Requests: %d\n", GlobalTotalActiveXid); | ||
135 | buf += length; | 135 | buf += length; |
136 | length = sprintf(buf, "Servers:"); | 136 | length = sprintf(buf, "Servers:"); |
137 | buf += length; | 137 | buf += length; |
@@ -141,7 +141,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
141 | list_for_each(tmp, &GlobalSMBSessionList) { | 141 | list_for_each(tmp, &GlobalSMBSessionList) { |
142 | i++; | 142 | i++; |
143 | ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); | 143 | ses = list_entry(tmp, struct cifsSesInfo, cifsSessionList); |
144 | if((ses->serverDomain == NULL) || (ses->serverOS == NULL) || | 144 | if ((ses->serverDomain == NULL) || (ses->serverOS == NULL) || |
145 | (ses->serverNOS == NULL)) { | 145 | (ses->serverNOS == NULL)) { |
146 | buf += sprintf(buf, "\nentry for %s not fully " | 146 | buf += sprintf(buf, "\nentry for %s not fully " |
147 | "displayed\n\t", ses->serverName); | 147 | "displayed\n\t", ses->serverName); |
@@ -149,15 +149,18 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
149 | } else { | 149 | } else { |
150 | length = | 150 | length = |
151 | sprintf(buf, | 151 | sprintf(buf, |
152 | "\n%d) Name: %s Domain: %s Mounts: %d OS: %s \n\tNOS: %s\tCapability: 0x%x\n\tSMB session status: %d\t", | 152 | "\n%d) Name: %s Domain: %s Mounts: %d OS:" |
153 | " %s \n\tNOS: %s\tCapability: 0x%x\n\tSMB" | ||
154 | " session status: %d\t", | ||
153 | i, ses->serverName, ses->serverDomain, | 155 | i, ses->serverName, ses->serverDomain, |
154 | atomic_read(&ses->inUse), | 156 | atomic_read(&ses->inUse), |
155 | ses->serverOS, ses->serverNOS, | 157 | ses->serverOS, ses->serverNOS, |
156 | ses->capabilities,ses->status); | 158 | ses->capabilities, ses->status); |
157 | buf += length; | 159 | buf += length; |
158 | } | 160 | } |
159 | if(ses->server) { | 161 | if (ses->server) { |
160 | buf += sprintf(buf, "TCP status: %d\n\tLocal Users To Server: %d SecMode: 0x%x Req On Wire: %d", | 162 | buf += sprintf(buf, "TCP status: %d\n\tLocal Users To " |
163 | "Server: %d SecMode: 0x%x Req On Wire: %d", | ||
161 | ses->server->tcpStatus, | 164 | ses->server->tcpStatus, |
162 | atomic_read(&ses->server->socketUseCount), | 165 | atomic_read(&ses->server->socketUseCount), |
163 | ses->server->secMode, | 166 | ses->server->secMode, |
@@ -165,7 +168,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
165 | 168 | ||
166 | #ifdef CONFIG_CIFS_STATS2 | 169 | #ifdef CONFIG_CIFS_STATS2 |
167 | buf += sprintf(buf, " In Send: %d In MaxReq Wait: %d", | 170 | buf += sprintf(buf, " In Send: %d In MaxReq Wait: %d", |
168 | atomic_read(&ses->server->inSend), | 171 | atomic_read(&ses->server->inSend), |
169 | atomic_read(&ses->server->num_waiters)); | 172 | atomic_read(&ses->server->num_waiters)); |
170 | #endif | 173 | #endif |
171 | 174 | ||
@@ -177,17 +180,19 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
177 | mid_entry = list_entry(tmp1, struct | 180 | mid_entry = list_entry(tmp1, struct |
178 | mid_q_entry, | 181 | mid_q_entry, |
179 | qhead); | 182 | qhead); |
180 | if(mid_entry) { | 183 | if (mid_entry) { |
181 | length = sprintf(buf,"State: %d com: %d pid: %d tsk: %p mid %d\n", | 184 | length = sprintf(buf, |
182 | mid_entry->midState, | 185 | "State: %d com: %d pid:" |
183 | (int)mid_entry->command, | 186 | " %d tsk: %p mid %d\n", |
184 | mid_entry->pid, | 187 | mid_entry->midState, |
185 | mid_entry->tsk, | 188 | (int)mid_entry->command, |
186 | mid_entry->mid); | 189 | mid_entry->pid, |
190 | mid_entry->tsk, | ||
191 | mid_entry->mid); | ||
187 | buf += length; | 192 | buf += length; |
188 | } | 193 | } |
189 | } | 194 | } |
190 | spin_unlock(&GlobalMid_Lock); | 195 | spin_unlock(&GlobalMid_Lock); |
191 | } | 196 | } |
192 | 197 | ||
193 | } | 198 | } |
@@ -207,7 +212,8 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
207 | dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType); | 212 | dev_type = le32_to_cpu(tcon->fsDevInfo.DeviceType); |
208 | length = | 213 | length = |
209 | sprintf(buf, | 214 | sprintf(buf, |
210 | "\n%d) %s Uses: %d Type: %s DevInfo: 0x%x Attributes: 0x%x\nPathComponentMax: %d Status: %d", | 215 | "\n%d) %s Uses: %d Type: %s DevInfo: 0x%x " |
216 | "Attributes: 0x%x\nPathComponentMax: %d Status: %d", | ||
211 | i, tcon->treeName, | 217 | i, tcon->treeName, |
212 | atomic_read(&tcon->useCount), | 218 | atomic_read(&tcon->useCount), |
213 | tcon->nativeFileSystem, | 219 | tcon->nativeFileSystem, |
@@ -215,7 +221,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
215 | le32_to_cpu(tcon->fsAttrInfo.Attributes), | 221 | le32_to_cpu(tcon->fsAttrInfo.Attributes), |
216 | le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength), | 222 | le32_to_cpu(tcon->fsAttrInfo.MaxPathNameComponentLength), |
217 | tcon->tidStatus); | 223 | tcon->tidStatus); |
218 | buf += length; | 224 | buf += length; |
219 | if (dev_type == FILE_DEVICE_DISK) | 225 | if (dev_type == FILE_DEVICE_DISK) |
220 | length = sprintf(buf, " type: DISK "); | 226 | length = sprintf(buf, " type: DISK "); |
221 | else if (dev_type == FILE_DEVICE_CD_ROM) | 227 | else if (dev_type == FILE_DEVICE_CD_ROM) |
@@ -224,7 +230,7 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
224 | length = | 230 | length = |
225 | sprintf(buf, " type: %d ", dev_type); | 231 | sprintf(buf, " type: %d ", dev_type); |
226 | buf += length; | 232 | buf += length; |
227 | if(tcon->tidStatus == CifsNeedReconnect) { | 233 | if (tcon->tidStatus == CifsNeedReconnect) { |
228 | buf += sprintf(buf, "\tDISCONNECTED "); | 234 | buf += sprintf(buf, "\tDISCONNECTED "); |
229 | length += 14; | 235 | length += 14; |
230 | } | 236 | } |
@@ -238,9 +244,9 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
238 | /* Now calculate total size of returned data */ | 244 | /* Now calculate total size of returned data */ |
239 | length = buf - original_buf; | 245 | length = buf - original_buf; |
240 | 246 | ||
241 | if(offset + count >= length) | 247 | if (offset + count >= length) |
242 | *eof = 1; | 248 | *eof = 1; |
243 | if(length < offset) { | 249 | if (length < offset) { |
244 | *eof = 1; | 250 | *eof = 1; |
245 | return 0; | 251 | return 0; |
246 | } else { | 252 | } else { |
@@ -256,18 +262,18 @@ cifs_debug_data_read(char *buf, char **beginBuffer, off_t offset, | |||
256 | 262 | ||
257 | static int | 263 | static int |
258 | cifs_stats_write(struct file *file, const char __user *buffer, | 264 | cifs_stats_write(struct file *file, const char __user *buffer, |
259 | unsigned long count, void *data) | 265 | unsigned long count, void *data) |
260 | { | 266 | { |
261 | char c; | 267 | char c; |
262 | int rc; | 268 | int rc; |
263 | struct list_head *tmp; | 269 | struct list_head *tmp; |
264 | struct cifsTconInfo *tcon; | 270 | struct cifsTconInfo *tcon; |
265 | 271 | ||
266 | rc = get_user(c, buffer); | 272 | rc = get_user(c, buffer); |
267 | if (rc) | 273 | if (rc) |
268 | return rc; | 274 | return rc; |
269 | 275 | ||
270 | if (c == '1' || c == 'y' || c == 'Y' || c == '0') { | 276 | if (c == '1' || c == 'y' || c == 'Y' || c == '0') { |
271 | read_lock(&GlobalSMBSeslock); | 277 | read_lock(&GlobalSMBSeslock); |
272 | #ifdef CONFIG_CIFS_STATS2 | 278 | #ifdef CONFIG_CIFS_STATS2 |
273 | atomic_set(&totBufAllocCount, 0); | 279 | atomic_set(&totBufAllocCount, 0); |
@@ -297,14 +303,14 @@ cifs_stats_write(struct file *file, const char __user *buffer, | |||
297 | read_unlock(&GlobalSMBSeslock); | 303 | read_unlock(&GlobalSMBSeslock); |
298 | } | 304 | } |
299 | 305 | ||
300 | return count; | 306 | return count; |
301 | } | 307 | } |
302 | 308 | ||
303 | static int | 309 | static int |
304 | cifs_stats_read(char *buf, char **beginBuffer, off_t offset, | 310 | cifs_stats_read(char *buf, char **beginBuffer, off_t offset, |
305 | int count, int *eof, void *data) | 311 | int count, int *eof, void *data) |
306 | { | 312 | { |
307 | int item_length,i,length; | 313 | int item_length, i, length; |
308 | struct list_head *tmp; | 314 | struct list_head *tmp; |
309 | struct cifsTconInfo *tcon; | 315 | struct cifsTconInfo *tcon; |
310 | 316 | ||
@@ -314,44 +320,44 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, | |||
314 | "Resources in use\nCIFS Session: %d\n", | 320 | "Resources in use\nCIFS Session: %d\n", |
315 | sesInfoAllocCount.counter); | 321 | sesInfoAllocCount.counter); |
316 | buf += length; | 322 | buf += length; |
317 | item_length = | 323 | item_length = |
318 | sprintf(buf,"Share (unique mount targets): %d\n", | 324 | sprintf(buf, "Share (unique mount targets): %d\n", |
319 | tconInfoAllocCount.counter); | 325 | tconInfoAllocCount.counter); |
320 | length += item_length; | 326 | length += item_length; |
321 | buf += item_length; | 327 | buf += item_length; |
322 | item_length = | 328 | item_length = |
323 | sprintf(buf,"SMB Request/Response Buffer: %d Pool size: %d\n", | 329 | sprintf(buf, "SMB Request/Response Buffer: %d Pool size: %d\n", |
324 | bufAllocCount.counter, | 330 | bufAllocCount.counter, |
325 | cifs_min_rcv + tcpSesAllocCount.counter); | 331 | cifs_min_rcv + tcpSesAllocCount.counter); |
326 | length += item_length; | 332 | length += item_length; |
327 | buf += item_length; | 333 | buf += item_length; |
328 | item_length = | 334 | item_length = |
329 | sprintf(buf,"SMB Small Req/Resp Buffer: %d Pool size: %d\n", | 335 | sprintf(buf, "SMB Small Req/Resp Buffer: %d Pool size: %d\n", |
330 | smBufAllocCount.counter,cifs_min_small); | 336 | smBufAllocCount.counter, cifs_min_small); |
331 | length += item_length; | 337 | length += item_length; |
332 | buf += item_length; | 338 | buf += item_length; |
333 | #ifdef CONFIG_CIFS_STATS2 | 339 | #ifdef CONFIG_CIFS_STATS2 |
334 | item_length = sprintf(buf, "Total Large %d Small %d Allocations\n", | 340 | item_length = sprintf(buf, "Total Large %d Small %d Allocations\n", |
335 | atomic_read(&totBufAllocCount), | 341 | atomic_read(&totBufAllocCount), |
336 | atomic_read(&totSmBufAllocCount)); | 342 | atomic_read(&totSmBufAllocCount)); |
337 | length += item_length; | 343 | length += item_length; |
338 | buf += item_length; | 344 | buf += item_length; |
339 | #endif /* CONFIG_CIFS_STATS2 */ | 345 | #endif /* CONFIG_CIFS_STATS2 */ |
340 | 346 | ||
341 | item_length = | 347 | item_length = |
342 | sprintf(buf,"Operations (MIDs): %d\n", | 348 | sprintf(buf, "Operations (MIDs): %d\n", |
343 | midCount.counter); | 349 | midCount.counter); |
344 | length += item_length; | 350 | length += item_length; |
345 | buf += item_length; | 351 | buf += item_length; |
346 | item_length = sprintf(buf, | 352 | item_length = sprintf(buf, |
347 | "\n%d session %d share reconnects\n", | 353 | "\n%d session %d share reconnects\n", |
348 | tcpSesReconnectCount.counter,tconInfoReconnectCount.counter); | 354 | tcpSesReconnectCount.counter, tconInfoReconnectCount.counter); |
349 | length += item_length; | 355 | length += item_length; |
350 | buf += item_length; | 356 | buf += item_length; |
351 | 357 | ||
352 | item_length = sprintf(buf, | 358 | item_length = sprintf(buf, |
353 | "Total vfs operations: %d maximum at one time: %d\n", | 359 | "Total vfs operations: %d maximum at one time: %d\n", |
354 | GlobalCurrentXid,GlobalMaxActiveXid); | 360 | GlobalCurrentXid, GlobalMaxActiveXid); |
355 | length += item_length; | 361 | length += item_length; |
356 | buf += item_length; | 362 | buf += item_length; |
357 | 363 | ||
@@ -360,10 +366,10 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, | |||
360 | list_for_each(tmp, &GlobalTreeConnectionList) { | 366 | list_for_each(tmp, &GlobalTreeConnectionList) { |
361 | i++; | 367 | i++; |
362 | tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); | 368 | tcon = list_entry(tmp, struct cifsTconInfo, cifsConnectionList); |
363 | item_length = sprintf(buf,"\n%d) %s",i, tcon->treeName); | 369 | item_length = sprintf(buf, "\n%d) %s", i, tcon->treeName); |
364 | buf += item_length; | 370 | buf += item_length; |
365 | length += item_length; | 371 | length += item_length; |
366 | if(tcon->tidStatus == CifsNeedReconnect) { | 372 | if (tcon->tidStatus == CifsNeedReconnect) { |
367 | buf += sprintf(buf, "\tDISCONNECTED "); | 373 | buf += sprintf(buf, "\tDISCONNECTED "); |
368 | length += 14; | 374 | length += 14; |
369 | } | 375 | } |
@@ -380,15 +386,15 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, | |||
380 | item_length = sprintf(buf, "\nWrites: %d Bytes: %lld", | 386 | item_length = sprintf(buf, "\nWrites: %d Bytes: %lld", |
381 | atomic_read(&tcon->num_writes), | 387 | atomic_read(&tcon->num_writes), |
382 | (long long)(tcon->bytes_written)); | 388 | (long long)(tcon->bytes_written)); |
383 | buf += item_length; | 389 | buf += item_length; |
384 | length += item_length; | 390 | length += item_length; |
385 | item_length = sprintf(buf, | 391 | item_length = sprintf(buf, |
386 | "\nLocks: %d HardLinks: %d Symlinks: %d", | 392 | "\nLocks: %d HardLinks: %d Symlinks: %d", |
387 | atomic_read(&tcon->num_locks), | 393 | atomic_read(&tcon->num_locks), |
388 | atomic_read(&tcon->num_hardlinks), | 394 | atomic_read(&tcon->num_hardlinks), |
389 | atomic_read(&tcon->num_symlinks)); | 395 | atomic_read(&tcon->num_symlinks)); |
390 | buf += item_length; | 396 | buf += item_length; |
391 | length += item_length; | 397 | length += item_length; |
392 | 398 | ||
393 | item_length = sprintf(buf, "\nOpens: %d Closes: %d Deletes: %d", | 399 | item_length = sprintf(buf, "\nOpens: %d Closes: %d Deletes: %d", |
394 | atomic_read(&tcon->num_opens), | 400 | atomic_read(&tcon->num_opens), |
@@ -415,12 +421,12 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, | |||
415 | } | 421 | } |
416 | read_unlock(&GlobalSMBSeslock); | 422 | read_unlock(&GlobalSMBSeslock); |
417 | 423 | ||
418 | buf += sprintf(buf,"\n"); | 424 | buf += sprintf(buf, "\n"); |
419 | length++; | 425 | length++; |
420 | 426 | ||
421 | if(offset + count >= length) | 427 | if (offset + count >= length) |
422 | *eof = 1; | 428 | *eof = 1; |
423 | if(length < offset) { | 429 | if (length < offset) { |
424 | *eof = 1; | 430 | *eof = 1; |
425 | return 0; | 431 | return 0; |
426 | } else { | 432 | } else { |
@@ -428,7 +434,7 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, | |||
428 | } | 434 | } |
429 | if (length > count) | 435 | if (length > count) |
430 | length = count; | 436 | length = count; |
431 | 437 | ||
432 | return length; | 438 | return length; |
433 | } | 439 | } |
434 | #endif | 440 | #endif |
@@ -547,11 +553,11 @@ cifs_proc_clean(void) | |||
547 | remove_proc_entry("MultiuserMount", proc_fs_cifs); | 553 | remove_proc_entry("MultiuserMount", proc_fs_cifs); |
548 | remove_proc_entry("OplockEnabled", proc_fs_cifs); | 554 | remove_proc_entry("OplockEnabled", proc_fs_cifs); |
549 | /* remove_proc_entry("NTLMV2Enabled",proc_fs_cifs); */ | 555 | /* remove_proc_entry("NTLMV2Enabled",proc_fs_cifs); */ |
550 | remove_proc_entry("SecurityFlags",proc_fs_cifs); | 556 | remove_proc_entry("SecurityFlags", proc_fs_cifs); |
551 | /* remove_proc_entry("PacketSigningEnabled",proc_fs_cifs); */ | 557 | /* remove_proc_entry("PacketSigningEnabled", proc_fs_cifs); */ |
552 | remove_proc_entry("LinuxExtensionsEnabled",proc_fs_cifs); | 558 | remove_proc_entry("LinuxExtensionsEnabled", proc_fs_cifs); |
553 | remove_proc_entry("Experimental",proc_fs_cifs); | 559 | remove_proc_entry("Experimental", proc_fs_cifs); |
554 | remove_proc_entry("LookupCacheEnabled",proc_fs_cifs); | 560 | remove_proc_entry("LookupCacheEnabled", proc_fs_cifs); |
555 | remove_proc_entry("cifs", proc_root_fs); | 561 | remove_proc_entry("cifs", proc_root_fs); |
556 | } | 562 | } |
557 | 563 | ||
@@ -590,7 +596,7 @@ cifsFYI_write(struct file *file, const char __user *buffer, | |||
590 | cifsFYI = 0; | 596 | cifsFYI = 0; |
591 | else if (c == '1' || c == 'y' || c == 'Y') | 597 | else if (c == '1' || c == 'y' || c == 'Y') |
592 | cifsFYI = 1; | 598 | cifsFYI = 1; |
593 | else if((c > '1') && (c <= '9')) | 599 | else if ((c > '1') && (c <= '9')) |
594 | cifsFYI = (int) (c - '0'); /* see cifs_debug.h for meanings */ | 600 | cifsFYI = (int) (c - '0'); /* see cifs_debug.h for meanings */ |
595 | 601 | ||
596 | return count; | 602 | return count; |
@@ -637,28 +643,28 @@ oplockEnabled_write(struct file *file, const char __user *buffer, | |||
637 | 643 | ||
638 | static int | 644 | static int |
639 | experimEnabled_read(char *page, char **start, off_t off, | 645 | experimEnabled_read(char *page, char **start, off_t off, |
640 | int count, int *eof, void *data) | 646 | int count, int *eof, void *data) |
641 | { | 647 | { |
642 | int len; | 648 | int len; |
643 | 649 | ||
644 | len = sprintf(page, "%d\n", experimEnabled); | 650 | len = sprintf(page, "%d\n", experimEnabled); |
645 | 651 | ||
646 | len -= off; | 652 | len -= off; |
647 | *start = page + off; | 653 | *start = page + off; |
648 | 654 | ||
649 | if (len > count) | 655 | if (len > count) |
650 | len = count; | 656 | len = count; |
651 | else | 657 | else |
652 | *eof = 1; | 658 | *eof = 1; |
653 | 659 | ||
654 | if (len < 0) | 660 | if (len < 0) |
655 | len = 0; | 661 | len = 0; |
656 | 662 | ||
657 | return len; | 663 | return len; |
658 | } | 664 | } |
659 | static int | 665 | static int |
660 | experimEnabled_write(struct file *file, const char __user *buffer, | 666 | experimEnabled_write(struct file *file, const char __user *buffer, |
661 | unsigned long count, void *data) | 667 | unsigned long count, void *data) |
662 | { | 668 | { |
663 | char c; | 669 | char c; |
664 | int rc; | 670 | int rc; |
@@ -678,46 +684,46 @@ experimEnabled_write(struct file *file, const char __user *buffer, | |||
678 | 684 | ||
679 | static int | 685 | static int |
680 | linuxExtensionsEnabled_read(char *page, char **start, off_t off, | 686 | linuxExtensionsEnabled_read(char *page, char **start, off_t off, |
681 | int count, int *eof, void *data) | 687 | int count, int *eof, void *data) |
682 | { | 688 | { |
683 | int len; | 689 | int len; |
684 | 690 | ||
685 | len = sprintf(page, "%d\n", linuxExtEnabled); | 691 | len = sprintf(page, "%d\n", linuxExtEnabled); |
686 | len -= off; | 692 | len -= off; |
687 | *start = page + off; | 693 | *start = page + off; |
688 | 694 | ||
689 | if (len > count) | 695 | if (len > count) |
690 | len = count; | 696 | len = count; |
691 | else | 697 | else |
692 | *eof = 1; | 698 | *eof = 1; |
693 | 699 | ||
694 | if (len < 0) | 700 | if (len < 0) |
695 | len = 0; | 701 | len = 0; |
696 | 702 | ||
697 | return len; | 703 | return len; |
698 | } | 704 | } |
699 | static int | 705 | static int |
700 | linuxExtensionsEnabled_write(struct file *file, const char __user *buffer, | 706 | linuxExtensionsEnabled_write(struct file *file, const char __user *buffer, |
701 | unsigned long count, void *data) | 707 | unsigned long count, void *data) |
702 | { | 708 | { |
703 | char c; | 709 | char c; |
704 | int rc; | 710 | int rc; |
705 | 711 | ||
706 | rc = get_user(c, buffer); | 712 | rc = get_user(c, buffer); |
707 | if (rc) | 713 | if (rc) |
708 | return rc; | 714 | return rc; |
709 | if (c == '0' || c == 'n' || c == 'N') | 715 | if (c == '0' || c == 'n' || c == 'N') |
710 | linuxExtEnabled = 0; | 716 | linuxExtEnabled = 0; |
711 | else if (c == '1' || c == 'y' || c == 'Y') | 717 | else if (c == '1' || c == 'y' || c == 'Y') |
712 | linuxExtEnabled = 1; | 718 | linuxExtEnabled = 1; |
713 | 719 | ||
714 | return count; | 720 | return count; |
715 | } | 721 | } |
716 | 722 | ||
717 | 723 | ||
718 | static int | 724 | static int |
719 | lookupFlag_read(char *page, char **start, off_t off, | 725 | lookupFlag_read(char *page, char **start, off_t off, |
720 | int count, int *eof, void *data) | 726 | int count, int *eof, void *data) |
721 | { | 727 | { |
722 | int len; | 728 | int len; |
723 | 729 | ||
@@ -860,15 +866,15 @@ security_flags_write(struct file *file, const char __user *buffer, | |||
860 | char flags_string[12]; | 866 | char flags_string[12]; |
861 | char c; | 867 | char c; |
862 | 868 | ||
863 | if((count < 1) || (count > 11)) | 869 | if ((count < 1) || (count > 11)) |
864 | return -EINVAL; | 870 | return -EINVAL; |
865 | 871 | ||
866 | memset(flags_string, 0, 12); | 872 | memset(flags_string, 0, 12); |
867 | 873 | ||
868 | if(copy_from_user(flags_string, buffer, count)) | 874 | if (copy_from_user(flags_string, buffer, count)) |
869 | return -EFAULT; | 875 | return -EFAULT; |
870 | 876 | ||
871 | if(count < 3) { | 877 | if (count < 3) { |
872 | /* single char or single char followed by null */ | 878 | /* single char or single char followed by null */ |
873 | c = flags_string[0]; | 879 | c = flags_string[0]; |
874 | if (c == '0' || c == 'n' || c == 'N') | 880 | if (c == '0' || c == 'n' || c == 'N') |
@@ -881,15 +887,15 @@ security_flags_write(struct file *file, const char __user *buffer, | |||
881 | 887 | ||
882 | flags = simple_strtoul(flags_string, NULL, 0); | 888 | flags = simple_strtoul(flags_string, NULL, 0); |
883 | 889 | ||
884 | cFYI(1,("sec flags 0x%x", flags)); | 890 | cFYI(1, ("sec flags 0x%x", flags)); |
885 | 891 | ||
886 | if(flags <= 0) { | 892 | if (flags <= 0) { |
887 | cERROR(1,("invalid security flags %s",flags_string)); | 893 | cERROR(1, ("invalid security flags %s", flags_string)); |
888 | return -EINVAL; | 894 | return -EINVAL; |
889 | } | 895 | } |
890 | 896 | ||
891 | if(flags & ~CIFSSEC_MASK) { | 897 | if (flags & ~CIFSSEC_MASK) { |
892 | cERROR(1,("attempt to set unsupported security flags 0x%x", | 898 | cERROR(1, ("attempt to set unsupported security flags 0x%x", |
893 | flags & ~CIFSSEC_MASK)); | 899 | flags & ~CIFSSEC_MASK)); |
894 | return -EINVAL; | 900 | return -EINVAL; |
895 | } | 901 | } |
diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c index 793c4b95c164..701e9a9185f2 100644 --- a/fs/cifs/cifs_unicode.c +++ b/fs/cifs/cifs_unicode.c | |||
@@ -6,16 +6,16 @@ | |||
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
9 | * the Free Software Foundation; either version 2 of the License, or | 9 | * the Free Software Foundation; either version 2 of the License, or |
10 | * (at your option) any later version. | 10 | * (at your option) any later version. |
11 | * | 11 | * |
12 | * This program is distributed in the hope that it will be useful, | 12 | * This program is distributed in the hope that it will be useful, |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See |
15 | * the GNU General Public License for more details. | 15 | * the GNU General Public License for more details. |
16 | * | 16 | * |
17 | * You should have received a copy of the GNU General Public License | 17 | * You should have received a copy of the GNU General Public License |
18 | * along with this program; if not, write to the Free Software | 18 | * along with this program; if not, write to the Free Software |
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 | */ | 20 | */ |
21 | #include <linux/fs.h> | 21 | #include <linux/fs.h> |
@@ -32,7 +32,7 @@ | |||
32 | * | 32 | * |
33 | */ | 33 | */ |
34 | int | 34 | int |
35 | cifs_strfromUCS_le(char *to, const __le16 * from, | 35 | cifs_strfromUCS_le(char *to, const __le16 * from, |
36 | int len, const struct nls_table *codepage) | 36 | int len, const struct nls_table *codepage) |
37 | { | 37 | { |
38 | int i; | 38 | int i; |
@@ -66,7 +66,7 @@ cifs_strtoUCS(__le16 * to, const char *from, int len, | |||
66 | { | 66 | { |
67 | int charlen; | 67 | int charlen; |
68 | int i; | 68 | int i; |
69 | wchar_t * wchar_to = (wchar_t *)to; /* needed to quiet sparse */ | 69 | wchar_t * wchar_to = (wchar_t *)to; /* needed to quiet sparse */ |
70 | 70 | ||
71 | for (i = 0; len && *from; i++, from += charlen, len -= charlen) { | 71 | for (i = 0; len && *from; i++, from += charlen, len -= charlen) { |
72 | 72 | ||
@@ -79,7 +79,7 @@ cifs_strtoUCS(__le16 * to, const char *from, int len, | |||
79 | /* A question mark */ | 79 | /* A question mark */ |
80 | to[i] = cpu_to_le16(0x003f); | 80 | to[i] = cpu_to_le16(0x003f); |
81 | charlen = 1; | 81 | charlen = 1; |
82 | } else | 82 | } else |
83 | to[i] = cpu_to_le16(wchar_to[i]); | 83 | to[i] = cpu_to_le16(wchar_to[i]); |
84 | 84 | ||
85 | } | 85 | } |
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index eeab602c6e0a..f085db965788 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -269,7 +269,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
269 | } else if (newinode) { | 269 | } else if (newinode) { |
270 | pCifsFile = | 270 | pCifsFile = |
271 | kzalloc(sizeof (struct cifsFileInfo), GFP_KERNEL); | 271 | kzalloc(sizeof (struct cifsFileInfo), GFP_KERNEL); |
272 | 272 | ||
273 | if (pCifsFile == NULL) | 273 | if (pCifsFile == NULL) |
274 | goto cifs_create_out; | 274 | goto cifs_create_out; |
275 | pCifsFile->netfid = fileHandle; | 275 | pCifsFile->netfid = fileHandle; |
@@ -299,7 +299,7 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
299 | if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { | 299 | if ((oplock & 0xF) == OPLOCK_EXCLUSIVE) { |
300 | pCifsInode->clientCanCacheAll = TRUE; | 300 | pCifsInode->clientCanCacheAll = TRUE; |
301 | pCifsInode->clientCanCacheRead = TRUE; | 301 | pCifsInode->clientCanCacheRead = TRUE; |
302 | cFYI(1,("Exclusive Oplock for inode %p", | 302 | cFYI(1, ("Exclusive Oplock inode %p", |
303 | newinode)); | 303 | newinode)); |
304 | } else if ((oplock & 0xF) == OPLOCK_READ) | 304 | } else if ((oplock & 0xF) == OPLOCK_READ) |
305 | pCifsInode->clientCanCacheRead = TRUE; | 305 | pCifsInode->clientCanCacheRead = TRUE; |
@@ -517,7 +517,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, | |||
517 | /* if it was once a directory (but how can we tell?) we could do | 517 | /* if it was once a directory (but how can we tell?) we could do |
518 | shrink_dcache_parent(direntry); */ | 518 | shrink_dcache_parent(direntry); */ |
519 | } else { | 519 | } else { |
520 | cERROR(1,("Error 0x%x on cifs_get_inode_info in lookup of %s", | 520 | cERROR(1, ("Error 0x%x on cifs_get_inode_info in lookup of %s", |
521 | rc, full_path)); | 521 | rc, full_path)); |
522 | /* BB special case check for Access Denied - watch security | 522 | /* BB special case check for Access Denied - watch security |
523 | exposure of returning dir info implicitly via different rc | 523 | exposure of returning dir info implicitly via different rc |