Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp484042pxb; Tue, 19 Oct 2021 06:59:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZgjQ1nzkA5r0KYGpPLIRgOi7LBP8k6Mq+dZNktqb+CLbZjNkKezhDdssmDKFVbFNhegYF X-Received: by 2002:a17:902:d885:b0:13f:c50f:9ac with SMTP id b5-20020a170902d88500b0013fc50f09acmr9335935plz.53.1634651955150; Tue, 19 Oct 2021 06:59:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634651955; cv=none; d=google.com; s=arc-20160816; b=AVFWllXm+0N0sCOfu0Pg5WFlKvzjkuR0Tzt57mQr8OF3hMRX5m3/wfZGg0Lmy7IqdG BycItAWNSkilhXQ74SkmYvhx10YFshsxXh2a9Zohh9zJHVRRwQqNy6owhCBlPbBFYdR4 VbsNcYYYbAzw/bhMSbUXC/4SMza3535LKjmOEuOsoG1S0Wy282GEPFWqhR3mIyKxbN/9 nfXrAyVLc0TtmenMM3pKGJdGla0edHwmxQw25LZcA94DLTQzAAfXlm+R0nOZFHpOW0mq 2Meyfqz4OjcLgqTlDlJLnomQwkSvXZvgfFJrJh1luVauZvrwBwx4N4QbF3uuamo4Q31d bF1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=abLU67Y73wTxtGcuo7U/jTnXBkUbjKwZiGMqSHa4lp0=; b=c0fUx5wTZZEp3xihQXGfVY+MINyaLExv0JFxSeL++e3eu35FOs4Y1pVbEoD2Ytkae2 Rd0MfPyfhoXVL5iHCubkFmBQftgkaPoa8dsd5SDaVyHRyhZOPL58zTAC7ihUVTbZTXh2 gZVfrJD7ITJj525xlJe/WELTfICahMSg9W8BW5Ysg1BGa7mrPK34XUER6c6c/Wb/TL3L 0wqXXAPaH/4eaAC03DeBW8IEdYhBetFL0xiq45SiN/03yJyoHD3rwGbKgOBD/A0rpY0G dWEIpHCCgLSdwxZjnC/p/Tvvsu5gbF+PVyq/QMt5FmZtIYXn4R4reyA42+yUF3lBJ6uc sXTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="MFVv/sMF"; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l185si1369939pgd.558.2021.10.19.06.59.02; Tue, 19 Oct 2021 06:59:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="MFVv/sMF"; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235691AbhJSOAv (ORCPT + 99 others); Tue, 19 Oct 2021 10:00:51 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:58840 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231460AbhJSOAu (ORCPT ); Tue, 19 Oct 2021 10:00:50 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id E00771FD66; Tue, 19 Oct 2021 13:58:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1634651916; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=abLU67Y73wTxtGcuo7U/jTnXBkUbjKwZiGMqSHa4lp0=; b=MFVv/sMFD2ybknsyeCmmca08F6ibvFYkD9cQvfHPi98aXdGjv4iGNWdjD24F9B309wUebX tRj0GJJXtITz9weJSaRxtXKDH0Yl2eFkFhm2bk2E7FuxiR2ktafGUoAo8IAg4qZd2aICse KeC9TjqSl9UfjjvX8I00lH6MnxLcVj0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1634651916; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=abLU67Y73wTxtGcuo7U/jTnXBkUbjKwZiGMqSHa4lp0=; b=eosRPeQGZNZGzTf8LHxo501EwRjXfOMQs1GGqgsdnpus8T1uYhKI5iBmlW/aViNOSDrZff 3nh0msIwMHIhi6Ag== Received: from quack2.suse.cz (unknown [10.100.200.198]) by relay2.suse.de (Postfix) with ESMTP id C72F5A3B83; Tue, 19 Oct 2021 13:58:36 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 99D4E1E0983; Tue, 19 Oct 2021 15:58:36 +0200 (CEST) Date: Tue, 19 Oct 2021 15:58:36 +0200 From: Jan Kara To: Gabriel Krisman Bertazi Cc: jack@suse.com, amir73il@gmail.com, djwong@kernel.org, tytso@mit.edu, david@fromorbit.com, dhowells@redhat.com, khazhy@google.com, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-api@vger.kernel.org, kernel@collabora.com, Jan Kara Subject: Re: [PATCH v8 23/32] fanotify: Wrap object_fh inline space in a creator macro Message-ID: <20211019135836.GL3255@quack2.suse.cz> References: <20211019000015.1666608-1-krisman@collabora.com> <20211019000015.1666608-24-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211019000015.1666608-24-krisman@collabora.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon 18-10-21 21:00:06, Gabriel Krisman Bertazi wrote: > fanotify_error_event would duplicate this sequence of declarations that > already exist elsewhere with a slight different size. Create a helper > macro to avoid code duplication. > > Suggested-by: Jan Kara > Signed-off-by: Gabriel Krisman Bertazi > > --- > Among the suggestions, I think this is simpler because it avoids > deep nesting the variable-sized attribute, which would have been hidden > inside fee->ffe->object_fh.buf. One nit from me as well :) > +#define FANOTIFY_INLINE_FH(size) \ > +struct { \ > + struct fanotify_fh object_fh; \ > + /* Space for object_fh.buf[] - access with fanotify_fh_buf() */ \ > + unsigned char _inline_fh_buf[(size)]; \ > +} > + Can the macro perhaps take the name of the fanotify_fh member it creates? Like: #define FANOTIFY_INLINE_FH(name, size) Harcoding _inline_fh_buf is fine since it isn't ever used directly but hardcoding object_fh looks ugly to me. With that improved feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR