Re: [PATCH v2 05/20] fsnotify: use type id to identify connector object type

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

 



On Tue, Apr 17, 2018 at 7:26 PM, Jan Kara <jack@xxxxxxx> wrote:
> On Thu 05-04-18 16:18:06, Amir Goldstein wrote:
>> An fsnotify_mark_connector is referencing a single type of object
>> (either inode or vfsmount). Instead of storing a type mask in
>> connector->flags, store a single type id in connector->type to
>> identify the type of object.
>>
>> When a connector object is detached from the object, its type is set
>> to FSNOTIFY_OBJ_TYPE_DETACHED and this object is not going to be
>> reused.
>>
>> The function fsnotify_clear_marks_by_group() is the only place where
>> type mask was used, so use type flags instead of type id to this
>> function.
>>
>> This change is going to be more convenient when adding a new object
>> type (super block).
>>
>> Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
>
> Just one nit below:
>
>> diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
>> index 759ba9113ec4..9c690eb692a2 100644
>> --- a/include/linux/fsnotify_backend.h
>> +++ b/include/linux/fsnotify_backend.h
>> @@ -201,6 +201,17 @@ struct fsnotify_group {
>>  #define FSNOTIFY_EVENT_PATH  1
>>  #define FSNOTIFY_EVENT_INODE 2
>>
>> +enum fsnotify_obj_type {
>> +     FSNOTIFY_OBJ_TYPE_INODE,
>> +     FSNOTIFY_OBJ_TYPE_VFSMOUNT,
>> +     FSNOTIFY_OBJ_TYPE_MAX,
>
> This would be better named FSNOTIFY_OBJ_TYPE_COUNT. _MAX suffix suggests
> this is still a valid type. Or do you indeed want to treat TYPE_DETACHED as
> a regular type?
>

No. _COUNT is good. _DETACHED is never iterated when iterating by type.

Thanks,
Amir.



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

  Powered by Linux