From patchwork Sat Feb 16 16:24:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 2151791 Return-Path: X-Original-To: patchwork-ceph-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 78A27DF2A1 for ; Sat, 16 Feb 2013 16:24:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753582Ab3BPQYw (ORCPT ); Sat, 16 Feb 2013 11:24:52 -0500 Received: from mail-qc0-f179.google.com ([209.85.216.179]:59969 "EHLO mail-qc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753559Ab3BPQYw (ORCPT ); Sat, 16 Feb 2013 11:24:52 -0500 Received: by mail-qc0-f179.google.com with SMTP id b40so1565369qcq.38 for ; Sat, 16 Feb 2013 08:24:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding:x-gm-message-state; bh=E9wzLoajYvKt9gLvn0xprrp6v+11o2R4ipIYQM2+nOo=; b=BIGcIm8Zk/uE8iG7jUSufMqpGcWZFY2xj3N+R3lbaZknlX2+egtA5/mkuCblM47/Ud DL3pi+CshDsIFTsdDdzejmhpmhXMvnBihCbDOKAxVK2xZftOKFQytSgSxp94mQqCnom3 wMrXg2T1jCbHUkpkIA2ud2dpRdsg/JccVAn25xvZ1gbP3hG4iRyNd6+yCME9NxA8R4to u9dG3MeAl0XNzTkPXCOFg6M870gUg+eVgS8SCstuco3/OYkvRpnCyGqeAP98j1HoDY1F f4ZRo1RcqiWmaI0a5ftcter5pp+WtxAx205mg+27V87tD8s6dDOpnEODxuYoqkDuTetN 41qg== X-Received: by 10.224.178.77 with SMTP id bl13mr3368145qab.13.1361031891584; Sat, 16 Feb 2013 08:24:51 -0800 (PST) Received: from [172.22.22.4] (c-71-195-31-37.hsd1.mn.comcast.net. [71.195.31.37]) by mx.google.com with ESMTPS id df6sm21191505qab.6.2013.02.16.08.24.49 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 16 Feb 2013 08:24:50 -0800 (PST) Message-ID: <511FB2D1.4090306@inktank.com> Date: Sat, 16 Feb 2013 10:24:49 -0600 From: Alex Elder User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-Version: 1.0 To: ceph-devel@vger.kernel.org Subject: [PATCH] libceph: improve packing in struct ceph_osd_req_op X-Gm-Message-State: ALoCoQlObYsXexRqw0ayGk1BP9Tt8jI20eafwGfujON0fzqwroWR7Pj8K6rTJy+VeoNZ497XAW2m Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org 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 Reviewed-by: Josh Durgin --- 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,