From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb0-f193.google.com ([209.85.213.193]:42290 "EHLO mail-yb0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751232AbeDQRpX (ORCPT ); Tue, 17 Apr 2018 13:45:23 -0400 Received: by mail-yb0-f193.google.com with SMTP id t8-v6so8890203ybo.9 for ; Tue, 17 Apr 2018 10:45:23 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20180417162653.7k5iol44bknhzqln@quack2.suse.cz> References: <1522934301-6520-1-git-send-email-amir73il@gmail.com> <1522934301-6520-6-git-send-email-amir73il@gmail.com> <20180417162653.7k5iol44bknhzqln@quack2.suse.cz> From: Amir Goldstein Date: Tue, 17 Apr 2018 20:45:22 +0300 Message-ID: Subject: Re: [PATCH v2 05/20] fsnotify: use type id to identify connector object type To: Jan Kara Cc: Miklos Szeredi , Marko Rauhamaa , linux-fsdevel Content-Type: text/plain; charset="UTF-8" Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Tue, Apr 17, 2018 at 7:26 PM, Jan Kara 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 > > 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.