From mboxrd@z Thu Jan 1 00:00:00 1970 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.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 CE2DBC433E9 for ; Mon, 15 Mar 2021 13:18:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 912A964EB6 for ; Mon, 15 Mar 2021 13:18:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229731AbhCONSF (ORCPT ); Mon, 15 Mar 2021 09:18:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbhCONRz (ORCPT ); Mon, 15 Mar 2021 09:17:55 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32946C06174A; Mon, 15 Mar 2021 06:17:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=7Jrclnurpg02FW6SBK78iFY06pC4oqxMEZmAxzr40dg=; b=mLAmtzek/OysmlUkK2D+l/+ViO P0JQHzdgMfu6NrsqY8zXpk6RTX/5nmNEn7oIDRUqEQM84J8B3lrsZGvkP5HHPKPkl0ZkPlrOGt31T xLmeHPnJjSHqB50gbfaDl7P7BEhGCQo+FHsuI7rB0HWgJzaaV2BLxt752pSmbcJtzi+bcZ+w405PR LUlCDthgLnKXM3rZxlWrYs+w7Fn7g+5hBePLZj+wRC9iUihLEQ2IQwyRZYa6GyFvoC+9pAMFj/oHO jpdlTTW3D7CA4MMjxR5B+DrHb0PQVjhMQ/4QM/do1x1T9WIERqk5XF/F184c6va0yydPKlm5RGM5o 4zjRyPUg==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lLn63-000DJ6-7o; Mon, 15 Mar 2021 13:17:26 +0000 Date: Mon, 15 Mar 2021 13:17:23 +0000 From: Matthew Wilcox To: Miklos Szeredi Cc: David Howells , Alexander Viro , Ian Kent , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCH 0/3] vfs: Use an xarray instead of inserted bookmarks to scan mount list Message-ID: <20210315131723.GW2577561@casper.infradead.org> References: <161581005972.2850696.12854461380574304411.stgit@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Mon, Mar 15, 2021 at 02:14:35PM +0100, Miklos Szeredi wrote: > On Mon, Mar 15, 2021 at 1:07 PM David Howells wrote: > > > > > > Hi Al, Miklós, > > > > Can we consider replacing the "insert cursor" approach we're currently > > using for proc files to scan the current namespace's mount list[1] with > > something that uses an xarray of mounts indexed by mnt_id? > > > > This has some advantages: > > > > (1) It's simpler. We don't need to insert dummy mount objects as > > bookmarks into the mount list and code that's walking the list doesn't > > have to carefully step over them. > > > > (2) We can use the file position to represent the mnt_id and can jump to > > it directly - ie. using seek() to jump to a mount object by its ID. > > What happens if the mount at the current position is removed? xa_find() will move to the next one.