diff mbox

[8/9] rbd: set initial capacity in rbd_init_disk()

Message ID 504A1695.8060504@inktank.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Elder Sept. 7, 2012, 3:45 p.m. UTC
Move the setting of the initial capacity for an rbd image mapping
into rb_init_disk().

Signed-off-by: Alex Elder <elder@inktank.com>
---
 drivers/block/rbd.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Josh Durgin Sept. 11, 2012, 3:07 p.m. UTC | #1
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>

On 09/07/2012 08:45 AM, Alex Elder wrote:
> Move the setting of the initial capacity for an rbd image mapping
> into rb_init_disk().
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
>   drivers/block/rbd.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index e6af38f..51e1d21 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)
>
>   	rbd_dev->disk = disk;
>
> +	set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
> +
>   	return 0;
>   out_disk:
>   	put_disk(disk);
> @@ -2642,7 +2644,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);
>

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index e6af38f..51e1d21 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)

 	rbd_dev->disk = disk;

+	set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
+
 	return 0;
 out_disk:
 	put_disk(disk);
@@ -2642,7 +2644,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);