From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2A79C4BA24 for ; Thu, 27 Feb 2020 13:30:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C4D6A2469F for ; Thu, 27 Feb 2020 13:30:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729214AbgB0NaS (ORCPT ); Thu, 27 Feb 2020 08:30:18 -0500 Received: from mx2.suse.de ([195.135.220.15]:57982 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729110AbgB0NaS (ORCPT ); Thu, 27 Feb 2020 08:30:18 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id CFE3EB061; Thu, 27 Feb 2020 13:30:16 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 89D241E0E88; Thu, 27 Feb 2020 14:30:16 +0100 (CET) Date: Thu, 27 Feb 2020 14:30:16 +0100 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , linux-fsdevel Subject: Re: [PATCH v2 11/16] fanotify: prepare to encode both parent and child fid's Message-ID: <20200227133016.GD10728@quack2.suse.cz> References: <20200217131455.31107-1-amir73il@gmail.com> <20200217131455.31107-12-amir73il@gmail.com> <20200226102354.GE10728@quack2.suse.cz> <20200226170705.GU10728@quack2.suse.cz> <20200227112755.GZ10728@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Thu 27-02-20 14:12:30, Amir Goldstein wrote: > > > > > struct fanotify_fh_name { > > > union { > > > struct { > > > u8 fh_type; > > > u8 fh_len; > > > u8 name_len; > > > u32 hash; > > > }; > > > u64 hash_len; > > > }; > > > union { > > > unsigned char fh[FANOTIFY_INLINE_FH_LEN]; > > > unsigned char *ext_fh; > > > }; > > > char name[0]; > > > }; > > > > So based on the above I wouldn't add just name hash to fanotify_fh_name at > > this point... > > > > OK. but what do you think about tying name with fh as above? > At least name_len gets to use the hole this way. Is saving that one byte for name_len really worth the packing? If anything, I'd rather do the fanotity_fh padding optimization I outlined in another email. That would save one long without any packing and the following u8 name_len would get packed tightly after the fanotify_fh by the compiler. Honza -- Jan Kara SUSE Labs, CR