* [PATCH] ext4: remove unused parameter biop in ext4_issue_discard()
@ 2024-02-26 8:17 Wenchao Hao
2024-02-26 14:06 ` Zhang Yi
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Wenchao Hao @ 2024-02-26 8:17 UTC (permalink / raw)
To: Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel
Cc: louhongxiang, Wenchao Hao
all caller of ext4_issue_discard() would set biop to NULL since
'commit 55cdd0af2bc5 ("ext4: get discard out of jbd2 commit kthread
contex")', it's unnecessary to keep this parameter any more.
Signed-off-by: Wenchao Hao <haowenchao2@huawei.com>
---
fs/ext4/mballoc.c | 16 +++++-----------
1 file changed, 5 insertions(+), 11 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index d72b5e3c92ec..1590ee3f4603 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -3807,8 +3807,7 @@ int ext4_mb_release(struct super_block *sb)
}
static inline int ext4_issue_discard(struct super_block *sb,
- ext4_group_t block_group, ext4_grpblk_t cluster, int count,
- struct bio **biop)
+ ext4_group_t block_group, ext4_grpblk_t cluster, int count)
{
ext4_fsblk_t discard_block;
@@ -3817,13 +3816,8 @@ static inline int ext4_issue_discard(struct super_block *sb,
count = EXT4_C2B(EXT4_SB(sb), count);
trace_ext4_discard_blocks(sb,
(unsigned long long) discard_block, count);
- if (biop) {
- return __blkdev_issue_discard(sb->s_bdev,
- (sector_t)discard_block << (sb->s_blocksize_bits - 9),
- (sector_t)count << (sb->s_blocksize_bits - 9),
- GFP_NOFS, biop);
- } else
- return sb_issue_discard(sb, discard_block, count, GFP_NOFS, 0);
+
+ return sb_issue_discard(sb, discard_block, count, GFP_NOFS, 0);
}
static void ext4_free_data_in_buddy(struct super_block *sb,
@@ -6475,7 +6469,7 @@ static void ext4_mb_clear_bb(handle_t *handle, struct inode *inode,
} else {
if (test_opt(sb, DISCARD)) {
err = ext4_issue_discard(sb, block_group, bit,
- count_clusters, NULL);
+ count_clusters);
if (err && err != -EOPNOTSUPP)
ext4_msg(sb, KERN_WARNING, "discard request in"
" group:%u block:%d count:%lu failed"
@@ -6726,7 +6720,7 @@ __acquires(bitlock)
*/
mb_mark_used(e4b, &ex);
ext4_unlock_group(sb, group);
- ret = ext4_issue_discard(sb, group, start, count, NULL);
+ ret = ext4_issue_discard(sb, group, start, count);
ext4_lock_group(sb, group);
mb_free_blocks(NULL, e4b, start, ex.fe_len);
return ret;
--
2.32.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ext4: remove unused parameter biop in ext4_issue_discard()
2024-02-26 8:17 [PATCH] ext4: remove unused parameter biop in ext4_issue_discard() Wenchao Hao
@ 2024-02-26 14:06 ` Zhang Yi
2024-02-26 15:25 ` Ritesh Harjani
2024-03-14 3:54 ` Theodore Ts'o
2 siblings, 0 replies; 4+ messages in thread
From: Zhang Yi @ 2024-02-26 14:06 UTC (permalink / raw)
To: Wenchao Hao, Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel
Cc: louhongxiang
On 2024/2/26 16:17, Wenchao Hao wrote:
> all caller of ext4_issue_discard() would set biop to NULL since
> 'commit 55cdd0af2bc5 ("ext4: get discard out of jbd2 commit kthread
> contex")', it's unnecessary to keep this parameter any more.
>
> Signed-off-by: Wenchao Hao <haowenchao2@huawei.com>
Thanks for the patch, it looks good to me.
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
> ---
> fs/ext4/mballoc.c | 16 +++++-----------
> 1 file changed, 5 insertions(+), 11 deletions(-)
>
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index d72b5e3c92ec..1590ee3f4603 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -3807,8 +3807,7 @@ int ext4_mb_release(struct super_block *sb)
> }
>
> static inline int ext4_issue_discard(struct super_block *sb,
> - ext4_group_t block_group, ext4_grpblk_t cluster, int count,
> - struct bio **biop)
> + ext4_group_t block_group, ext4_grpblk_t cluster, int count)
> {
> ext4_fsblk_t discard_block;
>
> @@ -3817,13 +3816,8 @@ static inline int ext4_issue_discard(struct super_block *sb,
> count = EXT4_C2B(EXT4_SB(sb), count);
> trace_ext4_discard_blocks(sb,
> (unsigned long long) discard_block, count);
> - if (biop) {
> - return __blkdev_issue_discard(sb->s_bdev,
> - (sector_t)discard_block << (sb->s_blocksize_bits - 9),
> - (sector_t)count << (sb->s_blocksize_bits - 9),
> - GFP_NOFS, biop);
> - } else
> - return sb_issue_discard(sb, discard_block, count, GFP_NOFS, 0);
> +
> + return sb_issue_discard(sb, discard_block, count, GFP_NOFS, 0);
> }
>
> static void ext4_free_data_in_buddy(struct super_block *sb,
> @@ -6475,7 +6469,7 @@ static void ext4_mb_clear_bb(handle_t *handle, struct inode *inode,
> } else {
> if (test_opt(sb, DISCARD)) {
> err = ext4_issue_discard(sb, block_group, bit,
> - count_clusters, NULL);
> + count_clusters);
> if (err && err != -EOPNOTSUPP)
> ext4_msg(sb, KERN_WARNING, "discard request in"
> " group:%u block:%d count:%lu failed"
> @@ -6726,7 +6720,7 @@ __acquires(bitlock)
> */
> mb_mark_used(e4b, &ex);
> ext4_unlock_group(sb, group);
> - ret = ext4_issue_discard(sb, group, start, count, NULL);
> + ret = ext4_issue_discard(sb, group, start, count);
> ext4_lock_group(sb, group);
> mb_free_blocks(NULL, e4b, start, ex.fe_len);
> return ret;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ext4: remove unused parameter biop in ext4_issue_discard()
2024-02-26 8:17 [PATCH] ext4: remove unused parameter biop in ext4_issue_discard() Wenchao Hao
2024-02-26 14:06 ` Zhang Yi
@ 2024-02-26 15:25 ` Ritesh Harjani
2024-03-14 3:54 ` Theodore Ts'o
2 siblings, 0 replies; 4+ messages in thread
From: Ritesh Harjani @ 2024-02-26 15:25 UTC (permalink / raw)
To: Wenchao Hao, Theodore Ts'o, Andreas Dilger, linux-ext4, linux-kernel
Cc: louhongxiang, Wenchao Hao
Wenchao Hao <haowenchao2@huawei.com> writes:
> all caller of ext4_issue_discard() would set biop to NULL since
> 'commit 55cdd0af2bc5 ("ext4: get discard out of jbd2 commit kthread
> contex")', it's unnecessary to keep this parameter any more.
>
> Signed-off-by: Wenchao Hao <haowenchao2@huawei.com>
Nice little cleanup. Feel free to add -
Reviewed-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ext4: remove unused parameter biop in ext4_issue_discard()
2024-02-26 8:17 [PATCH] ext4: remove unused parameter biop in ext4_issue_discard() Wenchao Hao
2024-02-26 14:06 ` Zhang Yi
2024-02-26 15:25 ` Ritesh Harjani
@ 2024-03-14 3:54 ` Theodore Ts'o
2 siblings, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2024-03-14 3:54 UTC (permalink / raw)
To: Andreas Dilger, linux-ext4, linux-kernel, Wenchao Hao
Cc: Theodore Ts'o, louhongxiang
On Mon, 26 Feb 2024 16:17:31 +0800, Wenchao Hao wrote:
> all caller of ext4_issue_discard() would set biop to NULL since
> 'commit 55cdd0af2bc5 ("ext4: get discard out of jbd2 commit kthread
> contex")', it's unnecessary to keep this parameter any more.
>
>
Applied, thanks!
[1/1] ext4: remove unused parameter biop in ext4_issue_discard()
commit: 0efcd739fc07cefd5c54e202f66b4ea5def4776b
Best regards,
--
Theodore Ts'o <tytso@mit.edu>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-03-14 3:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-26 8:17 [PATCH] ext4: remove unused parameter biop in ext4_issue_discard() Wenchao Hao
2024-02-26 14:06 ` Zhang Yi
2024-02-26 15:25 ` Ritesh Harjani
2024-03-14 3:54 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).