aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-08-29 18:11:07 -0400
committerAlex Elder <elder@inktank.com>2012-10-01 15:30:52 -0400
commit12f029448c3d73e0f30bc5aee5964442aa95c0f4 (patch)
tree7a4040f3cd518d82f9a774eb6a5e33a7d242894d /drivers/block
parent86ff77bb68c6cda783b195a260f68fd5d32f7aaf (diff)
rbd: set initial capacity in rbd_init_disk()
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>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index fa99b94b9dbb..3274943b2342 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1901,6 +1901,8 @@ static int rbd_init_disk(struct rbd_device *rbd_dev)
1901 1901
1902 rbd_dev->disk = disk; 1902 rbd_dev->disk = disk;
1903 1903
1904 set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
1905
1904 return 0; 1906 return 0;
1905out_disk: 1907out_disk:
1906 put_disk(disk); 1908 put_disk(disk);
@@ -2646,7 +2648,6 @@ static ssize_t rbd_add(struct bus_type *bus,
2646 2648
2647 /* Everything's ready. Announce the disk to the world. */ 2649 /* Everything's ready. Announce the disk to the world. */
2648 2650
2649 set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
2650 add_disk(rbd_dev->disk); 2651 add_disk(rbd_dev->disk);
2651 pr_info("%s: added with size 0x%llx\n", rbd_dev->disk->disk_name, 2652 pr_info("%s: added with size 0x%llx\n", rbd_dev->disk->disk_name,
2652 (unsigned long long) rbd_dev->mapping.size); 2653 (unsigned long long) rbd_dev->mapping.size);