/universe.0xinfinity.dev/distro/kernel/atom?h=0x221E-v0.0-v7.0 2025-12-16T23:43:01Z smb: move some SMB1 definitions into common/smb1pdu.h 2025-12-16T23:43:01Z ZhangGuoDong zhangguodong@kylinos.cn 2025-12-02T07:14:17Z urn:sha1:94d5b8dbc5d9caa8e01c8fab8d5ed56e843ff40e These definitions are only used by SMB1, so move them into the new common/smb1pdu.h. KSMBD only implements SMB_COM_NEGOTIATE, see MS-SMB2 3.3.5.2. Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Signed-off-by: Steve French <stfrench@microsoft.com> cifs: Remove the RFC1002 header from smb_hdr 2025-12-05T23:09:32Z David Howells dhowells@redhat.com 2025-09-05T14:34:15Z urn:sha1:83bfbd0bb9025f98fa62b44f93bd67466773d1db Remove the RFC1002 header from struct smb_hdr as used for SMB-1.0. This simplifies the SMB-1.0 code by simplifying a lot of places that have to add or subtract 4 to work around the fact that the RFC1002 header isn't really part of the message and the base for various offsets within the message is from the base of the smb_hdr, not the RFC1002 header. Further, clean up a bunch of places that require an extra kvec struct specifically pointing to the RFC1002 header, such that kvec[0].iov_base must be exactly 4 bytes before kvec[1].iov_base. This allows the header preamble size stuff to be removed too. The size of the request and response message are then handed around either directly or by summing the size of all the iov_len members in the kvec array for which we have a count. Also, this simplifies and cleans up the common transmission and receive paths for SMB1 and SMB2/3 as there no longer needs to be special handling casing for SMB1 messages as the RFC1002 header is now generated on the fly for SMB1 as it is for SMB2/3. Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Tom Talpey <tom@talpey.com> Reviewed-by: Paulo Alcantara (Red Hat) <pc@manguebit.org> cc: Shyam Prasad N <sprasad@microsoft.com> cc: linux-cifs@vger.kernel.org cc: netfs@lists.linux.dev cc: linux-fsdevel@vger.kernel.org Signed-off-by: Steve French <stfrench@microsoft.com> smb: move MAX_CIFS_SMALL_BUFFER_SIZE to common/smbglob.h 2025-12-01T03:11:44Z ChenXiaoSong chenxiaosong@kylinos.cn 2025-11-02T07:30:47Z urn:sha1:884a1d4e9c09b4a0dbe748890bdd48aac8e5a6b6 In order to maintain the code more easily, move duplicate definitions to common header file. By the way, add the copyright and author information for Namjae to common/smbglob.h. Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> smb: move SMB1_PROTO_NUMBER to common/smbglob.h 2025-12-01T03:11:44Z ZhangGuoDong zhangguodong@kylinos.cn 2025-10-27T07:12:56Z urn:sha1:cd311445d9f5510979f6e9f4344178b9f5a4d981 Replace the constant of client with SMB1_PROTO_NUMBER, then move the macro definition from server/smb_common.h to common/smbglob.h. Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Suggested-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> smb: move get_rfc1002_len() to common/smbglob.h 2025-12-01T03:11:44Z ZhangGuoDong zhangguodong@kylinos.cn 2025-11-21T21:44:49Z urn:sha1:36c31540cf5279262bfd148d8537cd04866499f2 Rename get_rfc1002_length() to get_rfc1002_len(), then move duplicate definitions to common header file. Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> smb: move smb_version_values to common/smbglob.h 2025-12-01T03:11:44Z ZhangGuoDong zhangguodong@kylinos.cn 2025-10-27T07:12:54Z urn:sha1:34cf191bb6a349dc88ec2c4f6355fe006ac669e0 Merge the struct members of the server and the client: - req_capabilities: from client - header_preamble_size: from client - cap_unicode: from client - capabilities: from server, rename to req_capabilities - max_read_size: from server - max_write_size: from server - max_trans_size: from server - max_credits: from server - create_durable_size: from server - create_durable_v2_size: from server - create_mxac_size: from server - create_disk_id_size: from server - create_posix_size: from server Then move duplicate definitions to common header file. Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> smb: rename common/cifsglob.h to common/smbglob.h 2025-12-01T03:11:43Z ZhangGuoDong zhangguodong@kylinos.cn 2025-10-27T07:12:53Z urn:sha1:94b955167e3b11372e314f45f4b2fbf4f92493b9 "cifs" is a legacy name, rename it to "smbglob.h" according to Namjae's suggestions. Co-developed-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ChenXiaoSong <chenxiaosong@kylinos.cn> Signed-off-by: ZhangGuoDong <zhangguodong@kylinos.cn> Suggested-by: Namjae Jeon <linkinjeon@kernel.org> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>