Commit 9a654a8f authored by Nirjhar Roy (IBM)'s avatar Nirjhar Roy (IBM) Committed by Carlos Maiolino
Browse files

xfs: Add comments for usages of some macros.



Add comments explaining when to use XFS_IS_CORRUPT() and ASSERT()

Suggested-by: default avatarDarrick J. Wong <djwong@kernel.org>
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNirjhar Roy (IBM) <nirjhar.roy.lists@gmail.com>
Signed-off-by: default avatarCarlos Maiolino <cem@kernel.org>
parent c2368fc8
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -235,6 +235,10 @@ int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count,

#ifdef XFS_WARN

/*
 * Please note that this ASSERT doesn't kill the kernel. It will if the kernel
 * has panic_on_warn set.
 */
#define ASSERT(expr)	\
	(likely(expr) ? (void)0 : asswarn(NULL, #expr, __FILE__, __LINE__))

@@ -245,6 +249,11 @@ int xfs_rw_bdev(struct block_device *bdev, sector_t sector, unsigned int count,
#endif /* XFS_WARN */
#endif /* DEBUG */

/*
 * Use this to catch metadata corruptions that are not caught by block or
 * structure verifiers. The reason is that the verifiers check corruptions only
 * within the scope of the object being verified.
 */
#define XFS_IS_CORRUPT(mp, expr)	\
	(unlikely(expr) ? xfs_corruption_error(#expr, XFS_ERRLEVEL_LOW, (mp), \
					       NULL, 0, __FILE__, __LINE__, \