]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/cifs/cifsfs.c
Merge tag 'random_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[karo-tx-linux.git] / fs / cifs / cifsfs.c
index 9a1667e0e8d604ededf2a7ceb27ffcebf24b0ab9..180b3356ff8612dfc7f3cd702e350bb284ca1a0d 100644 (file)
@@ -51,9 +51,7 @@
 #include <linux/key-type.h>
 #include "cifs_spnego.h"
 #include "fscache.h"
-#ifdef CONFIG_CIFS_SMB2
 #include "smb2pdu.h"
-#endif
 
 int cifsFYI = 0;
 bool traceSMB;
@@ -277,9 +275,8 @@ cifs_alloc_inode(struct super_block *sb)
        cifs_inode->uniqueid = 0;
        cifs_inode->createtime = 0;
        cifs_inode->epoch = 0;
-#ifdef CONFIG_CIFS_SMB2
        generate_random_uuid(cifs_inode->lease_key);
-#endif
+
        /*
         * Can not set i_flags here - they get immediately overwritten to zero
         * by the VFS.
@@ -1213,14 +1210,12 @@ cifs_destroy_inodecache(void)
 static int
 cifs_init_request_bufs(void)
 {
-       size_t max_hdr_size = MAX_CIFS_HDR_SIZE;
-#ifdef CONFIG_CIFS_SMB2
        /*
         * SMB2 maximum header size is bigger than CIFS one - no problems to
         * allocate some more bytes for CIFS.
         */
-       max_hdr_size = MAX_SMB2_HDR_SIZE;
-#endif
+       size_t max_hdr_size = MAX_SMB2_HDR_SIZE;
+
        if (CIFSMaxBufSize < 8192) {
        /* Buffer size can not be smaller than 2 * PATH_MAX since maximum
        Unicode path name has to fit in any SMB/CIFS path based frames */
@@ -1359,7 +1354,7 @@ init_cifs(void)
        spin_lock_init(&cifs_tcp_ses_lock);
        spin_lock_init(&GlobalMid_Lock);
 
-       get_random_bytes(&cifs_lock_secret, sizeof(cifs_lock_secret));
+       cifs_lock_secret = get_random_u32();
 
        if (cifs_max_pending < 2) {
                cifs_max_pending = 2;
@@ -1476,12 +1471,10 @@ MODULE_SOFTDEP("pre: hmac");
 MODULE_SOFTDEP("pre: md4");
 MODULE_SOFTDEP("pre: md5");
 MODULE_SOFTDEP("pre: nls");
-#ifdef CONFIG_CIFS_SMB2
 MODULE_SOFTDEP("pre: aes");
 MODULE_SOFTDEP("pre: cmac");
 MODULE_SOFTDEP("pre: sha256");
 MODULE_SOFTDEP("pre: aead2");
 MODULE_SOFTDEP("pre: ccm");
-#endif /* CONFIG_CIFS_SMB2 */
 module_init(init_cifs)
 module_exit(exit_cifs)