From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-f196.google.com ([209.85.219.196]:44509 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728240AbeK2Cyu (ORCPT ); Wed, 28 Nov 2018 21:54:50 -0500 Received: by mail-yb1-f196.google.com with SMTP id p144-v6so10779641yba.11 for ; Wed, 28 Nov 2018 07:52:43 -0800 (PST) MIME-Version: 1.0 References: <20181125134352.21499-1-amir73il@gmail.com> <20181125134352.21499-6-amir73il@gmail.com> <20181128153312.GJ15604@quack2.suse.cz> <20181128154450.GK15604@quack2.suse.cz> In-Reply-To: <20181128154450.GK15604@quack2.suse.cz> From: Amir Goldstein Date: Wed, 28 Nov 2018 17:52:32 +0200 Message-ID: Subject: Re: [PATCH v3 05/13] fanotify: classify events that hold a file identifier To: Jan Kara Cc: Matthew Bobrowski , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Wed, Nov 28, 2018 at 5:44 PM Jan Kara wrote: > > 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... Sure. > > 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. > Ok. Freeing the space of path.dentry and path.mnt will give us 16 bytes of space for embedded fid, which should be sufficient for many file handles (ext4, xfs). and flags could indicate if fid is embedded or allocated. Thanks, Amir.