Commit e7e319a9 authored by Alex Elder's avatar Alex Elder

libceph: improve packing in struct ceph_osd_req_op

The layout of struct ceph_osd_req_op leaves lots of holes.
Rearranging things a little for better field alignment
reduces the size by a third.

This resolves:
    http://tracker.ceph.com/issues/4163Signed-off-by: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent 07741308
...@@ -157,6 +157,7 @@ struct ceph_osd_client { ...@@ -157,6 +157,7 @@ struct ceph_osd_client {
struct ceph_osd_req_op { struct ceph_osd_req_op {
u16 op; /* CEPH_OSD_OP_* */ u16 op; /* CEPH_OSD_OP_* */
u32 payload_len;
union { union {
struct { struct {
u64 offset, length; u64 offset, length;
...@@ -165,23 +166,24 @@ struct ceph_osd_req_op { ...@@ -165,23 +166,24 @@ struct ceph_osd_req_op {
} extent; } extent;
struct { struct {
const char *name; const char *name;
u32 name_len;
const char *val; const char *val;
u32 name_len;
u32 value_len; u32 value_len;
__u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */ __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */
__u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */ __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */
} xattr; } xattr;
struct { struct {
const char *class_name; const char *class_name;
__u8 class_len;
const char *method_name; const char *method_name;
__u8 method_len;
__u8 argc;
const char *indata; const char *indata;
u32 indata_len; u32 indata_len;
__u8 class_len;
__u8 method_len;
__u8 argc;
} cls; } cls;
struct { struct {
u64 cookie, count; u64 cookie;
u64 count;
} pgls; } pgls;
struct { struct {
u64 snapid; u64 snapid;
...@@ -189,12 +191,11 @@ struct ceph_osd_req_op { ...@@ -189,12 +191,11 @@ struct ceph_osd_req_op {
struct { struct {
u64 cookie; u64 cookie;
u64 ver; u64 ver;
__u8 flag;
u32 prot_ver; u32 prot_ver;
u32 timeout; u32 timeout;
__u8 flag;
} watch; } watch;
}; };
u32 payload_len;
}; };
extern int ceph_osdc_init(struct ceph_osd_client *osdc, extern int ceph_osdc_init(struct ceph_osd_client *osdc,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment