From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 14/16] rbd: more symbol renames
Date: Wed, 11 Jul 2012 09:02:55 -0500 [thread overview]
Message-ID: <4FFD878F.5030905@inktank.com> (raw)
In-Reply-To: <4FFD847C.7070205@inktank.com>
Rename variables named "obj" which represent object names so they're
consistenly named "object_name".
Rename the "cls" and "method" parameters in rbd_req_sync_exec()
to be "class_name" and "method_name", and make similar changes
to the names of local variables in that function representing
the lengths of those names.
Signed-off-by: Alex Elder <elder@inktank.com>
---
drivers/block/rbd.c | 53
++++++++++++++++++++++++++-------------------------
1 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 14e675c..d29c864 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -857,7 +857,7 @@ static int rbd_do_request(struct request *rq,
struct rbd_device *rbd_dev,
struct ceph_snap_context *snapc,
u64 snapid,
- const char *obj, u64 ofs, u64 len,
+ const char *object_name, u64 ofs, u64 len,
struct bio *bio,
struct page **pages,
int num_pages,
@@ -893,7 +893,8 @@ static int rbd_do_request(struct request *rq,
req_data->coll_index = coll_index;
}
- dout("rbd_do_request obj=%s ofs=%lld len=%lld\n", obj, len, ofs);
+ dout("rbd_do_request object_name=%s ofs=%lld len=%lld\n",
+ object_name, len, ofs);
down_read(&rbd_dev->header_rwsem);
@@ -918,7 +919,7 @@ static int rbd_do_request(struct request *rq,
reqhead = req->r_request->front.iov_base;
reqhead->snapid = cpu_to_le64(CEPH_NOSNAP);
- strncpy(req->r_oid, obj, sizeof(req->r_oid));
+ strncpy(req->r_oid, object_name, sizeof(req->r_oid));
req->r_oid_len = strlen(req->r_oid);
layout = &req->r_file_layout;
@@ -1019,7 +1020,7 @@ static int rbd_req_sync_op(struct rbd_device *rbd_dev,
int flags,
struct ceph_osd_req_op *orig_ops,
int num_reply,
- const char *obj,
+ const char *object_name,
u64 ofs, u64 len,
char *buf,
struct ceph_osd_request **linger_req,
@@ -1050,7 +1051,7 @@ static int rbd_req_sync_op(struct rbd_device *rbd_dev,
}
ret = rbd_do_request(NULL, rbd_dev, snapc, snapid,
- obj, ofs, len, NULL,
+ object_name, ofs, len, NULL,
pages, num_pages,
flags,
ops,
@@ -1171,7 +1172,7 @@ static int rbd_req_read(struct request *rq,
static int rbd_req_sync_read(struct rbd_device *rbd_dev,
struct ceph_snap_context *snapc,
u64 snapid,
- const char *obj,
+ const char *object_name,
u64 ofs, u64 len,
char *buf,
u64 *ver)
@@ -1181,7 +1182,7 @@ static int rbd_req_sync_read(struct rbd_device
*rbd_dev,
CEPH_OSD_OP_READ,
CEPH_OSD_FLAG_READ,
NULL,
- 1, obj, ofs, len, buf, NULL, ver);
+ 1, object_name, ofs, len, buf, NULL, ver);
}
/*
@@ -1190,7 +1191,7 @@ static int rbd_req_sync_read(struct rbd_device
*rbd_dev,
static int rbd_req_sync_notify_ack(struct rbd_device *rbd_dev,
u64 ver,
u64 notify_id,
- const char *obj)
+ const char *object_name)
{
struct ceph_osd_req_op *ops;
int ret;
@@ -1204,7 +1205,7 @@ static int rbd_req_sync_notify_ack(struct
rbd_device *rbd_dev,
ops[0].watch.flag = 0;
ret = rbd_do_request(NULL, rbd_dev, NULL, CEPH_NOSNAP,
- obj, 0, 0, NULL,
+ object_name, 0, 0, NULL,
NULL, 0,
CEPH_OSD_FLAG_READ,
ops,
@@ -1240,7 +1241,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 *obj,
+ const char *object_name,
u64 ver)
{
struct ceph_osd_req_op *ops;
@@ -1264,7 +1265,7 @@ static int rbd_req_sync_watch(struct rbd_device
*rbd_dev,
0,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
ops,
- 1, obj, 0, 0, NULL,
+ 1, object_name, 0, 0, NULL,
&rbd_dev->watch_request, NULL);
if (ret < 0)
@@ -1285,7 +1286,7 @@ fail:
* Request sync osd unwatch
*/
static int rbd_req_sync_unwatch(struct rbd_device *rbd_dev,
- const char *obj)
+ const char *object_name)
{
struct ceph_osd_req_op *ops;
@@ -1302,7 +1303,7 @@ static int rbd_req_sync_unwatch(struct rbd_device
*rbd_dev,
0,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
ops,
- 1, obj, 0, 0, NULL, NULL, NULL);
+ 1, object_name, 0, 0, NULL, NULL, NULL);
rbd_destroy_ops(ops);
ceph_osdc_cancel_event(rbd_dev->watch_event);
@@ -1329,7 +1330,7 @@ static void rbd_notify_cb(u64 ver, u64 notify_id,
u8 opcode, void *data)
* Request sync osd notify
*/
static int rbd_req_sync_notify(struct rbd_device *rbd_dev,
- const char *obj)
+ const char *object_name)
{
struct ceph_osd_req_op *ops;
struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
@@ -1360,7 +1361,7 @@ static int rbd_req_sync_notify(struct rbd_device
*rbd_dev,
0,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
ops,
- 1, obj, 0, 0, NULL, NULL, NULL);
+ 1, object_name, 0, 0, NULL, NULL, NULL);
if (ret < 0)
goto fail_event;
@@ -1380,25 +1381,25 @@ fail:
* Request sync osd read
*/
static int rbd_req_sync_exec(struct rbd_device *rbd_dev,
- const char *obj,
- const char *cls,
- const char *method,
+ const char *object_name,
+ const char *class_name,
+ const char *method_name,
const char *data,
int len,
u64 *ver)
{
struct ceph_osd_req_op *ops;
- int cls_len = strlen(cls);
- int method_len = strlen(method);
+ int class_name_len = strlen(class_name);
+ int method_name_len = strlen(method_name);
int ret = rbd_create_rw_ops(&ops, 1, CEPH_OSD_OP_CALL,
- cls_len + method_len + len);
+ class_name_len + method_name_len + len);
if (ret < 0)
return ret;
- ops[0].cls.class_name = cls;
- ops[0].cls.class_len = (__u8)cls_len;
- ops[0].cls.method_name = method;
- ops[0].cls.method_len = (__u8)method_len;
+ ops[0].cls.class_name = class_name;
+ ops[0].cls.class_len = (__u8) class_name_len;
+ ops[0].cls.method_name = method_name;
+ ops[0].cls.method_len = (__u8) method_name_len;
ops[0].cls.argc = 0;
ops[0].cls.indata = data;
ops[0].cls.indata_len = len;
@@ -1408,7 +1409,7 @@ static int rbd_req_sync_exec(struct rbd_device
*rbd_dev,
0,
CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
ops,
- 1, obj, 0, 0, NULL, NULL, ver);
+ 1, object_name, 0, 0, NULL, NULL, ver);
rbd_destroy_ops(ops);
--
1.7.5.4
next prev parent reply other threads:[~2012-07-11 14:02 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-11 13:49 [PATCH 00/16] rbd: updates and enhancements Alex Elder
2012-07-11 14:00 ` [PATCH 01/16] libceph: fix off-by-one bug in ceph_encode_filepath() Alex Elder
2012-07-11 16:59 ` Yehuda Sadeh
2012-07-11 18:35 ` Josh Durgin
2012-07-11 14:00 ` [PATCH 02/16] rbd: drop a useless local variable Alex Elder
2012-07-11 16:58 ` Yehuda Sadeh Weinraub
2012-07-11 18:36 ` Josh Durgin
2012-07-11 14:00 ` [PATCH 03/16] libceph: define ceph_decode_string() Alex Elder
2012-07-11 17:13 ` Yehuda Sadeh
2012-07-11 18:43 ` Josh Durgin
2012-07-11 22:09 ` [PATCH v2 " Alex Elder
2012-07-12 17:13 ` Alex Elder
2012-07-11 14:01 ` [PATCH 04/16] libceph: define ceph_extract_encoded_string() Alex Elder
2012-07-11 17:20 ` Yehuda Sadeh
2012-07-11 17:45 ` Sage Weil
2012-07-11 19:14 ` Alex Elder
2012-07-11 19:26 ` Yehuda Sadeh
2012-07-11 22:10 ` [PATCH v2 " Alex Elder
2012-07-12 17:13 ` [PATCH v3 " Alex Elder
2012-07-12 18:20 ` Sage Weil
2012-07-12 19:48 ` Alex Elder
2012-07-12 22:47 ` Alex Elder
2012-07-12 22:47 ` [PATCH v4 " Alex Elder
2012-07-11 14:01 ` [PATCH 05/16] rbd: define dup_token() Alex Elder
2012-07-11 17:48 ` Yehuda Sadeh
2012-07-11 21:50 ` Alex Elder
2012-07-11 18:50 ` Josh Durgin
2012-07-11 14:01 ` [PATCH 06/16] rbd: rename rbd_dev->block_name Alex Elder
2012-07-11 17:55 ` Yehuda Sadeh
2012-07-11 19:02 ` Josh Durgin
2012-07-11 22:13 ` Alex Elder
2012-07-11 14:01 ` [PATCH 07/16] rbd: dynamically allocate object prefix Alex Elder
2012-07-11 19:12 ` Josh Durgin
2012-07-11 19:17 ` Alex Elder
2012-07-12 17:24 ` [PATCH v2 " Alex Elder
2012-07-12 17:42 ` Josh Durgin
2012-07-11 14:02 ` [PATCH 08/16] rbd: don't store pool name in struct rbd_dev Alex Elder
2012-07-11 19:36 ` Josh Durgin
2012-07-11 20:19 ` Sage Weil
2012-07-11 22:25 ` Alex Elder
2012-07-11 23:32 ` Josh Durgin
2012-07-12 2:59 ` Alex Elder
2012-07-12 4:19 ` Josh Durgin
2012-07-12 17:05 ` Alex Elder
2012-07-12 17:05 ` [PATCH] rbd: create pool_id device attribute Alex Elder
2012-07-12 17:16 ` Josh Durgin
2012-07-12 17:35 ` Alex Elder
2012-07-12 17:05 ` [PATCH] rbd: dynamically allocate pool name Alex Elder
2012-07-12 17:21 ` Josh Durgin
2012-07-11 14:02 ` [PATCH 09/16] rbd: dynamically allocate image header name Alex Elder
2012-07-11 20:41 ` Josh Durgin
2012-07-11 14:02 ` [PATCH 10/16] rbd: dynamically allocate image name Alex Elder
2012-07-11 20:49 ` Josh Durgin
2012-07-11 20:52 ` Josh Durgin
2012-07-12 11:12 ` Alex Elder
2012-07-11 14:02 ` [PATCH 11/16] rbd: dynamically allocate snapshot name Alex Elder
2012-07-11 20:53 ` Josh Durgin
2012-07-11 14:02 ` [PATCH 12/16] rbd: use rbd_dev consistently Alex Elder
2012-07-11 20:56 ` Josh Durgin
2012-07-11 14:02 ` [PATCH 13/16] rbd: rename some fields in struct rbd_dev Alex Elder
2012-07-11 21:01 ` Josh Durgin
2012-07-12 11:14 ` Alex Elder
2012-07-11 14:02 ` Alex Elder [this message]
2012-07-11 21:03 ` [PATCH 14/16] rbd: more symbol renames Josh Durgin
2012-07-12 11:15 ` Alex Elder
2012-07-11 14:03 ` [PATCH 15/16] rbd: option " Alex Elder
2012-07-11 21:07 ` Josh Durgin
2012-07-11 14:03 ` [PATCH 16/16] rbd: kill num_reply parameters Alex Elder
2012-07-11 21:07 ` 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=4FFD878F.5030905@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox