Upgrade to 4.4.50-rt62
[kvmfornfv.git] / kernel / fs / cifs / cifsfs.c
index cbc0f4b..4f4fc9f 100644 (file)
 #endif
 
 int cifsFYI = 0;
-int traceSMB = 0;
+bool traceSMB;
 bool enable_oplocks = true;
-unsigned int linuxExtEnabled = 1;
-unsigned int lookupCacheEnabled = 1;
+bool linuxExtEnabled = true;
+bool lookupCacheEnabled = true;
 unsigned int global_secflags = CIFSSEC_DEF;
 /* unsigned int ntlmv2_support = 0; */
 unsigned int sign_CIFS_PDUs = 1;
@@ -268,7 +268,7 @@ cifs_alloc_inode(struct super_block *sb)
        cifs_inode->createtime = 0;
        cifs_inode->epoch = 0;
 #ifdef CONFIG_CIFS_SMB2
-       get_random_bytes(cifs_inode->lease_key, SMB2_LEASE_KEY_SIZE);
+       generate_random_uuid(cifs_inode->lease_key);
 #endif
        /*
         * Can not set i_flags here - they get immediately overwritten to zero
@@ -686,6 +686,14 @@ cifs_do_mount(struct file_system_type *fs_type,
                goto out_cifs_sb;
        }
 
+       if (volume_info->prepath) {
+               cifs_sb->prepath = kstrdup(volume_info->prepath, GFP_KERNEL);
+               if (cifs_sb->prepath == NULL) {
+                       root = ERR_PTR(-ENOMEM);
+                       goto out_cifs_sb;
+               }
+       }
+
        cifs_setup_cifs_sb(volume_info, cifs_sb);
 
        rc = cifs_mount(cifs_sb, volume_info);
@@ -724,7 +732,11 @@ cifs_do_mount(struct file_system_type *fs_type,
                sb->s_flags |= MS_ACTIVE;
        }
 
-       root = cifs_get_root(volume_info, sb);
+       if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_USE_PREFIX_PATH)
+               root = dget(sb->s_root);
+       else
+               root = cifs_get_root(volume_info, sb);
+
        if (IS_ERR(root))
                goto out_super;
 
@@ -1198,7 +1210,6 @@ init_cifs(void)
        GlobalTotalActiveXid = 0;
        GlobalMaxActiveXid = 0;
        spin_lock_init(&cifs_tcp_ses_lock);
-       spin_lock_init(&cifs_file_list_lock);
        spin_lock_init(&GlobalMid_Lock);
 
        if (cifs_max_pending < 2) {