ksmbd: fixes build on kernel 6.1

Fixes: #10604

Signed-off-by: AmadeusGhost <amadeus@openjmu.xyz>
This commit is contained in:
AmadeusGhost 2022-11-20 23:01:19 +08:00 committed by AmadeusGhost
parent e6f5ad32af
commit 74a3f1191b

View File

@ -0,0 +1,14 @@
--- a/smb1pdu.c
+++ b/smb1pdu.c
@@ -5851,7 +5851,11 @@ static int smb_populate_readdir_entry(struct ksmbd_conn *conn, int info_level,
*
* Return: 0 on success, otherwise -EINVAL
*/
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+static bool ksmbd_fill_dirent(struct dir_context *ctx, const char *name, int namlen,
+#else
static int ksmbd_fill_dirent(struct dir_context *ctx, const char *name, int namlen,
+#endif
loff_t offset, u64 ino, unsigned int d_type)
{
struct ksmbd_readdir_data *buf =