2021-03-16 07:07:11 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Namjae Jeon <linkinjeon@kernel.org>
|
|
|
|
* Copyright (C) 2018 Samsung Electronics Co., Ltd.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __KSMBD_GLOB_H
|
|
|
|
#define __KSMBD_GLOB_H
|
|
|
|
|
|
|
|
#include <linux/ctype.h>
|
|
|
|
|
|
|
|
#include "unicode.h"
|
|
|
|
#include "vfs_cache.h"
|
|
|
|
|
2021-10-01 05:53:49 +03:00
|
|
|
#define KSMBD_VERSION "3.4.2"
|
2021-03-16 07:07:11 +03:00
|
|
|
|
|
|
|
extern int ksmbd_debug_types;
|
|
|
|
|
2021-03-30 08:25:35 +03:00
|
|
|
#define KSMBD_DEBUG_SMB BIT(0)
|
|
|
|
#define KSMBD_DEBUG_AUTH BIT(1)
|
|
|
|
#define KSMBD_DEBUG_VFS BIT(2)
|
|
|
|
#define KSMBD_DEBUG_OPLOCK BIT(3)
|
|
|
|
#define KSMBD_DEBUG_IPC BIT(4)
|
|
|
|
#define KSMBD_DEBUG_CONN BIT(5)
|
|
|
|
#define KSMBD_DEBUG_RDMA BIT(6)
|
2021-03-16 07:07:11 +03:00
|
|
|
#define KSMBD_DEBUG_ALL (KSMBD_DEBUG_SMB | KSMBD_DEBUG_AUTH | \
|
|
|
|
KSMBD_DEBUG_VFS | KSMBD_DEBUG_OPLOCK | \
|
|
|
|
KSMBD_DEBUG_IPC | KSMBD_DEBUG_CONN | \
|
|
|
|
KSMBD_DEBUG_RDMA)
|
|
|
|
|
2021-06-28 09:23:19 +03:00
|
|
|
#ifdef pr_fmt
|
|
|
|
#undef pr_fmt
|
|
|
|
#endif
|
|
|
|
|
2021-03-16 07:07:11 +03:00
|
|
|
#ifdef SUBMOD_NAME
|
2021-06-28 09:23:19 +03:00
|
|
|
#define pr_fmt(fmt) "ksmbd: " SUBMOD_NAME ": " fmt
|
2021-03-16 07:07:11 +03:00
|
|
|
#else
|
2021-06-28 09:23:19 +03:00
|
|
|
#define pr_fmt(fmt) "ksmbd: " fmt
|
2021-03-16 07:07:11 +03:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define ksmbd_debug(type, fmt, ...) \
|
|
|
|
do { \
|
|
|
|
if (ksmbd_debug_types & KSMBD_DEBUG_##type) \
|
2021-06-28 09:23:19 +03:00
|
|
|
pr_info(fmt, ##__VA_ARGS__); \
|
2021-03-16 07:07:11 +03:00
|
|
|
} while (0)
|
|
|
|
|
|
|
|
#define UNICODE_LEN(x) ((x) * 2)
|
|
|
|
|
|
|
|
#endif /* __KSMBD_GLOB_H */
|