From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 4/7] rbd: drop "object_name" from rbd_req_sync_watch()
Date: Thu, 26 Jul 2012 13:57:34 -0500 [thread overview]
Message-ID: <5011931E.8040409@inktank.com> (raw)
In-Reply-To: <50119076.1030307@inktank.com>
rbd_req_sync_watch() is only called in one place, and in that place
it passes rbd_dev->header_name as the value of the "object_name"
parameter. This value is available within the function already.
Having the extra parameter leaves the impression the object name
could take on different values, but it does not.
So get rid of the parameter. We can always add it back again if
we find we want to watch some other object in the future.
Signed-off-by: Alex Elder <elder@inktank.com>
---
drivers/block/rbd.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index a748448..5cfeeaf 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -1236,9 +1236,7 @@ static void rbd_watch_cb(u64 ver, u64 notify_id,
u8 opcode, void *data)
/*
* Request sync osd watch
*/
-static int rbd_req_sync_watch(struct rbd_device *rbd_dev,
- const char *object_name,
- u64 ver)
+static int rbd_req_sync_watch(struct rbd_device *rbd_dev)
{
struct ceph_osd_req_op *ops;
struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
@@ -1252,7 +1250,7 @@ static int rbd_req_sync_watch(struct rbd_device
*rbd_dev,
if (ret < 0)
goto fail;
- ops[0].watch.ver = cpu_to_le64(ver);
+ ops[0].watch.ver = cpu_to_le64(rbd_dev->header.obj_version);
ops[0].watch.cookie = cpu_to_le64(rbd_dev->watch_event->cookie);
ops[0].watch.flag = 1;
@@ -1261,7 +1259,8 @@ static int rbd_req_sync_watch(struct rbd_device
*rbd_dev,
0,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
ops,
- object_name, 0, 0, NULL,
+ rbd_dev->header_name,
+ 0, 0, NULL,
&rbd_dev->watch_request, NULL);
if (ret < 0)
@@ -2186,8 +2185,7 @@ static int rbd_init_watch_dev(struct rbd_device
*rbd_dev)
int ret, rc;
do {
- ret = rbd_req_sync_watch(rbd_dev, rbd_dev->header_name,
- rbd_dev->header.obj_version);
+ ret = rbd_req_sync_watch(rbd_dev);
if (ret == -ERANGE) {
mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
rc = __rbd_refresh_header(rbd_dev);
--
1.7.9.5
next prev parent reply other threads:[~2012-07-26 18:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-26 18:46 [PATCH 0/7] rbd: drop unused parameters from functions Alex Elder
2012-07-26 18:57 ` [PATCH 1/7] rbd: snapc is unused in rbd_req_sync_read() Alex Elder
2012-07-26 18:57 ` [PATCH 2/7] rbd: drop rbd_header_from_disk() gfp_flags parameter Alex Elder
2012-07-26 18:57 ` [PATCH 3/7] rbd: drop rbd_dev parameter in snap functions Alex Elder
2012-07-26 18:57 ` Alex Elder [this message]
2012-07-26 18:57 ` [PATCH 5/7] rbd: drop "object_name" from rbd_req_sync_notify() Alex Elder
2012-07-26 18:57 ` [PATCH 6/7] rbd: drop "object_name" from rbd_req_sync_notify_ack() Alex Elder
2012-07-26 18:57 ` [PATCH 7/7] rbd: drop "object_name" from rbd_req_sync_unwatch() Alex Elder
2012-07-26 19:35 ` [PATCH 0/7] rbd: drop unused parameters from functions Josh Durgin
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=5011931E.8040409@inktank.com \
--to=elder@inktank.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.