diff options
Diffstat (limited to 'fs/smbfs/inode.c')
-rw-r--r-- | fs/smbfs/inode.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c index 6ec88bf59b2d..02e3e82d465c 100644 --- a/fs/smbfs/inode.c +++ b/fs/smbfs/inode.c | |||
@@ -487,11 +487,11 @@ smb_put_super(struct super_block *sb) | |||
487 | if (server->conn_pid) | 487 | if (server->conn_pid) |
488 | kill_proc(server->conn_pid, SIGTERM, 1); | 488 | kill_proc(server->conn_pid, SIGTERM, 1); |
489 | 489 | ||
490 | smb_kfree(server->ops); | 490 | kfree(server->ops); |
491 | smb_unload_nls(server); | 491 | smb_unload_nls(server); |
492 | sb->s_fs_info = NULL; | 492 | sb->s_fs_info = NULL; |
493 | smb_unlock_server(server); | 493 | smb_unlock_server(server); |
494 | smb_kfree(server); | 494 | kfree(server); |
495 | } | 495 | } |
496 | 496 | ||
497 | static int smb_fill_super(struct super_block *sb, void *raw_data, int silent) | 497 | static int smb_fill_super(struct super_block *sb, void *raw_data, int silent) |
@@ -519,11 +519,10 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
519 | sb->s_op = &smb_sops; | 519 | sb->s_op = &smb_sops; |
520 | sb->s_time_gran = 100; | 520 | sb->s_time_gran = 100; |
521 | 521 | ||
522 | server = smb_kmalloc(sizeof(struct smb_sb_info), GFP_KERNEL); | 522 | server = kzalloc(sizeof(struct smb_sb_info), GFP_KERNEL); |
523 | if (!server) | 523 | if (!server) |
524 | goto out_no_server; | 524 | goto out_no_server; |
525 | sb->s_fs_info = server; | 525 | sb->s_fs_info = server; |
526 | memset(server, 0, sizeof(struct smb_sb_info)); | ||
527 | 526 | ||
528 | server->super_block = sb; | 527 | server->super_block = sb; |
529 | server->mnt = NULL; | 528 | server->mnt = NULL; |
@@ -542,8 +541,8 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
542 | /* FIXME: move these to the smb_sb_info struct */ | 541 | /* FIXME: move these to the smb_sb_info struct */ |
543 | VERBOSE("alloc chunk = %d\n", sizeof(struct smb_ops) + | 542 | VERBOSE("alloc chunk = %d\n", sizeof(struct smb_ops) + |
544 | sizeof(struct smb_mount_data_kernel)); | 543 | sizeof(struct smb_mount_data_kernel)); |
545 | mem = smb_kmalloc(sizeof(struct smb_ops) + | 544 | mem = kmalloc(sizeof(struct smb_ops) + |
546 | sizeof(struct smb_mount_data_kernel), GFP_KERNEL); | 545 | sizeof(struct smb_mount_data_kernel), GFP_KERNEL); |
547 | if (!mem) | 546 | if (!mem) |
548 | goto out_no_mem; | 547 | goto out_no_mem; |
549 | 548 | ||
@@ -621,12 +620,12 @@ out_no_root: | |||
621 | out_no_smbiod: | 620 | out_no_smbiod: |
622 | smb_unload_nls(server); | 621 | smb_unload_nls(server); |
623 | out_bad_option: | 622 | out_bad_option: |
624 | smb_kfree(mem); | 623 | kfree(mem); |
625 | out_no_mem: | 624 | out_no_mem: |
626 | if (!server->mnt) | 625 | if (!server->mnt) |
627 | printk(KERN_ERR "smb_fill_super: allocation failure\n"); | 626 | printk(KERN_ERR "smb_fill_super: allocation failure\n"); |
628 | sb->s_fs_info = NULL; | 627 | sb->s_fs_info = NULL; |
629 | smb_kfree(server); | 628 | kfree(server); |
630 | goto out_fail; | 629 | goto out_fail; |
631 | out_wrong_data: | 630 | out_wrong_data: |
632 | printk(KERN_ERR "smbfs: mount_data version %d is not supported\n", ver); | 631 | printk(KERN_ERR "smbfs: mount_data version %d is not supported\n", ver); |
@@ -782,12 +781,6 @@ out: | |||
782 | return error; | 781 | return error; |
783 | } | 782 | } |
784 | 783 | ||
785 | #ifdef DEBUG_SMB_MALLOC | ||
786 | int smb_malloced; | ||
787 | int smb_current_kmalloced; | ||
788 | int smb_current_vmalloced; | ||
789 | #endif | ||
790 | |||
791 | static struct super_block *smb_get_sb(struct file_system_type *fs_type, | 784 | static struct super_block *smb_get_sb(struct file_system_type *fs_type, |
792 | int flags, const char *dev_name, void *data) | 785 | int flags, const char *dev_name, void *data) |
793 | { | 786 | { |
@@ -807,12 +800,6 @@ static int __init init_smb_fs(void) | |||
807 | int err; | 800 | int err; |
808 | DEBUG1("registering ...\n"); | 801 | DEBUG1("registering ...\n"); |
809 | 802 | ||
810 | #ifdef DEBUG_SMB_MALLOC | ||
811 | smb_malloced = 0; | ||
812 | smb_current_kmalloced = 0; | ||
813 | smb_current_vmalloced = 0; | ||
814 | #endif | ||
815 | |||
816 | err = init_inodecache(); | 803 | err = init_inodecache(); |
817 | if (err) | 804 | if (err) |
818 | goto out_inode; | 805 | goto out_inode; |
@@ -837,11 +824,6 @@ static void __exit exit_smb_fs(void) | |||
837 | unregister_filesystem(&smb_fs_type); | 824 | unregister_filesystem(&smb_fs_type); |
838 | smb_destroy_request_cache(); | 825 | smb_destroy_request_cache(); |
839 | destroy_inodecache(); | 826 | destroy_inodecache(); |
840 | #ifdef DEBUG_SMB_MALLOC | ||
841 | printk(KERN_DEBUG "smb_malloced: %d\n", smb_malloced); | ||
842 | printk(KERN_DEBUG "smb_current_kmalloced: %d\n",smb_current_kmalloced); | ||
843 | printk(KERN_DEBUG "smb_current_vmalloced: %d\n",smb_current_vmalloced); | ||
844 | #endif | ||
845 | } | 827 | } |
846 | 828 | ||
847 | module_init(init_smb_fs) | 829 | module_init(init_smb_fs) |