Skip to content

Commit

Permalink
rbd: set initial capacity in rbd_init_disk()
Browse files Browse the repository at this point in the history
Move the setting of the initial capacity for an rbd image mapping
into rb_init_disk().

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
  • Loading branch information
Alex Elder committed Oct 1, 2012
1 parent 86ff77b commit 12f0294
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)

rbd_dev->disk = disk;

set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);

return 0;
out_disk:
put_disk(disk);
Expand Down Expand Up @@ -2646,7 +2648,6 @@ static ssize_t rbd_add(struct bus_type *bus,

/* Everything's ready. Announce the disk to the world. */

set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
add_disk(rbd_dev->disk);
pr_info("%s: added with size 0x%llx\n", rbd_dev->disk->disk_name,
(unsigned long long) rbd_dev->mapping.size);
Expand Down

0 comments on commit 12f0294

Please sign in to comment.