aboutsummaryrefslogtreecommitdiffstats
path: root/fs/smbfs/inode.c
diff options
context:
space:
mode:
authorDave Kleikamp <shaggy@austin.ibm.com>2006-01-24 15:34:47 -0500
committerDave Kleikamp <shaggy@austin.ibm.com>2006-01-24 15:34:47 -0500
commit0a0fc0ddbe732779366ab6b1b879f62195e65967 (patch)
tree7b42490a676cf39ae0691b6859ecf7fd410f229b /fs/smbfs/inode.c
parent4d5dbd0945d9e0833dd7964a3d6ee33157f7cc7a (diff)
parent3ee68c4af3fd7228c1be63254b9f884614f9ebb2 (diff)
Merge with /home/shaggy/git/linus-clean/
Diffstat (limited to 'fs/smbfs/inode.c')
-rw-r--r--fs/smbfs/inode.c35
1 files changed, 8 insertions, 27 deletions
diff --git a/fs/smbfs/inode.c b/fs/smbfs/inode.c
index 10b994428fef..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
497static int smb_fill_super(struct super_block *sb, void *raw_data, int silent) 497static 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:
621out_no_smbiod: 620out_no_smbiod:
622 smb_unload_nls(server); 621 smb_unload_nls(server);
623out_bad_option: 622out_bad_option:
624 smb_kfree(mem); 623 kfree(mem);
625out_no_mem: 624out_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;
631out_wrong_data: 630out_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);
@@ -697,8 +696,7 @@ smb_notify_change(struct dentry *dentry, struct iattr *attr)
697 DENTRY_PATH(dentry), 696 DENTRY_PATH(dentry),
698 (long) inode->i_size, (long) attr->ia_size); 697 (long) inode->i_size, (long) attr->ia_size);
699 698
700 filemap_fdatawrite(inode->i_mapping); 699 filemap_write_and_wait(inode->i_mapping);
701 filemap_fdatawait(inode->i_mapping);
702 700
703 error = smb_open(dentry, O_WRONLY); 701 error = smb_open(dentry, O_WRONLY);
704 if (error) 702 if (error)
@@ -783,12 +781,6 @@ out:
783 return error; 781 return error;
784} 782}
785 783
786#ifdef DEBUG_SMB_MALLOC
787int smb_malloced;
788int smb_current_kmalloced;
789int smb_current_vmalloced;
790#endif
791
792static struct super_block *smb_get_sb(struct file_system_type *fs_type, 784static struct super_block *smb_get_sb(struct file_system_type *fs_type,
793 int flags, const char *dev_name, void *data) 785 int flags, const char *dev_name, void *data)
794{ 786{
@@ -808,12 +800,6 @@ static int __init init_smb_fs(void)
808 int err; 800 int err;
809 DEBUG1("registering ...\n"); 801 DEBUG1("registering ...\n");
810 802
811#ifdef DEBUG_SMB_MALLOC
812 smb_malloced = 0;
813 smb_current_kmalloced = 0;
814 smb_current_vmalloced = 0;
815#endif
816
817 err = init_inodecache(); 803 err = init_inodecache();
818 if (err) 804 if (err)
819 goto out_inode; 805 goto out_inode;
@@ -838,11 +824,6 @@ static void __exit exit_smb_fs(void)
838 unregister_filesystem(&smb_fs_type); 824 unregister_filesystem(&smb_fs_type);
839 smb_destroy_request_cache(); 825 smb_destroy_request_cache();
840 destroy_inodecache(); 826 destroy_inodecache();
841#ifdef DEBUG_SMB_MALLOC
842 printk(KERN_DEBUG "smb_malloced: %d\n", smb_malloced);
843 printk(KERN_DEBUG "smb_current_kmalloced: %d\n",smb_current_kmalloced);
844 printk(KERN_DEBUG "smb_current_vmalloced: %d\n",smb_current_vmalloced);
845#endif
846} 827}
847 828
848module_init(init_smb_fs) 829module_init(init_smb_fs)