diff options
| author | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
|---|---|---|
| committer | Anton Altaparmakov <aia21@cantab.net> | 2006-01-19 11:39:33 -0500 |
| commit | 944d79559d154c12becde0dab327016cf438f46c (patch) | |
| tree | 50c101806f4d3b6585222dda060559eb4f3e005a /fs/cifs/cifs_debug.c | |
| parent | d087e4bdd24ebe3ae3d0b265b6573ec901af4b4b (diff) | |
| parent | 0f36b018b2e314d45af86449f1a97facb1fbe300 (diff) | |
Merge branch 'master' of /usr/src/ntfs-2.6/
Diffstat (limited to 'fs/cifs/cifs_debug.c')
| -rw-r--r-- | fs/cifs/cifs_debug.c | 51 |
1 files changed, 31 insertions, 20 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 22a444a3fe4c..f4124a32bef8 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
| @@ -219,6 +219,10 @@ cifs_stats_write(struct file *file, const char __user *buffer, | |||
| 219 | 219 | ||
| 220 | if (c == '1' || c == 'y' || c == 'Y' || c == '0') { | 220 | if (c == '1' || c == 'y' || c == 'Y' || c == '0') { |
| 221 | read_lock(&GlobalSMBSeslock); | 221 | read_lock(&GlobalSMBSeslock); |
| 222 | #ifdef CONFIG_CIFS_STATS2 | ||
| 223 | atomic_set(&totBufAllocCount, 0); | ||
| 224 | atomic_set(&totSmBufAllocCount, 0); | ||
| 225 | #endif /* CONFIG_CIFS_STATS2 */ | ||
| 222 | list_for_each(tmp, &GlobalTreeConnectionList) { | 226 | list_for_each(tmp, &GlobalTreeConnectionList) { |
| 223 | tcon = list_entry(tmp, struct cifsTconInfo, | 227 | tcon = list_entry(tmp, struct cifsTconInfo, |
| 224 | cifsConnectionList); | 228 | cifsConnectionList); |
| @@ -276,6 +280,14 @@ cifs_stats_read(char *buf, char **beginBuffer, off_t offset, | |||
| 276 | smBufAllocCount.counter,cifs_min_small); | 280 | smBufAllocCount.counter,cifs_min_small); |
| 277 | length += item_length; | 281 | length += item_length; |
| 278 | buf += item_length; | 282 | buf += item_length; |
| 283 | #ifdef CONFIG_CIFS_STATS2 | ||
| 284 | item_length = sprintf(buf, "Total Large %d Small %d Allocations\n", | ||
| 285 | atomic_read(&totBufAllocCount), | ||
| 286 | atomic_read(&totSmBufAllocCount)); | ||
| 287 | length += item_length; | ||
| 288 | buf += item_length; | ||
| 289 | #endif /* CONFIG_CIFS_STATS2 */ | ||
| 290 | |||
| 279 | item_length = | 291 | item_length = |
| 280 | sprintf(buf,"Operations (MIDs): %d\n", | 292 | sprintf(buf,"Operations (MIDs): %d\n", |
| 281 | midCount.counter); | 293 | midCount.counter); |
| @@ -389,8 +401,8 @@ static read_proc_t ntlmv2_enabled_read; | |||
| 389 | static write_proc_t ntlmv2_enabled_write; | 401 | static write_proc_t ntlmv2_enabled_write; |
| 390 | static read_proc_t packet_signing_enabled_read; | 402 | static read_proc_t packet_signing_enabled_read; |
| 391 | static write_proc_t packet_signing_enabled_write; | 403 | static write_proc_t packet_signing_enabled_write; |
| 392 | static read_proc_t quotaEnabled_read; | 404 | static read_proc_t experimEnabled_read; |
| 393 | static write_proc_t quotaEnabled_write; | 405 | static write_proc_t experimEnabled_write; |
| 394 | static read_proc_t linuxExtensionsEnabled_read; | 406 | static read_proc_t linuxExtensionsEnabled_read; |
| 395 | static write_proc_t linuxExtensionsEnabled_write; | 407 | static write_proc_t linuxExtensionsEnabled_write; |
| 396 | 408 | ||
| @@ -430,9 +442,9 @@ cifs_proc_init(void) | |||
| 430 | pde->write_proc = oplockEnabled_write; | 442 | pde->write_proc = oplockEnabled_write; |
| 431 | 443 | ||
| 432 | pde = create_proc_read_entry("Experimental", 0, proc_fs_cifs, | 444 | pde = create_proc_read_entry("Experimental", 0, proc_fs_cifs, |
| 433 | quotaEnabled_read, NULL); | 445 | experimEnabled_read, NULL); |
| 434 | if (pde) | 446 | if (pde) |
| 435 | pde->write_proc = quotaEnabled_write; | 447 | pde->write_proc = experimEnabled_write; |
| 436 | 448 | ||
| 437 | pde = create_proc_read_entry("LinuxExtensionsEnabled", 0, proc_fs_cifs, | 449 | pde = create_proc_read_entry("LinuxExtensionsEnabled", 0, proc_fs_cifs, |
| 438 | linuxExtensionsEnabled_read, NULL); | 450 | linuxExtensionsEnabled_read, NULL); |
| @@ -574,14 +586,13 @@ oplockEnabled_write(struct file *file, const char __user *buffer, | |||
| 574 | } | 586 | } |
| 575 | 587 | ||
| 576 | static int | 588 | static int |
| 577 | quotaEnabled_read(char *page, char **start, off_t off, | 589 | experimEnabled_read(char *page, char **start, off_t off, |
| 578 | int count, int *eof, void *data) | 590 | int count, int *eof, void *data) |
| 579 | { | 591 | { |
| 580 | int len; | 592 | int len; |
| 581 | 593 | ||
| 582 | len = sprintf(page, "%d\n", experimEnabled); | 594 | len = sprintf(page, "%d\n", experimEnabled); |
| 583 | /* could also check if quotas are enabled in kernel | 595 | |
| 584 | as a whole first */ | ||
| 585 | len -= off; | 596 | len -= off; |
| 586 | *start = page + off; | 597 | *start = page + off; |
| 587 | 598 | ||
| @@ -596,21 +607,23 @@ quotaEnabled_read(char *page, char **start, off_t off, | |||
| 596 | return len; | 607 | return len; |
| 597 | } | 608 | } |
| 598 | static int | 609 | static int |
| 599 | quotaEnabled_write(struct file *file, const char __user *buffer, | 610 | experimEnabled_write(struct file *file, const char __user *buffer, |
| 600 | unsigned long count, void *data) | 611 | unsigned long count, void *data) |
| 601 | { | 612 | { |
| 602 | char c; | 613 | char c; |
| 603 | int rc; | 614 | int rc; |
| 604 | 615 | ||
| 605 | rc = get_user(c, buffer); | 616 | rc = get_user(c, buffer); |
| 606 | if (rc) | 617 | if (rc) |
| 607 | return rc; | 618 | return rc; |
| 608 | if (c == '0' || c == 'n' || c == 'N') | 619 | if (c == '0' || c == 'n' || c == 'N') |
| 609 | experimEnabled = 0; | 620 | experimEnabled = 0; |
| 610 | else if (c == '1' || c == 'y' || c == 'Y') | 621 | else if (c == '1' || c == 'y' || c == 'Y') |
| 611 | experimEnabled = 1; | 622 | experimEnabled = 1; |
| 623 | else if (c == '2') | ||
| 624 | experimEnabled = 2; | ||
| 612 | 625 | ||
| 613 | return count; | 626 | return count; |
| 614 | } | 627 | } |
| 615 | 628 | ||
| 616 | static int | 629 | static int |
| @@ -620,8 +633,6 @@ linuxExtensionsEnabled_read(char *page, char **start, off_t off, | |||
| 620 | int len; | 633 | int len; |
| 621 | 634 | ||
| 622 | len = sprintf(page, "%d\n", linuxExtEnabled); | 635 | len = sprintf(page, "%d\n", linuxExtEnabled); |
| 623 | /* could also check if quotas are enabled in kernel | ||
| 624 | as a whole first */ | ||
| 625 | len -= off; | 636 | len -= off; |
| 626 | *start = page + off; | 637 | *start = page + off; |
| 627 | 638 | ||
