diff options
author | Yu Kuai <yukuai3@huawei.com> | 2024-08-26 15:44:18 +0800 |
---|---|---|
committer | Song Liu <song@kernel.org> | 2024-08-27 10:14:15 -0700 |
commit | a0e7744a460ba5ca91f8d6fc4a696ee345b5baa9 (patch) | |
tree | 2703bfdb1b04af7b391ca85a4d8369f3be482921 /drivers/md/md-bitmap.c | |
parent | 10bc2ac10597ebc0b25afbc72fa4284565548e36 (diff) |
md/md-bitmap: add 'behind_writes' and 'behind_wait' into struct md_bitmap_stats
There are no functional changes, avoid dereferencing bitmap directly to
prepare inventing a new bitmap.
Also fix following checkpatch warning by using wq_has_sleeper().
WARNING: waitqueue_active without comment
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240826074452.1490072-9-yukuai1@huaweicloud.com
Signed-off-by: Song Liu <song@kernel.org>
Diffstat (limited to 'drivers/md/md-bitmap.c')
-rw-r--r-- | drivers/md/md-bitmap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index ba83b99d6185..918510f36e33 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -2115,6 +2115,8 @@ int md_bitmap_get_stats(struct bitmap *bitmap, struct md_bitmap_stats *stats) stats->file_pages = storage->file_pages; stats->file = storage->file; + stats->behind_writes = atomic_read(&bitmap->behind_writes); + stats->behind_wait = wq_has_sleeper(&bitmap->behind_wait); stats->events_cleared = bitmap->events_cleared; return 0; } |