]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
md/md-bitmap: introduce struct bitmap_operations
authorYu Kuai <yukuai3@huawei.com>
Mon, 26 Aug 2024 07:44:21 +0000 (15:44 +0800)
committerSong Liu <song@kernel.org>
Tue, 27 Aug 2024 17:14:15 +0000 (10:14 -0700)
The structure is empty for now, and will be used in later patches to
merge in bitmap operations, so that bitmap implementation won't be
exposed.

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240826074452.1490072-12-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
drivers/md/md.h

index 015997b4b83526eb36cbf62dd371398be17a239f..69d9c959fe49a81db11c1c6791a32a7df07ebe5f 100644 (file)
@@ -2714,3 +2714,11 @@ const struct attribute_group md_bitmap_group = {
        .name = "bitmap",
        .attrs = md_bitmap_attrs,
 };
+
+static struct bitmap_operations bitmap_ops = {
+};
+
+void mddev_set_bitmap_ops(struct mddev *mddev)
+{
+       mddev->bitmap_ops = &bitmap_ops;
+}
index c4d64311c0e812dcb5dd055c0a2dfff2549c0c2b..14c21ab42f9ed743d8ad22816722de977683b74e 100644 (file)
@@ -246,7 +246,11 @@ struct md_bitmap_stats {
        struct file     *file;
 };
 
+struct bitmap_operations {
+};
+
 /* the bitmap API */
+void mddev_set_bitmap_ops(struct mddev *mddev);
 
 /* these are used only by md/bitmap */
 struct bitmap *md_bitmap_create(struct mddev *mddev, int slot);
index 06c0918111e32fe40d063a81656e3a9df2795b29..f86e6911318f91ae8380ca5409be63197800f4fb 100644 (file)
@@ -772,6 +772,7 @@ int mddev_init(struct mddev *mddev)
        mddev->resync_min = 0;
        mddev->resync_max = MaxSector;
        mddev->level = LEVEL_NONE;
+       mddev_set_bitmap_ops(mddev);
 
        INIT_WORK(&mddev->sync_work, md_start_sync);
        INIT_WORK(&mddev->del_work, mddev_delayed_delete);
index a0d6827dced9b79fcaba188e8ddb7c0d71b656e5..e56193f71ab4e30f10671b56e438f75fb5d50ddf 100644 (file)
@@ -536,6 +536,7 @@ struct mddev {
        int                             sync_checkers;  /* # of threads checking writes_pending */
 
        struct bitmap                   *bitmap; /* the bitmap for the device */
+       struct bitmap_operations        *bitmap_ops;
        struct {
                struct file             *file; /* the bitmap file */
                loff_t                  offset; /* offset from superblock of