Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1690565rdb; Mon, 8 Jan 2024 07:19:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IGTVNMjctz+5wbTNnjgfvmYqQUbcAvrsilom4ISGKVNEWuDSyLKa5Xw8IMaJ4raZY4rrKyq X-Received: by 2002:a05:6870:c686:b0:204:3470:cb5f with SMTP id cv6-20020a056870c68600b002043470cb5fmr5796474oab.11.1704727163372; Mon, 08 Jan 2024 07:19:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704727163; cv=none; d=google.com; s=arc-20160816; b=wV/ly4buQw6okGjP/+s8OKNAzhjD6X81Eb4sQNARkyPss9mVBwA+IBUz8RaFe+z0hs kt2XV7MUrwWDtspOHC8wCtW+yNGWI1Du0fWNHAM5rQPCMhxu4elIsbSzHVVxXFoKNcxB /DKfXoXActy5BxUuQRd0dZ3Ae6HfGeSezDyIzFkoPsR1bCq+gjpm/mW+y/kf6SiPyeGK TH5VAR5TPenv85nDWTeN7x1XDSoNuH8lq31366eYJmGfottdNSDo+NSDrTwrzGiUaGe+ 3AUVe6Tw0Yt6shuuSSdK14vCxkHTCRKAVfg/UXRGmZz5I+k6Pek2W/Ec5E28YFI9FAxD At8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=D84cyZM9KCM4kCuK+16OY0oEvsoyvtTov+D3WEVZuYQ=; fh=34zNr7a0BVYUu9GLC6Z8rO/FcAceqP5NONmRFRP2POA=; b=Zp1FzfNwksDma/zpGfv1NzHrQB8O8G8gKyadZfs34nyb7xBtGo39XNZBp4F5++PWwb ZmlQNtGc0Onk/dh2bsTdmQ9kpK+ADhC+Ol2O2/bpnS5xMQWv4OrVc8GjSRSFOz4Plx3w OK0Yk4NHLjLXRfSizEynVvdZ9MtE2695vHOp2pggJkBzEq0Bo6HLmC4qh7Q2dybb/3cI +mi/XrMqA7LCR7YW/A7K4VZmuWw+H+KOIqEG1eQom7bwU/unCHDmfAERwmSz6MdT7AKV 9i+0Kwmz6j/PuP7LJOKCsbO1xmnJ6S7RA1qQE+nYxACnqSRNOEX3xscB+XiDJ0SCrvZE Pvyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aol7eVIA; spf=pass (google.com: domain of linux-kernel+bounces-19750-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19750-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h5-20020a05620a10a500b0078326674eabsi1053087qkk.409.2024.01.08.07.19.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 07:19:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19750-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aol7eVIA; spf=pass (google.com: domain of linux-kernel+bounces-19750-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19750-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 2385D1C22C9B for ; Mon, 8 Jan 2024 15:19:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C3EA524BA; Mon, 8 Jan 2024 15:18:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aol7eVIA" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6781A4C3C9; Mon, 8 Jan 2024 15:18:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 573BBC433AB; Mon, 8 Jan 2024 15:18:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704727111; bh=l92SouosFIYw3ff8gW2JhMxPJjTF6VFrybmBKncrwgQ=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=aol7eVIAnyTNYboF/ohW1jfHZDTOd9STxJLPiwjIjJEpPo4VinW3ryQKGuVdJE6tM 2gr0q/px+RYehtHqMmXHU75K0Ku4Fjy1lXvQWMyQZNpBQsRXR0Rt8hZd5jXKMNR8cM 7Spb402LZn7tocwTT7e48TmRg72ptEMqAzvS1bV947DwK+PNcw7Ga8bvJUbCH8OU7e MsqE1zEbCvqjIFHuRoUtOORTDfbcBspBKh4SY2x6EEQI62+23FmTOSJ6M5wYl50VgS U7QntVXKqF40hzWyIXEFVcdefAnw38G0DnpYEFeRdvQqyj9FK2ZZVt5Ihfw2fsz8Xj cSOkGW72/jh2A== From: Eric Van Hensbergen Date: Mon, 08 Jan 2024 15:18:20 +0000 Subject: [PATCH v2 4/8] fs/9p: Eliminate redundant non-cache path in mknod Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240108-ericvh-fix-cache-dups-v2-4-a73f8822838c@kernel.org> References: <20240108-ericvh-fix-cache-dups-v2-0-a73f8822838c@kernel.org> In-Reply-To: <20240108-ericvh-fix-cache-dups-v2-0-a73f8822838c@kernel.org> To: Latchesar Ionkov , Dominique Martinet , Christian Schoenebeck Cc: v9fs@lists.linux.dev, linux-kernel@vger.kernel.org, Eric Van Hensbergen X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=1817; i=ericvh@kernel.org; h=from:subject:message-id; bh=l92SouosFIYw3ff8gW2JhMxPJjTF6VFrybmBKncrwgQ=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBlnBJDpbZXDyczF1cb1zBNOFrwcPuSureTfMT7v XZUgTbbY02JAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZZwSQwAKCRCI/9X7Sl// mKI2D/4sZz4CoiiiUdppH9yfbfYSY/u9yUtOsTs9F2fT5Z9ADtCL69wGzIDl/aEcNgH3UYGYDoM I4qmTjN0rUKE+o6qYu1QCt3cQgPMoYXe8716+ja2Pgm0kGxzQG2zXVye1ZZiDT1IdagSmeJVszg ymazH85rjcU9wiDAZWHf5RGEnBv+ZNaqubksmvw8zKlDDlgR3aNAQRORoV6Bx3yKjBYpoXdqOFy /HqwMtcsxnxlh0aU3XX3weV+QM1cpHHvocVqCsODPOJNYdWOqKRwvGLWd9V/YPDThkganKoA+Sz F/e30eU1vljldM5T4iX9kUGQYQGNqVTAqFLtJxUmErl2RbBeSp0NukRwkDeHffQFqmm+u0rUwlx kVSDC5pUllsRuUdtUfRvD0WUfovp+jpUmc0QWbWobrGUNnvxdo7AkXOePVdi6w0F1xfCXdUkW7y 4n3pbzoQxDK/aITQIo9j/2q2JQ5ZzA0ng2VsZQXZUkelo9TwpDVc69Ujhdi1mOjoXKou0VkAu6c lEby/x+9T54f5zWxHw2ws7XUoY/Kmf7E90jKRUC8jJISgZTyR2XIZszeMZIhL8d1EoP8uq13lyv NiWPWj+jF2qmvI3urIruhunul5eor+uTMMgxIXkkGiEs1tWnrve1tjEVuL6tRIYVNExHBUgu+EI 6G3u/3Hy/vASWzA== X-Developer-Key: i=ericvh@kernel.org; a=openpgp; fpr=9696F0D196A59098A4CAD15188FFD5FB4A5FFF98 Like symlink, mknod had a seperate path with different inode allocation -- but this seems unnecessary, so eliminating this path. Signed-off-by: Eric Van Hensbergen --- fs/9p/vfs_inode_dotl.c | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c index ab52a89367d2..ddc3cfdcc13b 100644 --- a/fs/9p/vfs_inode_dotl.c +++ b/fs/9p/vfs_inode_dotl.c @@ -836,33 +836,17 @@ v9fs_vfs_mknod_dotl(struct mnt_idmap *idmap, struct inode *dir, err); goto error; } - - /* instantiate inode and assign the unopened fid to the dentry */ - if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) { - inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); - if (IS_ERR(inode)) { - err = PTR_ERR(inode); - p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n", - err); - goto error; - } - v9fs_set_create_acl(inode, fid, dacl, pacl); - v9fs_fid_add(dentry, &fid); - d_instantiate(dentry, inode); - err = 0; - } else { - /* - * Not in cached mode. No need to populate inode with stat. - * socket syscall returns a fd, so we need instantiate - */ - inode = v9fs_get_inode(dir->i_sb, mode, rdev); - if (IS_ERR(inode)) { - err = PTR_ERR(inode); - goto error; - } - v9fs_set_create_acl(inode, fid, dacl, pacl); - d_instantiate(dentry, inode); + inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); + if (IS_ERR(inode)) { + err = PTR_ERR(inode); + p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n", + err); + goto error; } + v9fs_set_create_acl(inode, fid, dacl, pacl); + v9fs_fid_add(dentry, &fid); + d_instantiate(dentry, inode); + err = 0; error: p9_fid_put(fid); v9fs_put_acl(dacl, pacl); -- 2.41.0