diff options
| author | Alex Elder <elder@inktank.com> | 2013-02-14 13:16:43 -0500 |
|---|---|---|
| committer | Alex Elder <elder@inktank.com> | 2013-02-18 13:19:07 -0500 |
| commit | e7e319a9c51409c7effe34333ea26facf2fab9e1 (patch) | |
| tree | e02db746bd2386ee0e8b82298ba5ec1f455e5217 /include/linux/ceph | |
| parent | 077413082f9ade9ca4d9774dbdc81ee7256d8089 (diff) | |
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/4163
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'include/linux/ceph')
| -rw-r--r-- | include/linux/ceph/osd_client.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/include/linux/ceph/osd_client.h b/include/linux/ceph/osd_client.h index 69287ccfe68a..82bf6338d6c1 100644 --- a/include/linux/ceph/osd_client.h +++ b/include/linux/ceph/osd_client.h | |||
| @@ -157,6 +157,7 @@ struct ceph_osd_client { | |||
| 157 | 157 | ||
| 158 | struct ceph_osd_req_op { | 158 | struct ceph_osd_req_op { |
| 159 | u16 op; /* CEPH_OSD_OP_* */ | 159 | u16 op; /* CEPH_OSD_OP_* */ |
| 160 | u32 payload_len; | ||
| 160 | union { | 161 | union { |
| 161 | struct { | 162 | struct { |
| 162 | u64 offset, length; | 163 | u64 offset, length; |
| @@ -165,23 +166,24 @@ struct ceph_osd_req_op { | |||
| 165 | } extent; | 166 | } extent; |
| 166 | struct { | 167 | struct { |
| 167 | const char *name; | 168 | const char *name; |
| 168 | u32 name_len; | ||
| 169 | const char *val; | 169 | const char *val; |
| 170 | u32 name_len; | ||
| 170 | u32 value_len; | 171 | u32 value_len; |
| 171 | __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */ | 172 | __u8 cmp_op; /* CEPH_OSD_CMPXATTR_OP_* */ |
| 172 | __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */ | 173 | __u8 cmp_mode; /* CEPH_OSD_CMPXATTR_MODE_* */ |
| 173 | } xattr; | 174 | } xattr; |
| 174 | struct { | 175 | struct { |
| 175 | const char *class_name; | 176 | const char *class_name; |
| 176 | __u8 class_len; | ||
| 177 | const char *method_name; | 177 | const char *method_name; |
| 178 | __u8 method_len; | ||
| 179 | __u8 argc; | ||
| 180 | const char *indata; | 178 | const char *indata; |
| 181 | u32 indata_len; | 179 | u32 indata_len; |
| 180 | __u8 class_len; | ||
| 181 | __u8 method_len; | ||
| 182 | __u8 argc; | ||
| 182 | } cls; | 183 | } cls; |
| 183 | struct { | 184 | struct { |
| 184 | u64 cookie, count; | 185 | u64 cookie; |
| 186 | u64 count; | ||
| 185 | } pgls; | 187 | } pgls; |
| 186 | struct { | 188 | struct { |
| 187 | u64 snapid; | 189 | u64 snapid; |
| @@ -189,12 +191,11 @@ struct ceph_osd_req_op { | |||
| 189 | struct { | 191 | struct { |
| 190 | u64 cookie; | 192 | u64 cookie; |
| 191 | u64 ver; | 193 | u64 ver; |
| 192 | __u8 flag; | ||
| 193 | u32 prot_ver; | 194 | u32 prot_ver; |
| 194 | u32 timeout; | 195 | u32 timeout; |
| 196 | __u8 flag; | ||
| 195 | } watch; | 197 | } watch; |
| 196 | }; | 198 | }; |
| 197 | u32 payload_len; | ||
| 198 | }; | 199 | }; |
| 199 | 200 | ||
| 200 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, | 201 | extern int ceph_osdc_init(struct ceph_osd_client *osdc, |
