Skip to content

Commit

Permalink
badblocks: rename badblocks_free to badblocks_exit
Browse files Browse the repository at this point in the history
For symmetry with badblocks_init() make it clear that this path only
destroys incremental allocations of a badblocks instance, and does not
free the badblocks instance itself.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
  • Loading branch information
Dan Williams committed Jan 9, 2016
1 parent ad9a8bd commit d3b407f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions block/badblocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,12 +550,12 @@ int badblocks_init(struct badblocks *bb, int enable)
EXPORT_SYMBOL_GPL(badblocks_init);

/**
* badblocks_free() - free the badblocks structure
* badblocks_exit() - free the badblocks structure
* @bb: the badblocks structure that holds all badblock information
*/
void badblocks_free(struct badblocks *bb)
void badblocks_exit(struct badblocks *bb)
{
kfree(bb->page);
bb->page = NULL;
}
EXPORT_SYMBOL_GPL(badblocks_free);
EXPORT_SYMBOL_GPL(badblocks_exit);
2 changes: 1 addition & 1 deletion block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ void del_gendisk(struct gendisk *disk)
blk_unregister_region(disk_devt(disk), disk->minors);

if (disk->bb) {
badblocks_free(disk->bb);
badblocks_exit(disk->bb);
kfree(disk->bb);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/md/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ void md_rdev_clear(struct md_rdev *rdev)
put_page(rdev->bb_page);
rdev->bb_page = NULL;
}
badblocks_free(&rdev->badblocks);
badblocks_exit(&rdev->badblocks);
}
EXPORT_SYMBOL_GPL(md_rdev_clear);

Expand Down
2 changes: 1 addition & 1 deletion include/linux/badblocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ ssize_t badblocks_show(struct badblocks *bb, char *page, int unack);
ssize_t badblocks_store(struct badblocks *bb, const char *page, size_t len,
int unack);
int badblocks_init(struct badblocks *bb, int enable);
void badblocks_free(struct badblocks *bb);
void badblocks_exit(struct badblocks *bb);

#endif

0 comments on commit d3b407f

Please sign in to comment.