Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1386482pxj; Sat, 8 May 2021 16:18:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9ktKZJBZUDEoKNu4un4jRBVgFugzeMKOde/FMbOVDEXKkEANWlRdFGsfpWOHlKkj6QuTN X-Received: by 2002:a5d:8147:: with SMTP id f7mr13068379ioo.135.1620515922681; Sat, 08 May 2021 16:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620515922; cv=none; d=google.com; s=arc-20160816; b=OALhm+UhQZfxyv2VIoqaVZAdPnybZjf2pYG7NlQnEdsWrRAuyQJXi6YkaSSSVcKheB 8H0zVL7MvBhGL1QoW/IFlKKNnfxjPYiMWqRhwySSDLkFJfPwIg/HLWONmwfN6nCh6zyY MDYv79mbmGCg7FU2GhxjY44sC4vO3nLyUPv3mYSyJCuW4+Mdz7mwpt73JlpOjAYJLgRF gBb9p9YlLdTLZimfGWRyV62s9Cz7rcvSyBafD8MaN8S0ltgx48ekTpVNwzh4ezbH6xeW 4Dw/vRdBKM6C6800lP59khiD6f3Lpy8F/zLG4rtowoPJGNRfYSdAocdurSpP4WEdKaTN fIOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=50zFTzObptZwiI6jWd0MPl5TH6CWL0naRxKeGPnlhRI=; b=yNiPhAbZAjfUe2RMDKBTrAzdfIXGBgqHt1fpPNI2eaYUywbdVLPc2uCDq/k4PiTEcl zcaO5Xov7TqsgcgZ/FUeeF9AT99i5gAUe8yX9Vm6PN8/qUZVr6lpsqhIJlbD6UYQkHye ClKO1B8PUxKNlzKmm71CnGncFr+UAKEny8ax5sPM6ocETylwSb639i70OlaakJBieh+v 8oQKYzHIWuR40H5Uww5MN1iZa3pwVIElk49UAA8GtJXe4hanJsnpb02LJJtRydU7sVp+ PSA52F1LwZpuHAKQl6fGlXs6hTf5gw7BnvEAWMGcRMXWH2Mkkq+uj6d/CFgcSb995GwA +yHw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 m12si10738354ild.137.2021.05.08.16.18.27; Sat, 08 May 2021 16:18:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbhEHXRn (ORCPT + 99 others); Sat, 8 May 2021 19:17:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229522AbhEHXRm (ORCPT ); Sat, 8 May 2021 19:17:42 -0400 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96FA6C061573; Sat, 8 May 2021 16:16:40 -0700 (PDT) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94 #2 (Red Hat Linux)) id 1lfWAS-00Cn4e-8T; Sat, 08 May 2021 23:15:28 +0000 Date: Sat, 8 May 2021 23:15:28 +0000 From: Al Viro To: Linus Torvalds Cc: Jia He , Petr Mladek , Steven Rostedt , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , Jonathan Corbet , Al Viro , Heiko Carstens , Vasily Gorbik , Christian Borntraeger , "Eric W . Biederman" , "Darrick J. Wong" , "Peter Zijlstra (Intel)" , Ira Weiny , Eric Biggers , "Ahmed S. Darwish" , "open list:DOCUMENTATION" , Linux Kernel Mailing List , linux-s390 , linux-fsdevel , Christian Brauner Subject: Re: [PATCH RFC 1/3] fs: introduce helper d_path_fast() Message-ID: References: <20210508122530.1971-1-justin.he@arm.com> <20210508122530.1971-2-justin.he@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 08, 2021 at 10:46:23PM +0000, Al Viro wrote: > On Sat, May 08, 2021 at 03:17:44PM -0700, Linus Torvalds wrote: > > On Sat, May 8, 2021 at 2:06 PM Al Viro wrote: > > > > > > On Sat, May 08, 2021 at 01:39:45PM -0700, Linus Torvalds wrote: > > > > > > > +static inline int prepend_entries(struct prepend_buffer *b, const struct path *path, const struct path *root, struct mount *mnt) > > > > > > If anything, s/path/dentry/, since vfsmnt here will be equal to &mnt->mnt all along. > > > > Too subtle for me. > > > > And is it? Because mnt is from > > > > mnt = real_mount(path->mnt); > > > > earlier, while vfsmount is plain "path->mnt". > > static inline struct mount *real_mount(struct vfsmount *mnt) > { > return container_of(mnt, struct mount, mnt); > } Basically, struct vfsmount instances are always embedded into struct mount ones. All information about the mount tree is in the latter (and is visible only if you manage to include fs/mount.h); here we want to walk towards root, so... Rationale: a lot places use struct vfsmount pointers, but they've no need to access all that stuff. So struct vfsmount got trimmed down, with most of the things that used to be there migrating into the containing structure. [Christian Browner Cc'd] BTW, WTF do we have struct mount.user_ns and struct vfsmount.mnt_userns? Can they ever be different? Christian? Sigh... Namespace flavours always remind me of old joke - Highlander II: There Should've Been Only One...