From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:44818 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727979AbeK2Cq5 (ORCPT ); Wed, 28 Nov 2018 21:46:57 -0500 Date: Wed, 28 Nov 2018 16:44:50 +0100 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , Matthew Bobrowski , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v3 05/13] fanotify: classify events that hold a file identifier Message-ID: <20181128154450.GK15604@quack2.suse.cz> References: <20181125134352.21499-1-amir73il@gmail.com> <20181125134352.21499-6-amir73il@gmail.com> <20181128153312.GJ15604@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181128153312.GJ15604@quack2.suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: Sorry, sent previous reply too early. On Wed 28-11-18 16:33:12, Jan Kara wrote: > @@ -38,6 +50,21 @@ struct fanotify_event { > struct pid *pid; > }; > > +/* > + * Bit 0 of info.flags is set when event has fid information. > + * event->info shares the same union address with event->path, so this helps > + * us tell if event has fid or path. > + */ > +#define __FANOTIFY_FID 1UL > +#define FANOTIFY_HAS_FID(event) ((event)->info.flags & __FANOTIFY_FID) Why isn't this an inline function? And then the name wouldn't have to be all caps... Also I'd prefer if we just enlarged struct fanotify_event by 8 bytes to allow simple 'flags' field and info about possible embedded fid, rather than playing these bit tricks. They save space but make code more subtle and I don't file struct fanotify_event size so critical. Honza -- Jan Kara SUSE Labs, CR