]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
md/md-bitmap: merge md_bitmap_daemon_work() into bitmap_operations
authorYu Kuai <yukuai3@huawei.com>
Mon, 26 Aug 2024 07:44:43 +0000 (15:44 +0800)
committerSong Liu <song@kernel.org>
Tue, 27 Aug 2024 19:43:14 +0000 (12:43 -0700)
So that the implementation won't be exposed, and it'll be possible
to invent a new bitmap by replacing bitmap_operations.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240826074452.1490072-34-yukuai1@huaweicloud.com
Signed-off-by: Song Liu <song@kernel.org>
drivers/md/md-bitmap.c
drivers/md/md-bitmap.h
drivers/md/md.c

index 4e6e31e364f68eb400bd2af2de98cd34424c4cef..efe928849c94b234c44f8d7cb45537dde685c72f 100644 (file)
@@ -1298,7 +1298,7 @@ out:
  * bitmap daemon -- periodically wakes up to clean bits and flush pages
  *                     out to disk
  */
-void md_bitmap_daemon_work(struct mddev *mddev)
+static void bitmap_daemon_work(struct mddev *mddev)
 {
        struct bitmap *bitmap;
        unsigned long j;
@@ -1815,11 +1815,11 @@ static void bitmap_flush(struct mddev *mddev)
         */
        sleep = mddev->bitmap_info.daemon_sleep * 2;
        bitmap->daemon_lastrun -= sleep;
-       md_bitmap_daemon_work(mddev);
+       bitmap_daemon_work(mddev);
        bitmap->daemon_lastrun -= sleep;
-       md_bitmap_daemon_work(mddev);
+       bitmap_daemon_work(mddev);
        bitmap->daemon_lastrun -= sleep;
-       md_bitmap_daemon_work(mddev);
+       bitmap_daemon_work(mddev);
        if (mddev->bitmap_info.external)
                md_super_wait(mddev);
        bitmap_update_sb(bitmap);
@@ -2754,6 +2754,7 @@ static struct bitmap_operations bitmap_ops = {
        .write_all              = bitmap_write_all,
        .dirty_bits             = bitmap_dirty_bits,
        .unplug                 = bitmap_unplug,
+       .daemon_work            = bitmap_daemon_work,
 
        .startwrite             = bitmap_startwrite,
        .endwrite               = bitmap_endwrite,
index dbe9b27091f48505a52b457c62ccfb3131819f28..065b36c0c43af2069b3790f9520c89407c5e6a4e 100644 (file)
@@ -255,6 +255,7 @@ struct bitmap_operations {
        void (*dirty_bits)(struct mddev *mddev, unsigned long s,
                           unsigned long e);
        void (*unplug)(struct mddev *mddev, bool sync);
+       void (*daemon_work)(struct mddev *mddev);
 
        int (*startwrite)(struct mddev *mddev, sector_t offset,
                          unsigned long sectors, bool behind);
@@ -278,7 +279,6 @@ struct bitmap_operations {
 void mddev_set_bitmap_ops(struct mddev *mddev);
 
 /* these are exported */
-void md_bitmap_daemon_work(struct mddev *mddev);
 
 int md_bitmap_resize(struct bitmap *bitmap, sector_t blocks,
                     int chunksize, int init);
index b45d9b6456065bc2209e1a25da699fb3174a431c..00932bd9b0c8b7bc1d8af198f8610988cf210789 100644 (file)
@@ -9638,7 +9638,7 @@ static void unregister_sync_thread(struct mddev *mddev)
 void md_check_recovery(struct mddev *mddev)
 {
        if (mddev->bitmap)
-               md_bitmap_daemon_work(mddev);
+               mddev->bitmap_ops->daemon_work(mddev);
 
        if (signal_pending(current)) {
                if (mddev->pers->sync_request && !mddev->external) {