CEPH filesystem development
 help / color / mirror / Atom feed
From: Alex Elder <elder@dreamhost.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 4/6] rbd: fix snapshot size type
Date: Wed, 18 Apr 2012 09:41:09 -0500	[thread overview]
Message-ID: <4F8ED285.7060005@dreamhost.com> (raw)
In-Reply-To: <4F8ED154.6050500@dreamhost.com>

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>
---
  drivers/block/rbd.c |    6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

Index: b/drivers/block/rbd.c
===================================================================
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -141,7 +141,7 @@
  struct rbd_snap {
  	struct	device		dev;
  	const char		*name;
-	size_t			size;
+	u64			size;
  	struct list_head	node;
  	u64			id;
  };
@@ -1936,7 +1936,7 @@
  {
  	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,
@@ -1945,7 +1945,7 @@
  {
  	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);

  parent reply	other threads:[~2012-04-18 14:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-18 14:36 [PATCH 0/6] rbd: updates from Josh Durgin Alex Elder
2012-04-18 14:40 ` [PATCH 1/6] rbd: protect read of snapshot sequence number Alex Elder
2012-04-19 17:35   ` Yehuda Sadeh Weinraub
2012-04-18 14:41 ` [PATCH 2/6] rbd: store snapshot id instead of index Alex Elder
2012-04-19 17:41   ` Yehuda Sadeh Weinraub
2012-04-18 14:41 ` [PATCH 3/6] rbd: remove conditional snapid parameters Alex Elder
2012-04-19 17:58   ` Yehuda Sadeh Weinraub
2012-04-18 14:41 ` Alex Elder [this message]
2012-04-19 18:04   ` [PATCH 4/6] rbd: fix snapshot size type Yehuda Sadeh Weinraub
2012-04-18 14:41 ` [PATCH 5/6] rbd: rename __rbd_update_snaps to __rbd_refresh_header Alex Elder
2012-04-19 18:06   ` Yehuda Sadeh Weinraub
2012-04-18 14:41 ` [PATCH 6/6] rbd: correct sysfs snap attribute documentation Alex Elder
2012-04-19 18:07   ` Yehuda Sadeh Weinraub

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F8ED285.7060005@dreamhost.com \
    --to=elder@dreamhost.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox