CEPH filesystem development
 help / color / mirror / Atom feed
From: Alex Elder <elder@dreamhost.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 5/6] rbd: rename __rbd_update_snaps to __rbd_refresh_header
Date: Wed, 18 Apr 2012 09:41:12 -0500	[thread overview]
Message-ID: <4F8ED288.9010807@dreamhost.com> (raw)
In-Reply-To: <4F8ED154.6050500@dreamhost.com>

This function rereads the entire header and handles any changes in
it, not just changes in snapshots.

Signed-off-by: Josh Durgin <josh.durgin@dreamhost.com>
Reviewed-by: Alex Elder <elder@dreamhost.com>
---
  drivers/block/rbd.c |   12 ++++++------
  1 file changed, 6 insertions(+), 6 deletions(-)

Index: b/drivers/block/rbd.c
===================================================================
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -240,7 +240,7 @@
  	put_device(&rbd_dev->dev);
  }

-static int __rbd_update_snaps(struct rbd_device *rbd_dev);
+static int __rbd_refresh_header(struct rbd_device *rbd_dev);

  static int rbd_open(struct block_device *bdev, fmode_t mode)
  {
@@ -1223,7 +1223,7 @@
  	dout("rbd_watch_cb %s notify_id=%lld opcode=%d\n", dev->obj_md_name,
  		notify_id, (int)opcode);
  	mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
-	rc = __rbd_update_snaps(dev);
+	rc = __rbd_refresh_header(dev);
  	mutex_unlock(&ctl_mutex);
  	if (rc)
  		pr_warning(RBD_DRV_NAME "%d got notification but failed to "
@@ -1690,7 +1690,7 @@
  /*
   * only read the first part of the ondisk header, without the snaps info
   */
-static int __rbd_update_snaps(struct rbd_device *rbd_dev)
+static int __rbd_refresh_header(struct rbd_device *rbd_dev)
  {
  	int ret;
  	struct rbd_image_header h;
@@ -1877,7 +1877,7 @@

  	mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);

-	rc = __rbd_update_snaps(rbd_dev);
+	rc = __rbd_refresh_header(rbd_dev);
  	if (rc < 0)
  		ret = rc;

@@ -2160,7 +2160,7 @@
  					 rbd_dev->header.obj_version);
  		if (ret == -ERANGE) {
  			mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
-			rc = __rbd_update_snaps(rbd_dev);
+			rc = __rbd_refresh_header(rbd_dev);
  			mutex_unlock(&ctl_mutex);
  			if (rc < 0)
  				return rc;
@@ -2545,7 +2545,7 @@
  	if (ret < 0)
  		goto err_unlock;

-	ret = __rbd_update_snaps(rbd_dev);
+	ret = __rbd_refresh_header(rbd_dev);
  	if (ret < 0)
  		goto err_unlock;


  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 ` [PATCH 4/6] rbd: fix snapshot size type Alex Elder
2012-04-19 18:04   ` Yehuda Sadeh Weinraub
2012-04-18 14:41 ` Alex Elder [this message]
2012-04-19 18:06   ` [PATCH 5/6] rbd: rename __rbd_update_snaps to __rbd_refresh_header 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=4F8ED288.9010807@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