Browse Source

rbd: fix snapshot size type

Snapshot sizes should be the same type as regular image sizes. This
only affects their displayed size in sysfs, not the reported size of
an actual block device sizes.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Reviewed-by: Alex Elder <elder@dreamhost.com>
Reviewed-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Josh Durgin 13 years ago
parent
commit
3591538fb2
1 changed files with 3 additions and 3 deletions
  1. 3 3
      drivers/block/rbd.c

+ 3 - 3
drivers/block/rbd.c

@@ -141,7 +141,7 @@ struct rbd_request {
 struct rbd_snap {
 struct rbd_snap {
 	struct	device		dev;
 	struct	device		dev;
 	const char		*name;
 	const char		*name;
-	size_t			size;
+	u64			size;
 	struct list_head	node;
 	struct list_head	node;
 	u64			id;
 	u64			id;
 };
 };
@@ -1935,7 +1935,7 @@ static ssize_t rbd_snap_size_show(struct device *dev,
 {
 {
 	struct rbd_snap *snap = container_of(dev, struct rbd_snap, dev);
 	struct rbd_snap *snap = container_of(dev, struct rbd_snap, dev);
 
 
-	return sprintf(buf, "%zd\n", snap->size);
+	return sprintf(buf, "%llu\n", (unsigned long long)snap->size);
 }
 }
 
 
 static ssize_t rbd_snap_id_show(struct device *dev,
 static ssize_t rbd_snap_id_show(struct device *dev,
@@ -1944,7 +1944,7 @@ static ssize_t rbd_snap_id_show(struct device *dev,
 {
 {
 	struct rbd_snap *snap = container_of(dev, struct rbd_snap, dev);
 	struct rbd_snap *snap = container_of(dev, struct rbd_snap, dev);
 
 
-	return sprintf(buf, "%llu\n", (unsigned long long) snap->id);
+	return sprintf(buf, "%llu\n", (unsigned long long)snap->id);
 }
 }
 
 
 static DEVICE_ATTR(snap_size, S_IRUGO, rbd_snap_size_show, NULL);
 static DEVICE_ATTR(snap_size, S_IRUGO, rbd_snap_size_show, NULL);