glob.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2016 Namjae Jeon <linkinjeon@kernel.org>
  4. * Copyright (C) 2018 Samsung Electronics Co., Ltd.
  5. */
  6. #ifndef __KSMBD_GLOB_H
  7. #define __KSMBD_GLOB_H
  8. #include <linux/ctype.h>
  9. #include "unicode.h"
  10. #include "vfs_cache.h"
  11. extern int ksmbd_debug_types;
  12. #define KSMBD_DEBUG_SMB BIT(0)
  13. #define KSMBD_DEBUG_AUTH BIT(1)
  14. #define KSMBD_DEBUG_VFS BIT(2)
  15. #define KSMBD_DEBUG_OPLOCK BIT(3)
  16. #define KSMBD_DEBUG_IPC BIT(4)
  17. #define KSMBD_DEBUG_CONN BIT(5)
  18. #define KSMBD_DEBUG_RDMA BIT(6)
  19. #define KSMBD_DEBUG_ALL (KSMBD_DEBUG_SMB | KSMBD_DEBUG_AUTH | \
  20. KSMBD_DEBUG_VFS | KSMBD_DEBUG_OPLOCK | \
  21. KSMBD_DEBUG_IPC | KSMBD_DEBUG_CONN | \
  22. KSMBD_DEBUG_RDMA)
  23. #ifdef pr_fmt
  24. #undef pr_fmt
  25. #endif
  26. #ifdef SUBMOD_NAME
  27. #define pr_fmt(fmt) "ksmbd: " SUBMOD_NAME ": " fmt
  28. #else
  29. #define pr_fmt(fmt) "ksmbd: " fmt
  30. #endif
  31. #define ksmbd_debug(type, fmt, ...) \
  32. do { \
  33. if (ksmbd_debug_types & KSMBD_DEBUG_##type) \
  34. pr_info(fmt, ##__VA_ARGS__); \
  35. } while (0)
  36. #define UNICODE_LEN(x) ((x) * 2)
  37. #define KSMBD_DEFAULT_GFP (GFP_KERNEL | __GFP_RETRY_MAYFAIL)
  38. #endif /* __KSMBD_GLOB_H */