aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-02-08 10:55:48 -0500
committerAlex Elder <elder@inktank.com>2013-02-19 20:14:03 -0500
commitfbfab53966b279f9cdb36b96ffa1e22f042c96ff (patch)
tree4f3acf06a4dd61eeeee16119b5f65290c4200bde /net
parentef06f4d32ae5b656f17b53ee3f3c43471a11cc73 (diff)
libceph: allow STAT osd operations
Add support for CEPH_OSD_OP_STAT operations in the osd client and in rbd. This operation sends no data to the osd; everything required is encoded in identity of the target object. The result will be ENOENT if the object doesn't exist. If it does exist and no other error occurs the server returns the size and last modification time of the target object as output data (in little endian format). The size is a 64 bit unsigned and the time is ceph_timespec structure (two unsigned 32-bit integers, representing a seconds and nanoseconds value). This resolves: http://tracker.ceph.com/issues/4007 Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'net')
-rw-r--r--net/ceph/osd_client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
index b58748ec405d..39629b66f3b1 100644
--- a/net/ceph/osd_client.c
+++ b/net/ceph/osd_client.c
@@ -220,6 +220,8 @@ static void osd_req_encode_op(struct ceph_osd_request *req,
220 dst->op = cpu_to_le16(src->op); 220 dst->op = cpu_to_le16(src->op);
221 221
222 switch (src->op) { 222 switch (src->op) {
223 case CEPH_OSD_OP_STAT:
224 break;
223 case CEPH_OSD_OP_READ: 225 case CEPH_OSD_OP_READ:
224 case CEPH_OSD_OP_WRITE: 226 case CEPH_OSD_OP_WRITE:
225 dst->extent.offset = 227 dst->extent.offset =
@@ -255,7 +257,6 @@ static void osd_req_encode_op(struct ceph_osd_request *req,
255 pr_err("unrecognized osd opcode %d\n", dst->op); 257 pr_err("unrecognized osd opcode %d\n", dst->op);
256 WARN_ON(1); 258 WARN_ON(1);
257 break; 259 break;
258 case CEPH_OSD_OP_STAT:
259 case CEPH_OSD_OP_MAPEXT: 260 case CEPH_OSD_OP_MAPEXT:
260 case CEPH_OSD_OP_MASKTRUNC: 261 case CEPH_OSD_OP_MASKTRUNC:
261 case CEPH_OSD_OP_SPARSE_READ: 262 case CEPH_OSD_OP_SPARSE_READ: