Skip to content

Commit ef1c400

Browse files
YuKuai-huaweiliu-song-6
authored andcommitted
md/md-bitmap: merge md_bitmap_set_pages() into struct bitmap_operations
o that the implementation won't be exposed, and it'll be possible o invent a new bitmap by replacing bitmap_operations. Signed-off-by: Yu Kuai <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Song Liu <[email protected]>
1 parent 3dd9141 commit ef1c400

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

drivers/md/md-bitmap.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2132,11 +2132,10 @@ static int bitmap_copy_from_slot(struct mddev *mddev, int slot, sector_t *low,
21322132
return rv;
21332133
}
21342134

2135-
void md_bitmap_set_pages(struct bitmap *bitmap, unsigned long pages)
2135+
static void bitmap_set_pages(struct bitmap *bitmap, unsigned long pages)
21362136
{
21372137
bitmap->counts.pages = pages;
21382138
}
2139-
EXPORT_SYMBOL_GPL(md_bitmap_set_pages);
21402139

21412140
static int bitmap_get_stats(struct bitmap *bitmap, struct md_bitmap_stats *stats)
21422141
{
@@ -2782,6 +2781,7 @@ static struct bitmap_operations bitmap_ops = {
27822781
.sync_with_cluster = bitmap_sync_with_cluster,
27832782
.get_from_slot = bitmap_get_from_slot,
27842783
.copy_from_slot = bitmap_copy_from_slot,
2784+
.set_pages = bitmap_set_pages,
27852785
};
27862786

27872787
void mddev_set_bitmap_ops(struct mddev *mddev)

drivers/md/md-bitmap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,14 +279,14 @@ struct bitmap_operations {
279279
struct bitmap *(*get_from_slot)(struct mddev *mddev, int slot);
280280
int (*copy_from_slot)(struct mddev *mddev, int slot, sector_t *lo,
281281
sector_t *hi, bool clear_bits);
282+
void (*set_pages)(struct bitmap *bitmap, unsigned long pages);
282283
};
283284

284285
/* the bitmap API */
285286
void mddev_set_bitmap_ops(struct mddev *mddev);
286287

287288
/* these are exported */
288289

289-
void md_bitmap_set_pages(struct bitmap *bitmap, unsigned long pages);
290290
void md_bitmap_free(struct bitmap *bitmap);
291291
void md_bitmap_wait_behind_writes(struct mddev *mddev);
292292

drivers/md/md-cluster.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,7 @@ static int resize_bitmaps(struct mddev *mddev, sector_t newsize, sector_t oldsiz
11921192
bm_lockres->flags |= DLM_LKF_NOQUEUE;
11931193
rv = dlm_lock_sync(bm_lockres, DLM_LOCK_PW);
11941194
if (!rv)
1195-
md_bitmap_set_pages(bitmap, my_pages);
1195+
mddev->bitmap_ops->set_pages(bitmap, my_pages);
11961196
lockres_free(bm_lockres);
11971197

11981198
if (my_pages != stats.pages)

0 commit comments

Comments
 (0)