linux/fs/ntfs3/debug.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 *
 * Copyright (C) 2019-2021 Paragon Software GmbH, All rights reserved.
 *
 * Useful functions for debugging.
 *
 */

// clang-format off
#ifndef _LINUX_NTFS3_DEBUG_H
#define _LINUX_NTFS3_DEBUG_H

struct super_block;
struct inode;

#ifndef Add2Ptr
#define Add2Ptr(P, I)
#define PtrOffset(B, O)
#endif

#ifdef CONFIG_PRINTK
__printf(2, 3)
void ntfs_printk(const struct super_block *sb, const char *fmt, ...);
__printf(2, 3)
void ntfs_inode_printk(struct inode *inode, const char *fmt, ...);
#else
static inline __printf(2, 3)
void ntfs_printk(const struct super_block *sb, const char *fmt, ...)
{
}

static inline __printf(2, 3)
void ntfs_inode_printk(struct inode *inode, const char *fmt, ...)
{
}
#endif

/*
 * Logging macros. Thanks Joe Perches <[email protected]> for implementation.
 */

#define ntfs_err(sb, fmt, ...)
#define ntfs_warn(sb, fmt, ...)
#define ntfs_info(sb, fmt, ...)
#define ntfs_notice(sb, fmt, ...)

#define ntfs_inode_err(inode, fmt, ...)
#define ntfs_inode_warn(inode, fmt, ...)

#endif /* _LINUX_NTFS3_DEBUG_H */
// clang-format on