diff options
author | Steve French <sfrench@us.ibm.com> | 2005-12-12 23:53:18 -0500 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2005-12-12 23:53:18 -0500 |
commit | ec637e3ffb6b978143652477c7c5f96c9519b691 (patch) | |
tree | 32533b8f101e1d85b3499050eef29e78480e5cae /fs/cifs/cifs_debug.c | |
parent | c89a86bb96307019867d11874ef0b86adaa0598e (diff) |
[CIFS] Avoid extra large buffer allocation (and memcpy) in cifs_readpages
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifs_debug.c')
-rw-r--r-- | fs/cifs/cifs_debug.c | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c index 6f5d81f5eacb..f4124a32bef8 100644 --- a/fs/cifs/cifs_debug.c +++ b/fs/cifs/cifs_debug.c | |||
@@ -401,8 +401,8 @@ static read_proc_t ntlmv2_enabled_read; | |||
401 | static write_proc_t ntlmv2_enabled_write; | 401 | static write_proc_t ntlmv2_enabled_write; |
402 | static read_proc_t packet_signing_enabled_read; | 402 | static read_proc_t packet_signing_enabled_read; |
403 | static write_proc_t packet_signing_enabled_write; | 403 | static write_proc_t packet_signing_enabled_write; |
404 | static read_proc_t quotaEnabled_read; | 404 | static read_proc_t experimEnabled_read; |
405 | static write_proc_t quotaEnabled_write; | 405 | static write_proc_t experimEnabled_write; |
406 | static read_proc_t linuxExtensionsEnabled_read; | 406 | static read_proc_t linuxExtensionsEnabled_read; |
407 | static write_proc_t linuxExtensionsEnabled_write; | 407 | static write_proc_t linuxExtensionsEnabled_write; |
408 | 408 | ||
@@ -442,9 +442,9 @@ cifs_proc_init(void) | |||
442 | pde->write_proc = oplockEnabled_write; | 442 | pde->write_proc = oplockEnabled_write; |
443 | 443 | ||
444 | pde = create_proc_read_entry("Experimental", 0, proc_fs_cifs, | 444 | pde = create_proc_read_entry("Experimental", 0, proc_fs_cifs, |
445 | quotaEnabled_read, NULL); | 445 | experimEnabled_read, NULL); |
446 | if (pde) | 446 | if (pde) |
447 | pde->write_proc = quotaEnabled_write; | 447 | pde->write_proc = experimEnabled_write; |
448 | 448 | ||
449 | pde = create_proc_read_entry("LinuxExtensionsEnabled", 0, proc_fs_cifs, | 449 | pde = create_proc_read_entry("LinuxExtensionsEnabled", 0, proc_fs_cifs, |
450 | linuxExtensionsEnabled_read, NULL); | 450 | linuxExtensionsEnabled_read, NULL); |
@@ -586,14 +586,13 @@ oplockEnabled_write(struct file *file, const char __user *buffer, | |||
586 | } | 586 | } |
587 | 587 | ||
588 | static int | 588 | static int |
589 | quotaEnabled_read(char *page, char **start, off_t off, | 589 | experimEnabled_read(char *page, char **start, off_t off, |
590 | int count, int *eof, void *data) | 590 | int count, int *eof, void *data) |
591 | { | 591 | { |
592 | int len; | 592 | int len; |
593 | 593 | ||
594 | len = sprintf(page, "%d\n", experimEnabled); | 594 | len = sprintf(page, "%d\n", experimEnabled); |
595 | /* could also check if quotas are enabled in kernel | 595 | |
596 | as a whole first */ | ||
597 | len -= off; | 596 | len -= off; |
598 | *start = page + off; | 597 | *start = page + off; |
599 | 598 | ||
@@ -608,21 +607,23 @@ quotaEnabled_read(char *page, char **start, off_t off, | |||
608 | return len; | 607 | return len; |
609 | } | 608 | } |
610 | static int | 609 | static int |
611 | quotaEnabled_write(struct file *file, const char __user *buffer, | 610 | experimEnabled_write(struct file *file, const char __user *buffer, |
612 | unsigned long count, void *data) | 611 | unsigned long count, void *data) |
613 | { | 612 | { |
614 | char c; | 613 | char c; |
615 | int rc; | 614 | int rc; |
616 | 615 | ||
617 | rc = get_user(c, buffer); | 616 | rc = get_user(c, buffer); |
618 | if (rc) | 617 | if (rc) |
619 | return rc; | 618 | return rc; |
620 | if (c == '0' || c == 'n' || c == 'N') | 619 | if (c == '0' || c == 'n' || c == 'N') |
621 | experimEnabled = 0; | 620 | experimEnabled = 0; |
622 | else if (c == '1' || c == 'y' || c == 'Y') | 621 | else if (c == '1' || c == 'y' || c == 'Y') |
623 | experimEnabled = 1; | 622 | experimEnabled = 1; |
623 | else if (c == '2') | ||
624 | experimEnabled = 2; | ||
624 | 625 | ||
625 | return count; | 626 | return count; |
626 | } | 627 | } |
627 | 628 | ||
628 | static int | 629 | static int |
@@ -632,8 +633,6 @@ linuxExtensionsEnabled_read(char *page, char **start, off_t off, | |||
632 | int len; | 633 | int len; |
633 | 634 | ||
634 | len = sprintf(page, "%d\n", linuxExtEnabled); | 635 | len = sprintf(page, "%d\n", linuxExtEnabled); |
635 | /* could also check if quotas are enabled in kernel | ||
636 | as a whole first */ | ||
637 | len -= off; | 636 | len -= off; |
638 | *start = page + off; | 637 | *start = page + off; |
639 | 638 | ||