ext3: Don't update superblock write time when filesystem is read-only
[safe/jmp/linux-2.6] / fs / smbfs / inode.c
index 424a3dd..1c4c8f0 100644 (file)
@@ -25,6 +25,7 @@
 #include <linux/net.h>
 #include <linux/vfs.h>
 #include <linux/highuid.h>
+#include <linux/sched.h>
 #include <linux/smb_fs.h>
 #include <linux/smbno.h>
 #include <linux/smb_mount.h>
@@ -66,21 +67,20 @@ static void smb_destroy_inode(struct inode *inode)
        kmem_cache_free(smb_inode_cachep, SMB_I(inode));
 }
 
-static void init_once(void * foo, struct kmem_cache * cachep, unsigned long flags)
+static void init_once(void *foo)
 {
        struct smb_inode_info *ei = (struct smb_inode_info *) foo;
 
-       if (flags & SLAB_CTOR_CONSTRUCTOR)
-               inode_init_once(&ei->vfs_inode);
+       inode_init_once(&ei->vfs_inode);
 }
+
 static int init_inodecache(void)
 {
        smb_inode_cachep = kmem_cache_create("smb_inode_cache",
                                             sizeof(struct smb_inode_info),
                                             0, (SLAB_RECLAIM_ACCOUNT|
                                                SLAB_MEM_SPREAD),
-                                            init_once, NULL);
+                                            init_once);
        if (smb_inode_cachep == NULL)
                return -ENOMEM;
        return 0;
@@ -459,14 +459,8 @@ smb_show_options(struct seq_file *s, struct vfsmount *m)
 static void
 smb_unload_nls(struct smb_sb_info *server)
 {
-       if (server->remote_nls) {
-               unload_nls(server->remote_nls);
-               server->remote_nls = NULL;
-       }
-       if (server->local_nls) {
-               unload_nls(server->local_nls);
-               server->local_nls = NULL;
-       }
+       unload_nls(server->remote_nls);
+       unload_nls(server->local_nls);
 }
 
 static void
@@ -474,6 +468,8 @@ smb_put_super(struct super_block *sb)
 {
        struct smb_sb_info *server = SMB_SB(sb);
 
+       lock_kernel();
+
        smb_lock_server(server);
        server->state = CONN_INVALID;
        smbiod_unregister_server(server);
@@ -489,6 +485,8 @@ smb_put_super(struct super_block *sb)
        smb_unlock_server(server);
        put_pid(server->conn_pid);
        kfree(server);
+
+       unlock_kernel();
 }
 
 static int smb_fill_super(struct super_block *sb, void *raw_data, int silent)
@@ -500,6 +498,13 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent)
        struct smb_fattr root;
        int ver;
        void *mem;
+       static int warn_count;
+
+       if (warn_count < 5) {
+               warn_count++;
+               printk(KERN_EMERG "smbfs is deprecated and will be removed"
+                       " from the 2.6.27 kernel. Please migrate to cifs\n");
+       }
 
        if (!raw_data)
                goto out_no_data;
@@ -536,7 +541,7 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent)
 
        /* Allocate the global temp buffer and some superblock helper structs */
        /* FIXME: move these to the smb_sb_info struct */
-       VERBOSE("alloc chunk = %d\n", sizeof(struct smb_ops) +
+       VERBOSE("alloc chunk = %lu\n", sizeof(struct smb_ops) +
                sizeof(struct smb_mount_data_kernel));
        mem = kmalloc(sizeof(struct smb_ops) +
                      sizeof(struct smb_mount_data_kernel), GFP_KERNEL);
@@ -579,7 +584,7 @@ static int smb_fill_super(struct super_block *sb, void *raw_data, int silent)
                if (parse_options(mnt, raw_data))
                        goto out_bad_option;
        }
-       mnt->mounted_uid = current->uid;
+       mnt->mounted_uid = current_uid();
        smb_setcodepage(server, &mnt->codepage);
 
        /*