From: Josh Durgin <josh.durgin@inktank.com>
To: Alex Elder <elder@inktank.com>
Cc: ceph-devel@vger.kernel.org
Subject: Re: [PATCH] libceph: improve packing in struct ceph_osd_req_op
Date: Sat, 16 Feb 2013 15:23:19 -0800 [thread overview]
Message-ID: <512014E7.3070104@inktank.com> (raw)
In-Reply-To: <511FB2D1.4090306@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
On 02/16/2013 08:24 AM, Alex Elder wrote:
> 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.
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
> include/linux/ceph/osd_client.h | 15 ++++++++-------
> 1 file changed, 8 insertions(+), 7 deletions(-)
>
> diff --git a/include/linux/ceph/osd_client.h
> b/include/linux/ceph/osd_client.h
> index 69287cc..82bf633 100644
> --- a/include/linux/ceph/osd_client.h
> +++ b/include/linux/ceph/osd_client.h
> @@ -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;
> @@ -165,23 +166,24 @@ 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;
> @@ -189,12 +191,11 @@ struct ceph_osd_req_op {
> 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,
>
prev parent reply other threads:[~2013-02-16 23:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-16 16:24 [PATCH] libceph: improve packing in struct ceph_osd_req_op Alex Elder
2013-02-16 23:23 ` Josh Durgin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=512014E7.3070104@inktank.com \
--to=josh.durgin@inktank.com \
--cc=ceph-devel@vger.kernel.org \
--cc=elder@inktank.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.