Skip to contentSkip to conversation

smb: use macros instead of constants for leasekey size and default cifsattrs value

PATCH Applied Bharath SM 2 participants 2 messages Dec 16, 2024

Subsystems (2)
lore
Share & tools
lore

Bharath SM

author
#0 lore raw

PATCH 1/1 smb: use macros instead of constants for leasekey size and default cifsattrs value

Replace default hardcoded value for cifsAttrs with ATTR_ARCHIVE macro Use SMB2_LEASE_KEY_SIZE macro for leasekey size in smb2_lease_break

---
 fs/smb/client/cifsfs.c  | 2 +-
 fs/smb/client/smb2pdu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/smb/client/cifsfs.c +1 -1
index c9f9b6e97964..722be656f5dc 100644
@@ -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
fs/smb/client/smb2pdu.c +1 -1
index 010eae9d6c47..c945b94318f8 100644
@@ -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;
Signature · 1 line
2.43.0
Applied
#1 lore raw

merged into cifs-2.6.git for-next

Quoted 40 lines · Bharath SM

Replace default hardcoded value for cifsAttrs with ATTR_ARCHIVE macro Use SMB2_LEASE_KEY_SIZE macro for leasekey size in smb2_lease_break

---
 fs/smb/client/cifsfs.c  | 2 +-
 fs/smb/client/smb2pdu.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/smb/client/cifsfs.c +1 -1
index c9f9b6e97964..722be656f5dc 100644
@@ -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
fs/smb/client/smb2pdu.c +1 -2
index 010eae9d6c47..c945b94318f8 100644
@@ -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;
--

2.43.0

Signature · 3 lines
Thanks,

Steve