diff options
author | Chao Yu <yuchao0@huawei.com> | 2020-08-10 18:39:30 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2020-09-10 14:03:31 -0700 |
commit | e6c3948de2f8213010e584009d47e9bc0934b32c (patch) | |
tree | 0e7e2febdd212ee341cc4a5e7f0898d7a01c2558 /fs/f2fs/data.c | |
parent | 17d7648d9ce0c7d7e732252f0d976756c84d46aa (diff) |
f2fs: compress: use more readable atomic_t type for {cic,dic}.ref
refcount_t type variable should never be less than one, so it's a
little bit hard to understand when we use it to indicate pending
compressed page count, let's change to use atomic_t for better
readability.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/data.c')
-rw-r--r-- | fs/f2fs/data.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index b4b7eb8ab69b..011aea665ae4 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -202,7 +202,7 @@ static void f2fs_verify_bio(struct bio *bio) dic = (struct decompress_io_ctx *)page_private(page); if (dic) { - if (refcount_dec_not_one(&dic->ref)) + if (atomic_dec_return(&dic->pending_pages)) continue; f2fs_verify_pages(dic->rpages, dic->cluster_size); @@ -2272,8 +2272,8 @@ submit_and_realloc: if (IS_ERR(bio)) { ret = PTR_ERR(bio); dic->failed = true; - if (refcount_sub_and_test(dic->nr_cpages - i, - &dic->ref)) { + if (!atomic_sub_return(dic->nr_cpages - i, + &dic->pending_pages)) { f2fs_decompress_end_io(dic->rpages, cc->cluster_size, true, false); |