Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp373471pxv; Thu, 8 Jul 2021 04:39:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkumCjNWtV/AjQEw2oB8WWw8tIZD2ScKfxoD/k4V828YqG6vFAl2eqZT0th5zSq9G0pQbI X-Received: by 2002:a05:6402:502:: with SMTP id m2mr13132181edv.57.1625744366147; Thu, 08 Jul 2021 04:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625744366; cv=none; d=google.com; s=arc-20160816; b=ceksFea5u8+UEKhSrPolLhBnkIfJjlKbCCDRMNPWLqDw2jyVoF9NTq373wHonypFie CJEkRXERYH7Ta76xo19iINW5gtuxz0MRbAluFG4lj/ADsjeSrk6CsTkagEGxuaniURJK v6SipsSsSrF/CrItrBon4VBL4Twc93a0rHc9vT9oQYShKa9xyHDVB7vfUFbTuaShWPZu 2dJzQXKUhf0lG21s7dMqtZwAOw3YuVcPZrVhhVKKFxQucfuXVxDAVaZd1c6IRJrJIBDw qSJsMagMtUWjQIEFbWBNKUpnMhuevyviWLwU6ygEdGBtBd/bFayTuAvbqHwMDJxCl0fb Bg2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature:dkim-signature; bh=0zOqQw4qUavojZrlEKdalTDwpwLp4CPGzK/GjPJmBfk=; b=Fgl0bSKEuEpuDs4VaK4s9jRbZp4OJghddKnuim7YB4ZDR1V+mlERY3Lunw1mX5XHFN qze3yShNdm3AeWXqKyI7sJOPDqblRflRkEy+rXa5TRpQmE3m01n8jg6EV8xhb4uVTbuF vtv1akMCxkZV5YL1w4GjMr+s+gVwmr0mK4n9dAx+G7GTrT/gIX+xKmF4B8gdJuDrFtQ8 5koLYtLCAWrpuHq2+sT3evuniIZ3Z9+Rk/V9W7fW/NH72Dp8LlusPltssvrJEyhdIBgx 4BLUpbvNFOHyXJv1/AZ0s9kyUM7qTNCGzSJcTRbhWuMZU1v8CD0amW4iCnsasLkP0/l+ mNtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ylsUSYdx; dkim=neutral (no key) header.i=@suse.cz header.b=w556YszZ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j23si3351456eje.21.2021.07.08.04.39.01; Thu, 08 Jul 2021 04:39:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=ylsUSYdx; dkim=neutral (no key) header.i=@suse.cz header.b=w556YszZ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231707AbhGHLjy (ORCPT + 99 others); Thu, 8 Jul 2021 07:39:54 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:58734 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231696AbhGHLjy (ORCPT ); Thu, 8 Jul 2021 07:39:54 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 3FBE221F4A; Thu, 8 Jul 2021 11:37:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1625744231; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0zOqQw4qUavojZrlEKdalTDwpwLp4CPGzK/GjPJmBfk=; b=ylsUSYdxAKhi88mJOMuyYuh5VPvsq1UFeI7LHYwmqOFx99W/80A6HAXtFMfW0JqJnJ58VN onL/xoZH/r64nAlDFicdbFyoqZq+QObsECl+IDbBwG5nOzysBzkgUCFRx2Zsm6rYZ/Ld7t pnprmc9wERUsDdH1sbZVnA7C4GItoTY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1625744231; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0zOqQw4qUavojZrlEKdalTDwpwLp4CPGzK/GjPJmBfk=; b=w556YszZnyknjmLozx/9z0/B+vefmBwM5Hg3BPExIGO8Y8XTUQJAEtDi4apaIpVWm5sxhQ xUlR8oDMgJI/FpBw== Received: from quack2.suse.cz (unknown [10.163.43.118]) by relay2.suse.de (Postfix) with ESMTP id 2374AA3B85; Thu, 8 Jul 2021 11:37:11 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 1C35F1E62E4; Thu, 8 Jul 2021 13:37:11 +0200 (CEST) Date: Thu, 8 Jul 2021 13:37:11 +0200 From: Jan Kara To: Amir Goldstein Cc: Jan Kara , Gabriel Krisman Bertazi , "Darrick J. Wong" , Theodore Tso , Dave Chinner , Jan Kara , David Howells , Khazhismel Kumykov , linux-fsdevel , Ext4 , kernel@collabora.com Subject: Re: [PATCH v3 07/15] fsnotify: pass arguments of fsnotify() in struct fsnotify_event_info Message-ID: <20210708113711.GF1656@quack2.suse.cz> References: <20210629191035.681913-1-krisman@collabora.com> <20210629191035.681913-8-krisman@collabora.com> <20210708104307.GA1656@quack2.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 08-07-21 14:09:43, Amir Goldstein wrote: > On Thu, Jul 8, 2021 at 1:43 PM Jan Kara wrote: > > On Tue 29-06-21 15:10:27, Gabriel Krisman Bertazi wrote: > > > diff --git a/include/linux/fsnotify.h b/include/linux/fsnotify.h > > > index f8acddcf54fb..8c2c681b4495 100644 > > > --- a/include/linux/fsnotify.h > > > +++ b/include/linux/fsnotify.h > > > @@ -30,7 +30,10 @@ static inline void fsnotify_name(struct inode *dir, __u32 mask, > > > struct inode *child, > > > const struct qstr *name, u32 cookie) > > > { > > > - fsnotify(mask, child, FSNOTIFY_EVENT_INODE, dir, name, NULL, cookie); > > > + __fsnotify(mask, &(struct fsnotify_event_info) { > > > + .data = child, .data_type = FSNOTIFY_EVENT_INODE, > > > + .dir = dir, .name = name, .cookie = cookie, > > > + }); > > > } > > > > Hmm, maybe we could have a macro initializer like: > > > > #define FSNOTIFY_EVENT_INFO(data, data_type, dir, name, inode, cookie) \ > > (struct fsnotify_event_info) { \ > > .data = (data), .data_type = (data_type), .dir = (dir), \ > > .name = (name), .inode = (inode), .cookie = (cookie)} > > > > Then we'd have: > > __fsnotify(mask, &FSNOTIFY_EVENT_INFO(child, FSNOTIFY_EVENT_INODE, > > dir, name, NULL, cookie)); > > > > Which looks a bit nicer to me. What do you think guys? > > > > Sure, looks good. > But I think it would be even better to have different "wrapper defines" like > FSNOTIFY_NAME_EVENT_INFO() will less irrelevant arguments. If we don't overdo it, I agree :) I mean if we end up with a different helper for each site creating this structure, I'm not sure it helps much... Honza -- Jan Kara SUSE Labs, CR