]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
smb: use macros instead of constants for leasekey size and default cifsattrs value
authorBharath SM <bharathsm@microsoft.com>
Mon, 16 Dec 2024 18:39:36 +0000 (00:09 +0530)
committerSteve French <stfrench@microsoft.com>
Thu, 19 Dec 2024 15:24:32 +0000 (09:24 -0600)
Replace default hardcoded value for cifsAttrs with ATTR_ARCHIVE macro
Use SMB2_LEASE_KEY_SIZE macro for leasekey size in smb2_lease_break

Signed-off-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsfs.c
fs/smb/client/smb2pdu.c

index 9d96b833015c82649df1da0a3815877ea4f3d063..b800c9f585d8d1d614c2be401015e30cf5e5b515 100644 (file)
@@ -398,7 +398,7 @@ cifs_alloc_inode(struct super_block *sb)
        cifs_inode = alloc_inode_sb(sb, cifs_inode_cachep, GFP_KERNEL);
        if (!cifs_inode)
                return NULL;
-       cifs_inode->cifsAttrs = 0x20;   /* default */
+       cifs_inode->cifsAttrs = ATTR_ARCHIVE;   /* default */
        cifs_inode->time = 0;
        /*
         * Until the file is open and we have gotten oplock info back from the
index 010eae9d6c47e24d46ddc588d8f0e17dd6445095..c945b94318f844c236483316b20a24a3a1a412ca 100644 (file)
@@ -6204,7 +6204,7 @@ SMB2_lease_break(const unsigned int xid, struct cifs_tcon *tcon,
        req->StructureSize = cpu_to_le16(36);
        total_len += 12;
 
-       memcpy(req->LeaseKey, lease_key, 16);
+       memcpy(req->LeaseKey, lease_key, SMB2_LEASE_KEY_SIZE);
        req->LeaseState = lease_state;
 
        flags |= CIFS_NO_RSP_BUF;