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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08936EB64D9 for ; Tue, 27 Jun 2023 08:52:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 76E388D0003; Tue, 27 Jun 2023 04:52:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 71E8C8D0001; Tue, 27 Jun 2023 04:52:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E6578D0003; Tue, 27 Jun 2023 04:52:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 509C38D0001 for ; Tue, 27 Jun 2023 04:52:29 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 1B8D0408E3 for ; Tue, 27 Jun 2023 08:52:29 +0000 (UTC) X-FDA: 80947911618.02.00E7919 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf24.hostedemail.com (Postfix) with ESMTP id 6E87118000A for ; Tue, 27 Jun 2023 08:52:27 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ev5JtU8K; spf=pass (imf24.hostedemail.com: domain of brauner@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=brauner@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687855947; a=rsa-sha256; cv=none; b=lr1x9Vx8EQEfXwHrFVN52MsGgRKe+p/zGHEmKRAzoRo5V3Z6QaosumaVECBytvI/gF3fg5 okSS8dBf1yOA1QPXNxtvK7umtgCuh/pj6a7ZjWmPYU0IdEHYb/FsrRb3MIl2s2rha9mpwo GllL8cHsBZrOgJcVVVPNC7QHFopV7k4= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=ev5JtU8K; spf=pass (imf24.hostedemail.com: domain of brauner@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=brauner@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687855947; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=mvOK1QUkqt4GBf06HW9WffOsjW5CRPijgVqfh1mLxKU=; b=CQyXCDiLpDb1UJXfdrgFhFFZX6ftiwHk7ZHZH4I0umDALeaNrTBUnf/cBFwy8tsFz2ulfN j3mh3Fng7i1Xn62LTzoHYHef1pHDj9EjogEQQM2wf2QpnSGbmLQB8uQkStcphxjebZK9ql u0McCCxZAXYMBplH4ycykrjMdauzyWU= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 7B4D36103A; Tue, 27 Jun 2023 08:52:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DE4D8C433C8; Tue, 27 Jun 2023 08:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687855945; bh=NZREHs/eWgJeGiYoVnm+2I8Iio0OR38JfhH6RcTJdAk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ev5JtU8KRW3Zv+UO2Gj8Mc02CjJMEolTkpysPlyy3ez2lrOEOhmAv5pyyDpN2/cLi CYMc0E9bUID0GwU3xEtt04mXfiXZcQjOC5IR3e3Xg1XAKYxnVPkCMwwmwkwEn4eFG3 YJXJvXbjTh8pxRKio6J8XbqjcKS/UA0QDqdE2wQZXe44so9kEUVNwj3uD/2pCW47CQ DxUQYGZwJysocEgJj4Tj7fNYmc5lrasFOgts7BnSzm2iNfSMae6TZTqpRrn6jt7keb NpLCZWVusjoH03nPzLvYWVDAjYOH3B8o+6xUQ+tOCgA/59xUhBH4P69FM9ktVAc/sf RIZdOMLFJYhMg== Date: Tue, 27 Jun 2023 10:52:20 +0200 From: Christian Brauner To: Christoph Hellwig Cc: Chuck Lever , viro@zeniv.linux.org.uk, hughd@google.com, akpm@linux-foundation.org, Chuck Lever , jlayton@redhat.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH v4 1/3] libfs: Add directory operations for stable offsets Message-ID: <20230627-drastisch-wiegt-8d2aba4e5a0d@brauner> References: <168780354647.2142.537463116658872680.stgit@manet.1015granger.net> <168780368739.2142.1909222585425739373.stgit@manet.1015granger.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: 6E87118000A X-Stat-Signature: b938ff6fk7u8iuju7hgkwb1cag9a7jo6 X-Rspam-User: X-HE-Tag: 1687855947-270615 X-HE-Meta: U2FsdGVkX1/6cSW5JqSMCuMUE1hy6wukasiRukwM9KnVbIoDY/nv0ea2GAj+IDd3Ju2EgJWFl620rqdvvNl3L2O17v8vI4X2srhQU+dDNxGEXpo5/DihBNRELeEU6llJHjGhDRlac1X1hg15DsN4gAXUe4DrNgq9Wg0D/YrGsLQ+Pw+zcU2cmrkk48iHI+k9a67JsbNwkMGd4G+SbTrIoKFB+N0tuCOk4i8ue5wSujIcULaRAPQ+rpdcJBQAfndlJ9ht/JMjUBYVtzLOjYC3VitBUgOg7ntphbzyjNdpaJFEUfjWl2g4b+oulhTvq8RxwO9T1ficy2qp+/z0Zn/Rfa4HL8l86SCE2HesMLCUjkfdOT5O0v9VSerL8agWYlxM6tiCvZIEOO+nxRhZF4BPPq4ajaztbkPQuVNubkTZvKzdxmJynUL70N8hysHdakSormM1t+7VEBNs0ubHwTk2eqenWcNCthvId80tNLKEVuO4yMK4mirHy4eJNaqeSZCnwqK/MBLowWFOOr0qu9fJS5BAwYJHPPG5O4uLTriEq9HX86bVtC4Dfd4gHwxi4dvUsCuYt10ahCjATeplNcrNSNyxWCIsQFR2kSFiVmWQcScv6V/9NKTlusFFbndN8SjNntK4t4PR+gPQrzm+JVmVFYoqranD8Hr92L2uDbQQBGAvVOvxhb4Oc+6U6hDtjwEVp6qXZvg95hFglgg4ec5xkAbOKJrAK6nzlOQzPDMRU2+sR5y1ewXzBo9qQxtek4fXUi7xwFw3FHKc5pp0qoKxPDCdEJ8As6B7O9sSXInq1/UKRFEOn067maZT1H3wkKuqSeAxL/k+38lQ02AaGs/JIFM5T+fQJwYRFvhuIesDUnYtJ5ZEpcHSKnybWTiXCbFIUXDwE9dpoNiHMVrv99zhRWw/Eln+JAXIK60yymSw2Vxmc6BWOEMGY9Z5BxjyeH9aKWmx/eZ4kOukTTLGV7n GKLiG1CQ m8N3aHiE5tsmMJEXOvDvCY7LHxwdHzlAqqfCITbKyX9R83uYAm55M+QtyEJ6GgOVCxyRgVYuYvU/aZakuCCHMaVcR9xMqeFKtu/UrvcE5vP+ragGGUbtCGVNKbwnMSLdeyvqodtLVAePtmSzSLSpyC3NJfrGcZi5ryExjt55h6azs/7p0ms+DYwjTtrSXkrlqg1DMPlOpy0/9A0t4zSO1eyFc3qXobN8Q72wHxNd90q7ct4g5SOOtou//w1m2nQGZ4i45D7oSQRCwjsNtEB8kKhURcGgLs/zHHXop X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jun 26, 2023 at 11:44:15PM -0700, Christoph Hellwig wrote: > > + * @dir: parent directory to be initialized > > + * > > + */ > > +void stable_offset_init(struct inode *dir) > > +{ > > + xa_init_flags(&dir->i_doff_map, XA_FLAGS_ALLOC1); > > + dir->i_next_offset = 0; > > +} > > +EXPORT_SYMBOL(stable_offset_init); > > If this is exported I'd much prefer a EXPORT_SYMBOL_GPL. But the only > user so far is shmfs, which can't be modular anyway, so I think we can > drop the exports. > > > --- a/include/linux/dcache.h > > +++ b/include/linux/dcache.h > > @@ -96,6 +96,7 @@ struct dentry { > > struct super_block *d_sb; /* The root of the dentry tree */ > > unsigned long d_time; /* used by d_revalidate */ > > void *d_fsdata; /* fs-specific data */ > > + u32 d_offset; /* directory offset in parent */ > > > > union { > > struct list_head d_lru; /* LRU list */ > > diff --git a/include/linux/fs.h b/include/linux/fs.h > > index 133f0640fb24..3fc2c04ed8ff 100644 > > --- a/include/linux/fs.h > > +++ b/include/linux/fs.h > > @@ -719,6 +719,10 @@ struct inode { > > #endif > > > > void *i_private; /* fs or device private pointer */ > > + > > + /* simplefs stable directory offset tracking */ > > + struct xarray i_doff_map; > > + u32 i_next_offset; > > We can't just increase the size of the dentry and inode for everyone > for something that doesn't make any sense for normal file systems. > This needs to move out into structures allocated by the file system > and embedded into or used as the private dentry/inode data. I agree. I prefer if this could be done on a per filesystem basis as well. Especially since, this is currently only useful for a single filesystem. We've tried to be very conservative in increasing inode and dentry size and we should continue with that.