summaryrefslogtreecommitdiffstats
path: root/fs/ceph/osd_client.c
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@hq.newdream.net>2010-05-19 01:38:08 +0200
committerSage Weil <sage@newdream.net>2010-10-21 00:37:25 +0200
commitae1533b62b3369e6ae32338f4a77d64d0e88f676 (patch)
tree9a54b1c1c8a52a4ae46bc0c5421d04e93ac6495f /fs/ceph/osd_client.c
parentceph: messenger and osdc changes for rbd (diff)
downloadlinux-ae1533b62b3369e6ae32338f4a77d64d0e88f676.tar.xz
linux-ae1533b62b3369e6ae32338f4a77d64d0e88f676.zip
ceph-rbd: osdc support for osd call and rollback operations
This will be used for rbd snapshots administration. Signed-off-by: Yehuda Sadeh <yehuda@hq.newdream.net>
Diffstat (limited to 'fs/ceph/osd_client.c')
-rw-r--r--fs/ceph/osd_client.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/fs/ceph/osd_client.c b/fs/ceph/osd_client.c
index c5d818e73add..0edb43f1ef26 100644
--- a/fs/ceph/osd_client.c
+++ b/fs/ceph/osd_client.c
@@ -161,6 +161,7 @@ static int op_needs_trail(int op)
case CEPH_OSD_OP_GETXATTR:
case CEPH_OSD_OP_SETXATTR:
case CEPH_OSD_OP_CMPXATTR:
+ case CEPH_OSD_OP_CALL:
return 1;
default:
return 0;
@@ -301,6 +302,23 @@ static void osd_req_encode_op(struct ceph_osd_request *req,
ceph_pagelist_append(req->r_trail, src->xattr.val,
src->xattr.value_len);
break;
+ case CEPH_OSD_OP_CALL:
+ BUG_ON(!req->r_trail);
+
+ dst->cls.class_len = src->cls.class_len;
+ dst->cls.method_len = src->cls.method_len;
+ dst->cls.indata_len = cpu_to_le32(src->cls.indata_len);
+
+ ceph_pagelist_append(req->r_trail, src->cls.class_name,
+ src->cls.class_len);
+ ceph_pagelist_append(req->r_trail, src->cls.method_name,
+ src->cls.method_len);
+ ceph_pagelist_append(req->r_trail, src->cls.indata,
+ src->cls.indata_len);
+ break;
+ case CEPH_OSD_OP_ROLLBACK:
+ dst->snap.snapid = cpu_to_le64(src->snap.snapid);
+ break;
case CEPH_OSD_OP_STARTSYNC:
break;
default: