aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2012-07-03 17:01:18 -0400
committerSage Weil <sage@inktank.com>2012-07-30 12:30:07 -0400
commitaded07ea9f7de26e352f679910ac057212ea35e3 (patch)
treeb484fe26be904bd60ab2ebcd628fd79eaa9c804d /drivers/block/rbd.c
parent0bed54dc9af4ab75547739a27b64f0fe0aa98756 (diff)
rbd: more symbol renames
Rename variables named "obj" which represent object names so they're consistently 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> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 7a87a8c3fa34..2fe160014f58 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -858,7 +858,7 @@ static int rbd_do_request(struct request *rq,
858 struct rbd_device *rbd_dev, 858 struct rbd_device *rbd_dev,
859 struct ceph_snap_context *snapc, 859 struct ceph_snap_context *snapc,
860 u64 snapid, 860 u64 snapid,
861 const char *obj, u64 ofs, u64 len, 861 const char *object_name, u64 ofs, u64 len,
862 struct bio *bio, 862 struct bio *bio,
863 struct page **pages, 863 struct page **pages,
864 int num_pages, 864 int num_pages,
@@ -894,7 +894,8 @@ static int rbd_do_request(struct request *rq,
894 req_data->coll_index = coll_index; 894 req_data->coll_index = coll_index;
895 } 895 }
896 896
897 dout("rbd_do_request obj=%s ofs=%lld len=%lld\n", obj, len, ofs); 897 dout("rbd_do_request object_name=%s ofs=%lld len=%lld\n",
898 object_name, len, ofs);
898 899
899 down_read(&rbd_dev->header_rwsem); 900 down_read(&rbd_dev->header_rwsem);
900 901
@@ -919,7 +920,7 @@ static int rbd_do_request(struct request *rq,
919 reqhead = req->r_request->front.iov_base; 920 reqhead = req->r_request->front.iov_base;
920 reqhead->snapid = cpu_to_le64(CEPH_NOSNAP); 921 reqhead->snapid = cpu_to_le64(CEPH_NOSNAP);
921 922
922 strncpy(req->r_oid, obj, sizeof(req->r_oid)); 923 strncpy(req->r_oid, object_name, sizeof(req->r_oid));
923 req->r_oid_len = strlen(req->r_oid); 924 req->r_oid_len = strlen(req->r_oid);
924 925
925 layout = &req->r_file_layout; 926 layout = &req->r_file_layout;
@@ -1020,7 +1021,7 @@ static int rbd_req_sync_op(struct rbd_device *rbd_dev,
1020 int flags, 1021 int flags,
1021 struct ceph_osd_req_op *orig_ops, 1022 struct ceph_osd_req_op *orig_ops,
1022 int num_reply, 1023 int num_reply,
1023 const char *obj, 1024 const char *object_name,
1024 u64 ofs, u64 len, 1025 u64 ofs, u64 len,
1025 char *buf, 1026 char *buf,
1026 struct ceph_osd_request **linger_req, 1027 struct ceph_osd_request **linger_req,
@@ -1051,7 +1052,7 @@ static int rbd_req_sync_op(struct rbd_device *rbd_dev,
1051 } 1052 }
1052 1053
1053 ret = rbd_do_request(NULL, rbd_dev, snapc, snapid, 1054 ret = rbd_do_request(NULL, rbd_dev, snapc, snapid,
1054 obj, ofs, len, NULL, 1055 object_name, ofs, len, NULL,
1055 pages, num_pages, 1056 pages, num_pages,
1056 flags, 1057 flags,
1057 ops, 1058 ops,
@@ -1172,7 +1173,7 @@ static int rbd_req_read(struct request *rq,
1172static int rbd_req_sync_read(struct rbd_device *rbd_dev, 1173static int rbd_req_sync_read(struct rbd_device *rbd_dev,
1173 struct ceph_snap_context *snapc, 1174 struct ceph_snap_context *snapc,
1174 u64 snapid, 1175 u64 snapid,
1175 const char *obj, 1176 const char *object_name,
1176 u64 ofs, u64 len, 1177 u64 ofs, u64 len,
1177 char *buf, 1178 char *buf,
1178 u64 *ver) 1179 u64 *ver)
@@ -1182,7 +1183,7 @@ static int rbd_req_sync_read(struct rbd_device *rbd_dev,
1182 CEPH_OSD_OP_READ, 1183 CEPH_OSD_OP_READ,
1183 CEPH_OSD_FLAG_READ, 1184 CEPH_OSD_FLAG_READ,
1184 NULL, 1185 NULL,
1185 1, obj, ofs, len, buf, NULL, ver); 1186 1, object_name, ofs, len, buf, NULL, ver);
1186} 1187}
1187 1188
1188/* 1189/*
@@ -1191,7 +1192,7 @@ static int rbd_req_sync_read(struct rbd_device *rbd_dev,
1191static int rbd_req_sync_notify_ack(struct rbd_device *rbd_dev, 1192static int rbd_req_sync_notify_ack(struct rbd_device *rbd_dev,
1192 u64 ver, 1193 u64 ver,
1193 u64 notify_id, 1194 u64 notify_id,
1194 const char *obj) 1195 const char *object_name)
1195{ 1196{
1196 struct ceph_osd_req_op *ops; 1197 struct ceph_osd_req_op *ops;
1197 int ret; 1198 int ret;
@@ -1205,7 +1206,7 @@ static int rbd_req_sync_notify_ack(struct rbd_device *rbd_dev,
1205 ops[0].watch.flag = 0; 1206 ops[0].watch.flag = 0;
1206 1207
1207 ret = rbd_do_request(NULL, rbd_dev, NULL, CEPH_NOSNAP, 1208 ret = rbd_do_request(NULL, rbd_dev, NULL, CEPH_NOSNAP,
1208 obj, 0, 0, NULL, 1209 object_name, 0, 0, NULL,
1209 NULL, 0, 1210 NULL, 0,
1210 CEPH_OSD_FLAG_READ, 1211 CEPH_OSD_FLAG_READ,
1211 ops, 1212 ops,
@@ -1241,7 +1242,7 @@ static void rbd_watch_cb(u64 ver, u64 notify_id, u8 opcode, void *data)
1241 * Request sync osd watch 1242 * Request sync osd watch
1242 */ 1243 */
1243static int rbd_req_sync_watch(struct rbd_device *rbd_dev, 1244static int rbd_req_sync_watch(struct rbd_device *rbd_dev,
1244 const char *obj, 1245 const char *object_name,
1245 u64 ver) 1246 u64 ver)
1246{ 1247{
1247 struct ceph_osd_req_op *ops; 1248 struct ceph_osd_req_op *ops;
@@ -1265,7 +1266,7 @@ static int rbd_req_sync_watch(struct rbd_device *rbd_dev,
1265 0, 1266 0,
1266 CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK, 1267 CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
1267 ops, 1268 ops,
1268 1, obj, 0, 0, NULL, 1269 1, object_name, 0, 0, NULL,
1269 &rbd_dev->watch_request, NULL); 1270 &rbd_dev->watch_request, NULL);
1270 1271
1271 if (ret < 0) 1272 if (ret < 0)
@@ -1286,7 +1287,7 @@ fail:
1286 * Request sync osd unwatch 1287 * Request sync osd unwatch
1287 */ 1288 */
1288static int rbd_req_sync_unwatch(struct rbd_device *rbd_dev, 1289static int rbd_req_sync_unwatch(struct rbd_device *rbd_dev,
1289 const char *obj) 1290 const char *object_name)
1290{ 1291{
1291 struct ceph_osd_req_op *ops; 1292 struct ceph_osd_req_op *ops;
1292 1293
@@ -1303,7 +1304,7 @@ static int rbd_req_sync_unwatch(struct rbd_device *rbd_dev,
1303 0, 1304 0,
1304 CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK, 1305 CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
1305 ops, 1306 ops,
1306 1, obj, 0, 0, NULL, NULL, NULL); 1307 1, object_name, 0, 0, NULL, NULL, NULL);
1307 1308
1308 rbd_destroy_ops(ops); 1309 rbd_destroy_ops(ops);
1309 ceph_osdc_cancel_event(rbd_dev->watch_event); 1310 ceph_osdc_cancel_event(rbd_dev->watch_event);
@@ -1330,7 +1331,7 @@ static void rbd_notify_cb(u64 ver, u64 notify_id, u8 opcode, void *data)
1330 * Request sync osd notify 1331 * Request sync osd notify
1331 */ 1332 */
1332static int rbd_req_sync_notify(struct rbd_device *rbd_dev, 1333static int rbd_req_sync_notify(struct rbd_device *rbd_dev,
1333 const char *obj) 1334 const char *object_name)
1334{ 1335{
1335 struct ceph_osd_req_op *ops; 1336 struct ceph_osd_req_op *ops;
1336 struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc; 1337 struct ceph_osd_client *osdc = &rbd_dev->rbd_client->client->osdc;
@@ -1361,7 +1362,7 @@ static int rbd_req_sync_notify(struct rbd_device *rbd_dev,
1361 0, 1362 0,
1362 CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK, 1363 CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
1363 ops, 1364 ops,
1364 1, obj, 0, 0, NULL, NULL, NULL); 1365 1, object_name, 0, 0, NULL, NULL, NULL);
1365 if (ret < 0) 1366 if (ret < 0)
1366 goto fail_event; 1367 goto fail_event;
1367 1368
@@ -1381,25 +1382,25 @@ fail:
1381 * Request sync osd read 1382 * Request sync osd read
1382 */ 1383 */
1383static int rbd_req_sync_exec(struct rbd_device *rbd_dev, 1384static int rbd_req_sync_exec(struct rbd_device *rbd_dev,
1384 const char *obj, 1385 const char *object_name,
1385 const char *cls, 1386 const char *class_name,
1386 const char *method, 1387 const char *method_name,
1387 const char *data, 1388 const char *data,
1388 int len, 1389 int len,
1389 u64 *ver) 1390 u64 *ver)
1390{ 1391{
1391 struct ceph_osd_req_op *ops; 1392 struct ceph_osd_req_op *ops;
1392 int cls_len = strlen(cls); 1393 int class_name_len = strlen(class_name);
1393 int method_len = strlen(method); 1394 int method_name_len = strlen(method_name);
1394 int ret = rbd_create_rw_ops(&ops, 1, CEPH_OSD_OP_CALL, 1395 int ret = rbd_create_rw_ops(&ops, 1, CEPH_OSD_OP_CALL,
1395 cls_len + method_len + len); 1396 class_name_len + method_name_len + len);
1396 if (ret < 0) 1397 if (ret < 0)
1397 return ret; 1398 return ret;
1398 1399
1399 ops[0].cls.class_name = cls; 1400 ops[0].cls.class_name = class_name;
1400 ops[0].cls.class_len = (__u8)cls_len; 1401 ops[0].cls.class_len = (__u8) class_name_len;
1401 ops[0].cls.method_name = method; 1402 ops[0].cls.method_name = method_name;
1402 ops[0].cls.method_len = (__u8)method_len; 1403 ops[0].cls.method_len = (__u8) method_name_len;
1403 ops[0].cls.argc = 0; 1404 ops[0].cls.argc = 0;
1404 ops[0].cls.indata = data; 1405 ops[0].cls.indata = data;
1405 ops[0].cls.indata_len = len; 1406 ops[0].cls.indata_len = len;
@@ -1409,7 +1410,7 @@ static int rbd_req_sync_exec(struct rbd_device *rbd_dev,
1409 0, 1410 0,
1410 CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK, 1411 CEPH_OSD_FLAG_WRITE | CEPH_OSD_FLAG_ONDISK,
1411 ops, 1412 ops,
1412 1, obj, 0, 0, NULL, NULL, ver); 1413 1, object_name, 0, 0, NULL, NULL, ver);
1413 1414
1414 rbd_destroy_ops(ops); 1415 rbd_destroy_ops(ops);
1415 1416