Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43DF6C4BA0B for ; Wed, 26 Feb 2020 08:53:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18B8124656 for ; Wed, 26 Feb 2020 08:53:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726541AbgBZIxB (ORCPT ); Wed, 26 Feb 2020 03:53:01 -0500 Received: from mx2.suse.de ([195.135.220.15]:43922 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726066AbgBZIxB (ORCPT ); Wed, 26 Feb 2020 03:53:01 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id DE22EAEAF; Wed, 26 Feb 2020 08:52:59 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 8F5281E0EA2; Wed, 26 Feb 2020 09:52:59 +0100 (CET) Date: Wed, 26 Feb 2020 09:52:59 +0100 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v2 07/16] fsnotify: replace inode pointer with tag Message-ID: <20200226085259.GC10728@quack2.suse.cz> References: <20200217131455.31107-1-amir73il@gmail.com> <20200217131455.31107-8-amir73il@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200217131455.31107-8-amir73il@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon 17-02-20 15:14:46, Amir Goldstein wrote: > The event inode field is used only for comparison in queue merges and > cannot be dereferenced after handle_event(), because it does not hold a > refcount on the inode. > > Replace it with an abstract tag do to the same thing. We are going to > set this tag for values other than inode pointer in fanotify. ... > Signed-off-by: Amir Goldstein > -static inline void fsnotify_init_event(struct fsnotify_event *event, > - struct inode *inode) > +static inline void fsnotify_init_event(struct fsnotify_event *event, void *tag) > { > INIT_LIST_HEAD(&event->list); > - event->inode = inode; > + event->tag = (unsigned long)tag; > } Oh, and why not make the argument to fsnotify_init_event() unsigned long from the start? It would be IMHO cleaner and using void * doesn't really save us many type casts... Honza -- Jan Kara SUSE Labs, CR