Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[pandora-kernel.git] / fs / cifs / cifsfs.c
index cb77915..75c4eaa 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/delay.h>
 #include <linux/kthread.h>
 #include <linux/freezer.h>
-#include <linux/smp_lock.h>
 #include <net/ipv6.h>
 #include "cifsfs.h"
 #include "cifspdu.h"
@@ -219,8 +218,6 @@ cifs_put_super(struct super_block *sb)
                return;
        }
 
-       lock_kernel();
-
        rc = cifs_umount(sb, cifs_sb);
        if (rc)
                cERROR(1, "cifs_umount failed with return code %d", rc);
@@ -234,8 +231,6 @@ cifs_put_super(struct super_block *sb)
        unload_nls(cifs_sb->local_nls);
        bdi_destroy(&cifs_sb->bdi);
        kfree(cifs_sb);
-
-       unlock_kernel();
 }
 
 static int
@@ -323,7 +318,6 @@ cifs_alloc_inode(struct super_block *sb)
                return NULL;
        cifs_inode->cifsAttrs = 0x20;   /* default */
        cifs_inode->time = 0;
-       cifs_inode->write_behind_rc = 0;
        /* Until the file is open and we have gotten oplock
        info back from the server, can not assume caching of
        file data or metadata */
@@ -550,28 +544,29 @@ static const struct super_operations cifs_super_ops = {
 #endif
 };
 
-static int
-cifs_get_sb(struct file_system_type *fs_type,
-           int flags, const char *dev_name, void *data, struct vfsmount *mnt)
+static struct dentry *
+cifs_do_mount(struct file_system_type *fs_type,
+           int flags, const char *dev_name, void *data)
 {
        int rc;
-       struct super_block *sb = sget(fs_type, NULL, set_anon_super, NULL);
+       struct super_block *sb;
+
+       sb = sget(fs_type, NULL, set_anon_super, NULL);
 
        cFYI(1, "Devname: %s flags: %d ", dev_name, flags);
 
        if (IS_ERR(sb))
-               return PTR_ERR(sb);
+               return ERR_CAST(sb);
 
        sb->s_flags = flags;
 
        rc = cifs_read_super(sb, data, dev_name, flags & MS_SILENT ? 1 : 0);
        if (rc) {
                deactivate_locked_super(sb);
-               return rc;
+               return ERR_PTR(rc);
        }
        sb->s_flags |= MS_ACTIVE;
-       simple_set_mnt(mnt, sb);
-       return 0;
+       return dget(sb->s_root);
 }
 
 static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov,
@@ -606,8 +601,8 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
 
 static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
 {
-       /* note that this is called by vfs setlease with the BKL held
-          although I doubt that BKL is needed here in cifs */
+       /* note that this is called by vfs setlease with lock_flocks held
+          to protect *lease from going away */
        struct inode *inode = file->f_path.dentry->d_inode;
        struct cifsFileInfo *cfile = file->private_data;
 
@@ -637,7 +632,7 @@ static int cifs_setlease(struct file *file, long arg, struct file_lock **lease)
 struct file_system_type cifs_fs_type = {
        .owner = THIS_MODULE,
        .name = "cifs",
-       .get_sb = cifs_get_sb,
+       .mount = cifs_do_mount,
        .kill_sb = kill_anon_super,
        /*  .fs_flags */
 };