Skip to content

Commit

Permalink
md: Avoid namespace collision with bitmap API
Browse files Browse the repository at this point in the history
commit e64e4018d572710c44f42c923d4ac059f0a23320 upstream.

bitmap API (include/linux/bitmap.h) has 'bitmap' prefix for its methods.

On the other hand MD bitmap API is special case.
Adding 'md' prefix to it to avoid name space collision.

No functional changes intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Shaohua Li <shli@kernel.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
[only take the bitmap_free change for stable - gregkh]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
andy-shev authored and gregkh committed Jan 29, 2020
1 parent 20c0aa9 commit e9a80d4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
10 changes: 5 additions & 5 deletions drivers/md/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,7 @@ void bitmap_flush(struct mddev *mddev)
/*
* free memory that was allocated
*/
void bitmap_free(struct bitmap *bitmap)
void md_bitmap_free(struct bitmap *bitmap)
{
unsigned long k, pages;
struct bitmap_page *bp;
Expand Down Expand Up @@ -1763,7 +1763,7 @@ void bitmap_free(struct bitmap *bitmap)
kfree(bp);
kfree(bitmap);
}
EXPORT_SYMBOL(bitmap_free);
EXPORT_SYMBOL(md_bitmap_free);

void bitmap_wait_behind_writes(struct mddev *mddev)
{
Expand Down Expand Up @@ -1796,7 +1796,7 @@ void bitmap_destroy(struct mddev *mddev)
if (mddev->thread)
mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT;

bitmap_free(bitmap);
md_bitmap_free(bitmap);
}

/*
Expand Down Expand Up @@ -1887,7 +1887,7 @@ struct bitmap *bitmap_create(struct mddev *mddev, int slot)

return bitmap;
error:
bitmap_free(bitmap);
md_bitmap_free(bitmap);
return ERR_PTR(err);
}

Expand Down Expand Up @@ -1958,7 +1958,7 @@ struct bitmap *get_bitmap_from_slot(struct mddev *mddev, int slot)

rv = bitmap_init_from_disk(bitmap, 0);
if (rv) {
bitmap_free(bitmap);
md_bitmap_free(bitmap);
return ERR_PTR(rv);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/md/bitmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ int bitmap_resize(struct bitmap *bitmap, sector_t blocks,
struct bitmap *get_bitmap_from_slot(struct mddev *mddev, int slot);
int bitmap_copy_from_slot(struct mddev *mddev, int slot,
sector_t *lo, sector_t *hi, bool clear_bits);
void bitmap_free(struct bitmap *bitmap);
void md_bitmap_free(struct bitmap *bitmap);
void bitmap_wait_behind_writes(struct mddev *mddev);
#endif

Expand Down
6 changes: 3 additions & 3 deletions drivers/md/md-cluster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ int cluster_check_sync_size(struct mddev *mddev)
bm_lockres = lockres_init(mddev, str, NULL, 1);
if (!bm_lockres) {
pr_err("md-cluster: Cannot initialize %s\n", str);
bitmap_free(bitmap);
md_bitmap_free(bitmap);
return -1;
}
bm_lockres->flags |= DLM_LKF_NOQUEUE;
Expand All @@ -1142,11 +1142,11 @@ int cluster_check_sync_size(struct mddev *mddev)
sync_size = sb->sync_size;
else if (sync_size != sb->sync_size) {
kunmap_atomic(sb);
bitmap_free(bitmap);
md_bitmap_free(bitmap);
return -1;
}
kunmap_atomic(sb);
bitmap_free(bitmap);
md_bitmap_free(bitmap);
}

return (my_sync_size == sync_size) ? 0 : -1;
Expand Down

0 comments on commit e9a80d4

Please sign in to comment.