From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexey Zaytsev Subject: Re: [PATCH] Shrink fanotify_event_metadata by 32 bits Date: Sun, 21 Nov 2010 00:03:53 +0300 Message-ID: References: <20101120050353.32269.90666.stgit@zaytsev.su> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org To: Eric Paris Return-path: In-Reply-To: <20101120050353.32269.90666.stgit@zaytsev.su> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Ok, just so you know, the real motivation is to use the '__u8 reserved' for an offset to the first option's header. This way we should be able to add a reasonable number of new core fields to struct fanotify_event_metadata, and still maintain backwards compatibility. I'd have to add an other __u32 for that purpose, so we are actually saving 64 bits per event with this patch. On Sat, Nov 20, 2010 at 08:08, Alexey Zaytsev wrote: > There seems to be no point wasting 32 bits for either the event versi= on or length > > Signed-off-by: Alexey Zaytsev > --- > > Hi. > > While I'm working on the file modification events, > please consider this patch. It obviously breaks > the userspace ABI. But maybe that's acceptable, given > that no kernel has ever been released with the old ABI. > > And the users only need to recompile their code, without > changing anything. > > If we agree that this change is desirable, please make sure > it makes it to Linus before the release. ;) > > > =C2=A0include/linux/fanotify.h | =C2=A0 =C2=A07 ++++--- > =C2=A01 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h > index 0f01214..9a7986f 100644 > --- a/include/linux/fanotify.h > +++ b/include/linux/fanotify.h > @@ -86,10 +86,11 @@ > =C2=A0#define FANOTIFY_METADATA_VERSION =C2=A0 =C2=A0 =C2=A02 > > =C2=A0struct fanotify_event_metadata { > - =C2=A0 =C2=A0 =C2=A0 __u32 event_len; > - =C2=A0 =C2=A0 =C2=A0 __u32 vers; > - =C2=A0 =C2=A0 =C2=A0 __aligned_u64 mask; > + =C2=A0 =C2=A0 =C2=A0 __u16 event_len; > + =C2=A0 =C2=A0 =C2=A0 __u8 vers; > + =C2=A0 =C2=A0 =C2=A0 __u8 reserved; > =C2=A0 =C2=A0 =C2=A0 =C2=A0__s32 fd; > + =C2=A0 =C2=A0 =C2=A0 __aligned_u64 mask; > =C2=A0 =C2=A0 =C2=A0 =C2=A0__s32 pid; > =C2=A0}; > > >