Skip to content

Commit 0daaad9

Browse files
author
Jaegeuk Kim
committed
f2fs: avoid lock debugging overhead
If CONFIG_F2FS_CHECK_FS is unset, we don't need to add any debugging overhead. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
1 parent 74de593 commit 0daaad9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎fs/f2fs/f2fs.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222

2323
#ifdef CONFIG_F2FS_CHECK_FS
2424
#define f2fs_bug_on(condition) BUG_ON(condition)
25+
#define f2fs_down_write(x, y) down_write_nest_lock(x, y)
2526
#else
2627
#define f2fs_bug_on(condition)
28+
#define f2fs_down_write(x, y) down_write(x)
2729
#endif
2830

2931
/*
@@ -556,7 +558,7 @@ static inline void f2fs_unlock_op(struct f2fs_sb_info *sbi)
556558

557559
static inline void f2fs_lock_all(struct f2fs_sb_info *sbi)
558560
{
559-
down_write_nest_lock(&sbi->cp_rwsem, &sbi->cp_mutex);
561+
f2fs_down_write(&sbi->cp_rwsem, &sbi->cp_mutex);
560562
}
561563

562564
static inline void f2fs_unlock_all(struct f2fs_sb_info *sbi)

0 commit comments

Comments
 (0)