summaryrefslogtreecommitdiff
path: root/fs/smb/client/smb2pdu.h
diff options
context:
space:
mode:
authorPaulo Alcantara <pc@manguebit.com>2024-01-28 07:12:01 +0300
committerSteve French <stfrench@microsoft.com>2024-03-11 03:33:58 +0300
commitea41367b2a602f602ea6594fc4a310520dcc64f4 (patch)
tree97b7e2daaff8072e6ce6d51d35cb647b484f8e3e /fs/smb/client/smb2pdu.h
parente0e1e09b2c41d383a2483f2ee5227b724860ced1 (diff)
downloadlinux-ea41367b2a602f602ea6594fc4a310520dcc64f4.tar.xz
smb: client: introduce SMB2_OP_QUERY_WSL_EA
Add a new command to smb2_compound_op() for querying WSL extended attributes from reparse points. Signed-off-by: Paulo Alcantara <pc@manguebit.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/smb/client/smb2pdu.h')
-rw-r--r--fs/smb/client/smb2pdu.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/fs/smb/client/smb2pdu.h b/fs/smb/client/smb2pdu.h
index ea63d33e4553..c72a3b2886b7 100644
--- a/fs/smb/client/smb2pdu.h
+++ b/fs/smb/client/smb2pdu.h
@@ -420,4 +420,29 @@ struct smb2_create_ea_ctx {
struct smb2_file_full_ea_info ea;
} __packed;
+#define SMB2_WSL_XATTR_UID "$LXUID"
+#define SMB2_WSL_XATTR_GID "$LXGID"
+#define SMB2_WSL_XATTR_MODE "$LXMOD"
+#define SMB2_WSL_XATTR_DEV "$LXDEV"
+#define SMB2_WSL_XATTR_NAME_LEN 6
+#define SMB2_WSL_NUM_XATTRS 4
+
+#define SMB2_WSL_XATTR_UID_SIZE 4
+#define SMB2_WSL_XATTR_GID_SIZE 4
+#define SMB2_WSL_XATTR_MODE_SIZE 4
+#define SMB2_WSL_XATTR_DEV_SIZE 8
+
+#define SMB2_WSL_MIN_QUERY_EA_RESP_SIZE \
+ (ALIGN((SMB2_WSL_NUM_XATTRS - 1) * \
+ (SMB2_WSL_XATTR_NAME_LEN + 1 + \
+ sizeof(struct smb2_file_full_ea_info)), 4) + \
+ SMB2_WSL_XATTR_NAME_LEN + 1 + sizeof(struct smb2_file_full_ea_info))
+
+#define SMB2_WSL_MAX_QUERY_EA_RESP_SIZE \
+ (ALIGN(SMB2_WSL_MIN_QUERY_EA_RESP_SIZE + \
+ SMB2_WSL_XATTR_UID_SIZE + \
+ SMB2_WSL_XATTR_GID_SIZE + \
+ SMB2_WSL_XATTR_MODE_SIZE + \
+ SMB2_WSL_XATTR_DEV_SIZE, 4))
+
#endif /* _SMB2PDU_H */