Re: [PATCH 3/3] [PATCH v2 3/3] fanotify: introduce event response identifier

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/10/25, 1:45 AM, "Amir Goldstein" <amir73il@xxxxxxxxx <mailto:amir73il@xxxxxxxxx>> wrote:
> > IMO, this is shorter and nicer after assigning fd = -ret; above:
> >
> >        if (FAN_GROUP_FLAG(group, FAN_REPORT_FD_ERROR |
> >
> > FAN_REPORT_RESPONSE_ID))
> >                metadata.fd = fd;
> >        else
> >                metadata.fd = fd >= 0 ? fd : FAN_NOFD;
> >
>
> And above this code is also a good place to place the build assertion:
>
> BUILD_BUG_ON(sizeof(metadata.id) != sizeof(metadata.fd));
> BUILD_BUG_ON(offsetof(struct fanotity_event_metadata, id) != offsetof(struct
> fanotity_event_metadata, fd));
>
> Which provides the justification to use the union fields interchangeably
> in this simplified code.
>
> Thanks,
> Amir.

I will simplify the code to use union fields interchangeably + add the
suggested build assertions and resubmit these soon. It gives a chance
to fix the various formatting issues :)





[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux