浏览代码

libceph: encode CEPH_OSD_OP_FLAG_* op flags

Encode ceph_osd_op::flags field so that it gets sent over the wire.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Ilya Dryomov 11 年之前
父节点
当前提交
7b25bf5f02
共有 3 个文件被更改,包括 4 次插入1 次删除
  1. 1 0
      include/linux/ceph/osd_client.h
  2. 1 1
      include/linux/ceph/rados.h
  3. 2 0
      net/ceph/osd_client.c

+ 1 - 0
include/linux/ceph/osd_client.h

@@ -76,6 +76,7 @@ struct ceph_osd_data {
 
 
 struct ceph_osd_req_op {
 struct ceph_osd_req_op {
 	u16 op;           /* CEPH_OSD_OP_* */
 	u16 op;           /* CEPH_OSD_OP_* */
+	u32 flags;        /* CEPH_OSD_OP_FLAG_* */
 	u32 payload_len;
 	u32 payload_len;
 	union {
 	union {
 		struct ceph_osd_data raw_data_in;
 		struct ceph_osd_data raw_data_in;

+ 1 - 1
include/linux/ceph/rados.h

@@ -382,7 +382,7 @@ enum {
  */
  */
 struct ceph_osd_op {
 struct ceph_osd_op {
 	__le16 op;           /* CEPH_OSD_OP_* */
 	__le16 op;           /* CEPH_OSD_OP_* */
-	__le32 flags;        /* CEPH_OSD_FLAG_* */
+	__le32 flags;        /* CEPH_OSD_OP_FLAG_* */
 	union {
 	union {
 		struct {
 		struct {
 			__le64 offset, length;
 			__le64 offset, length;

+ 2 - 0
net/ceph/osd_client.c

@@ -688,7 +688,9 @@ static u64 osd_req_encode_op(struct ceph_osd_request *req,
 
 
 		return 0;
 		return 0;
 	}
 	}
+
 	dst->op = cpu_to_le16(src->op);
 	dst->op = cpu_to_le16(src->op);
+	dst->flags = cpu_to_le32(src->flags);
 	dst->payload_len = cpu_to_le32(src->payload_len);
 	dst->payload_len = cpu_to_le32(src->payload_len);
 
 
 	return request_data_len;
 	return request_data_len;