f2fs: rename f2fs_set/clear_bit to f2fs_test_and_set/clear_bit
Rename f2fs_set/clear_bit to f2fs_test_and_set/clear_bit, which mean set/clear bit and return the old value, for better readability. Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -1049,7 +1049,7 @@ static inline int f2fs_test_bit(unsigned int nr, char *addr)
|
|||||||
return mask & *addr;
|
return mask & *addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int f2fs_set_bit(unsigned int nr, char *addr)
|
static inline int f2fs_test_and_set_bit(unsigned int nr, char *addr)
|
||||||
{
|
{
|
||||||
int mask;
|
int mask;
|
||||||
int ret;
|
int ret;
|
||||||
@@ -1061,7 +1061,7 @@ static inline int f2fs_set_bit(unsigned int nr, char *addr)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int f2fs_clear_bit(unsigned int nr, char *addr)
|
static inline int f2fs_test_and_clear_bit(unsigned int nr, char *addr)
|
||||||
{
|
{
|
||||||
int mask;
|
int mask;
|
||||||
int ret;
|
int ret;
|
||||||
|
|||||||
@@ -648,10 +648,10 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del)
|
|||||||
|
|
||||||
/* Update valid block bitmap */
|
/* Update valid block bitmap */
|
||||||
if (del > 0) {
|
if (del > 0) {
|
||||||
if (f2fs_set_bit(offset, se->cur_valid_map))
|
if (f2fs_test_and_set_bit(offset, se->cur_valid_map))
|
||||||
f2fs_bug_on(sbi, 1);
|
f2fs_bug_on(sbi, 1);
|
||||||
} else {
|
} else {
|
||||||
if (!f2fs_clear_bit(offset, se->cur_valid_map))
|
if (!f2fs_test_and_clear_bit(offset, se->cur_valid_map))
|
||||||
f2fs_bug_on(sbi, 1);
|
f2fs_bug_on(sbi, 1);
|
||||||
}
|
}
|
||||||
if (!f2fs_test_bit(offset, se->ckpt_valid_map))
|
if (!f2fs_test_bit(offset, se->ckpt_valid_map))
|
||||||
|
|||||||
Reference in New Issue
Block a user