From patchwork Tue Jun 27 20:53:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 13295025 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 66D34EB64DC for ; Tue, 27 Jun 2023 20:53:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C4F958D0002; Tue, 27 Jun 2023 16:53:07 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BD91D8D0001; Tue, 27 Jun 2023 16:53:07 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A79238D0002; Tue, 27 Jun 2023 16:53:07 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 9413B8D0001 for ; Tue, 27 Jun 2023 16:53:07 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id F158714021B for ; Tue, 27 Jun 2023 20:53:06 +0000 (UTC) X-FDA: 80949727572.16.7362743 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf24.hostedemail.com (Postfix) with ESMTP id 53690180013 for ; Tue, 27 Jun 2023 20:53:05 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=TXXhbkTh; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of cel@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cel@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687899185; 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:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=qpXv/2+ZByTV+Y/BdkDKszq/wbXZpKb0nvJ5pWGPXq8=; b=k8Y/+X/64qA/9dgQdcdT/vF2Ldx1J5b5SXEZksJqMp6+tgjsPqusFWTXBocyKOmNMuyi3G JEBAYfsZbpkWVu7OsIGvsXV9Dgc3XHo5vBgCRCpOZYr+v1Od5Y3/VoMCcOgn2vN+zFQ6c7 YNs31gDeOKyFBLWAftN3ZL/tNdazvG4= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=TXXhbkTh; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of cel@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=cel@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687899185; a=rsa-sha256; cv=none; b=D9IZv74kAAmV36Za16p5BJ9BKZpDRFw6PQvfxnDch08iJFAVfCIf9q88KYfeyMef9nsutZ ivlvVwCE87OKjjP1e2Q8vjTbiDrabcX4l5Cu3a027fLb/KacIn4W5einhffn6g1yTrn1g/ TcjjduoWX0MTQyRF15zx794CV0peOEo= 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 566C361233; Tue, 27 Jun 2023 20:53:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07F76C433C0; Tue, 27 Jun 2023 20:53:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687899183; bh=6bii1OLY78TFxJA0nbJ48++Tukqt+yTeFc16tNHybc8=; h=Subject:From:To:Cc:Date:From; b=TXXhbkThNwz0DPSBsY4L7/YYy0y/EQU8SDuK/erYNXUuV13npl80SFBimOWPbs/F3 Z5I8PvHH5AoTGjBOnsy3rypSpJGnT7AJ0wKjSNDhDPAUPwzIFZ6bZRpp/EI6tLSmbZ jzJa/tNxM+D+vXn0Elqt1MWprrzDIYQuABx5C1XXif+GH+fzVX8GQAwoSPofdBx7ik kJW9yzBwTsz8WguLa09obNIeaqGiISNz5m498GTSPXSaYomiZm0sxBAmNWhqENvJww kk5XlaGUZCfL8fJzbAG1fqJZxQHpacujaO9bDVfaZPxP1mykEXgOOfuo7INdvUR434 ZvyIMjpfs+gJA== Subject: [PATCH v5 0/3] shmemfs stable directory offsets From: Chuck Lever To: viro@zeniv.linux.org.uk, brauner@kernel.org, hughd@google.com, akpm@linux-foundation.org Cc: Christoph Hellwig , Jeff Layton , Chuck Lever , jlayton@redhat.com, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Date: Tue, 27 Jun 2023 16:53:02 -0400 Message-ID: <168789864000.157531.11122232592994999253.stgit@manet.1015granger.net> User-Agent: StGit/1.5 MIME-Version: 1.0 X-Rspamd-Queue-Id: 53690180013 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: rsh7nnuacz8xur5o3f557hnopnjiy9wu X-HE-Tag: 1687899185-294507 X-HE-Meta: U2FsdGVkX18tqDc/erO9zGIps4HdVKOy3hsI+ot3aYcki2pIIJ6zj99Es9EPVJr3lXI8UxyW6z9ocu/kM+tdsUm+25rQ7QA/3iDcufXgi/2/eglSj+rim90CeHLExneTDI6Ptgpl2ynhzL/lveOdRfqwuZoxTz4S/mxXPBh/DYdJDi4LLzqTxr/6zThjWHXLQbEOpgPvAeMnneqh6HhBoAEvNKyaIVH1EQZOFrB8HQXuZ04cLWM8TuuTWf2KfS5W9Zwk8OSNP5iSogv7otRE5i1yJNP8vRGl3smwggt3Ly9Ea48iRP7yAJsTvx74wt6iWpqAHeInMiba9YbpoUgmB3BRHXWDUXIIChFMKr+1rxjfW2JXb0NfE98dQR64GdBVFMqDUlAbhBxoHrpZ6qwiyBqN7MC1IgIvnV6SbTWurIZtUODBpPUwaQUXtjKN8xjrpf2CyxfhEzV6JlFlo4IsC3dN9vgO7YNhJpIYQBSS3Gmch1fsHMNo8Q3xqmx3E2nAD7HQC5s7GpOEMlM7W5H9rDG7goximb221Ws5ki1kPxKRu0GQmFn+5iEzkD+p545wx8rSB6BDm3DiDYycrnIxeS992goSvwR4iVfKRIehXiRqfSg+QL91AIXrDlLcSW2gZq0KUet4kEonVh/YHMJSSJA/P8gTMlYWoZ5WbE+uNA3+2xLQiVax08+nB43MBT0PibwffF/JI8TCCKrglGxYClwr7wwrcZaag5yqA57ZdV3PK4JQm4SUtFDbZIOmzhllRIU0BNJZbozeHoB4I0dj95vSxFXn63ha/HLH0non/vse/9LbaDEHZnoU+JFDbKMUP7Y0SL8HybB618DzSeAVShgfb6le6OtSexPw243JpL1ly4FScgHbkwmVQlih7uxnCDPNr2b6vAqEPDOejPA0tjsj1SxNU/FsocMG8H9hcbyCBy2tjHr9H+ICw8bNhAZa+Ak5aNM+WDSfygfJXgM 0PJyQ4Z8 Jdb9/N6UTUh+9qCtBf7Q/R/yFTg1PLVwRSzbiWFrrWhCCWsvpKOJaGNAo/e3lr5yuDNaWfPHkXLOOwPgieU2eyotbEAcoV6niR5xv2V6F2iZgk+dLdBmpu8ObTHwjLpr9Tu8Y8cRdDDxN1hc71y4yjJwqvXC3fFFKy/18SxGJl+upTI0CY0FakqmJuHnwV6H3atxZXlaNk3O/eV87qrJk/VgRFqGApci2C+fP+D5FIe6Cqno0sxNdQzYdUw== 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: The following series implements stable directory offsets for shmemfs/tmpfs and provides infrastructure for use by other file systems that are based on simplefs. I've moved the rename-exchange logic to fs/libfs.c, since that is something that other filesystems will need and is difficult to get right. I've tried again to address error handling for that type of rename. That part hasn't been thoroughly tested, though the series continues to pass xfstests and various other tests done via NFS export. Changes since v4: - Remove new fields from struct inode/dentry - Remove EXPORT_SYMBOL and extern for new functions - Try again to fix error handling for rename_exchange Changes since v3: - Rebased on v6.4 - Fixed error handling bugs Changes since v2: - Move bulk of stable offset support into fs/libfs.c - Replace xa_find_after with xas_find_next for efficiency Changes since v1: - Break the single patch up into a series Changes since RFC: - Destroy xarray in shmem_destroy_inode() instead of free_in_core_inode() - A few cosmetic updates --- Chuck Lever (3): libfs: Add directory operations for stable offsets shmem: Refactor shmem_symlink() shmem: stable directory offsets fs/libfs.c | 252 +++++++++++++++++++++++++++++++++++++++ include/linux/fs.h | 19 +++ include/linux/shmem_fs.h | 1 + mm/shmem.c | 62 +++++++--- 4 files changed, 319 insertions(+), 15 deletions(-) -- Chuck Lever