Skip to content

Commit

Permalink
libceph: improve packing in struct ceph_osd_req_op
Browse files Browse the repository at this point in the history
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/4163

Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
  • Loading branch information
Alex Elder committed Feb 18, 2013
1 parent 0774130 commit e7e319a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions include/linux/ceph/osd_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ struct ceph_osd_client {

struct ceph_osd_req_op {
u16 op; /* CEPH_OSD_OP_* */
u32 payload_len;
union {
struct {
u64 offset, length;
Expand All @@ -165,36 +166,36 @@ struct ceph_osd_req_op {
} extent;
struct {
const char *name;
u32 name_len;
const char *val;
u32 name_len;
u32 value_len;
__u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */
__u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */
} xattr;
struct {
const char *class_name;
__u8 class_len;
const char *method_name;
__u8 method_len;
__u8 argc;
const char *indata;
u32 indata_len;
__u8 class_len;
__u8 method_len;
__u8 argc;
} cls;
struct {
u64 cookie, count;
u64 cookie;
u64 count;
} pgls;
struct {
u64 snapid;
} snap;
struct {
u64 cookie;
u64 ver;
__u8 flag;
u32 prot_ver;
u32 timeout;
__u8 flag;
} watch;
};
u32 payload_len;
};

extern int ceph_osdc_init(struct ceph_osd_client *osdc,
Expand Down

0 comments on commit e7e319a

Please sign in to comment.