Message ID | 20230119063625.466485-2-hch@lst.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 2163a691c5f3d30326ff09193c97aec47cec9eba |
Headers | show |
Series | [f2fs-dev,1/8] f2fs: remove __add_sum_entry | expand |
On 2023/1/19 14:36, Christoph Hellwig wrote: > This function just assigns a summary entry. This can be done entirely > typesafe with an open code struct assignment that relies on array > indexing. > > Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Chao Yu <chao@kernel.org> Thanks,
Hello: This series was applied to jaegeuk/f2fs.git (dev) by Jaegeuk Kim <jaegeuk@kernel.org>: On Thu, 19 Jan 2023 07:36:18 +0100 you wrote: > This function just assigns a summary entry. This can be done entirely > typesafe with an open code struct assignment that relies on array > indexing. > > Signed-off-by: Christoph Hellwig <hch@lst.de> > --- > fs/f2fs/segment.c | 23 ++--------------------- > 1 file changed, 2 insertions(+), 21 deletions(-) Here is the summary with links: - [f2fs-dev,1/8] f2fs: remove __add_sum_entry https://git.kernel.org/jaegeuk/f2fs/c/2163a691c5f3 - [f2fs-dev,2/8] f2fs: simplify do_checkpoint https://git.kernel.org/jaegeuk/f2fs/c/bc6cc6f92b89 - [f2fs-dev,3/8] f2fs: add a f2fs_curseg_valid_blocks helper https://git.kernel.org/jaegeuk/f2fs/c/0034f8954469 - [f2fs-dev,4/8] f2fs: factor the read/write tracing logic into a helper (no matching commit) - [f2fs-dev,5/8] f2fs: refactor __allocate_new_segment https://git.kernel.org/jaegeuk/f2fs/c/53577f7c5b8b - [f2fs-dev,6/8] f2fs: remove __allocate_new_section https://git.kernel.org/jaegeuk/f2fs/c/b2164fbdb8f8 - [f2fs-dev,7/8] f2fs: refactor next blk selection https://git.kernel.org/jaegeuk/f2fs/c/33234f9705d8 - [f2fs-dev,8/8] f2fs: remove __has_curseg_space https://git.kernel.org/jaegeuk/f2fs/c/b8574d8c47eb You are awesome, thank you!
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 311243dda4cefa..ec6880213e8fa9 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -2323,19 +2323,6 @@ bool f2fs_is_checkpointed_data(struct f2fs_sb_info *sbi, block_t blkaddr) return is_cp; } -/* - * This function should be resided under the curseg_mutex lock - */ -static void __add_sum_entry(struct f2fs_sb_info *sbi, int type, - struct f2fs_summary *sum) -{ - struct curseg_info *curseg = CURSEG_I(sbi, type); - void *addr = curseg->sum_blk; - - addr += curseg->next_blkoff * sizeof(struct f2fs_summary); - memcpy(addr, sum, sizeof(struct f2fs_summary)); -} - /* * Calculate the number of current summary pages for writing */ @@ -3262,13 +3249,7 @@ void f2fs_allocate_data_block(struct f2fs_sb_info *sbi, struct page *page, f2fs_wait_discard_bio(sbi, *new_blkaddr); - /* - * __add_sum_entry should be resided under the curseg_mutex - * because, this function updates a summary entry in the - * current summary block. - */ - __add_sum_entry(sbi, type, sum); - + curseg->sum_blk->entries[curseg->next_blkoff] = *sum; __refresh_next_blkoff(sbi, curseg); stat_inc_block_count(sbi, curseg); @@ -3571,7 +3552,7 @@ void f2fs_do_replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, } curseg->next_blkoff = GET_BLKOFF_FROM_SEG0(sbi, new_blkaddr); - __add_sum_entry(sbi, type, sum); + curseg->sum_blk->entries[curseg->next_blkoff] = *sum; if (!recover_curseg || recover_newaddr) { if (!from_gc)
This function just assigns a summary entry. This can be done entirely typesafe with an open code struct assignment that relies on array indexing. Signed-off-by: Christoph Hellwig <hch@lst.de> --- fs/f2fs/segment.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-)