From patchwork Mon Jan 8 15:18:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Van Hensbergen X-Patchwork-Id: 186042 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:37c1:b0:101:2151:f287 with SMTP id y1csp1086792dyq; Mon, 8 Jan 2024 07:22:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IEOETn1/WSPloR5ropqS/bPx05crQ7jJ3QMddzU1zfbml7N6iaN4QMMNVjBqjqfNrgewRXp X-Received: by 2002:a05:6a20:8e04:b0:199:9a74:f227 with SMTP id y4-20020a056a208e0400b001999a74f227mr923539pzj.28.1704727331663; Mon, 08 Jan 2024 07:22:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704727331; cv=none; d=google.com; s=arc-20160816; b=ZmHzOEdtcbzBERHKrIV8KiCDY1A8IA4EGc2T36JMtErc5nb9OwIJEtzsmOTXrV1IEZ /nUw8zk4dGEnHYjtrSk/yZogZf2dA4dvRW05A8VFLOakVf9to7JFqpAP0oi5AtGbVhO7 qEadSURDzP3qVTqF824rn4uswzSGJdJkTW0Ep2Mfa0KgMx6ea3WTQzjPI38l9nEZvgEa JfiPvlEgOSN4hX3nx5aOhPlKffptxOMcDzztuquT5WIrQqvjEpPESeDAdGLwkNcJOg9o Nt6tsgqaBCnl4TIHnAiyyWx2M/1Qw0NxuEHi1tPd7hZfW+OaaIFuxoe86QlKITVjiZLF JyTQ== 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=F0SiCdRrogFaqcO9GPfQ2lvU4hRmgKB6mjy3RGJ+kns=; fh=34zNr7a0BVYUu9GLC6Z8rO/FcAceqP5NONmRFRP2POA=; b=QvXUCDDxdjkdjBCdEw02kfRhVcaJAxvqqT7rvx8w2zcA1YB/Im7pCgICnd1Sr99S1T IwQ+Ms13h+5p69jQv0j3hZSbQJhjBadkep/+NwHwA8dzEa60mC2ew7toKUTYsoPqUzow di+QhrEVplvOXlv56l2wg4r7/kEAvhfOoGDlkTvz7qNUA2npmXYRFCV/3T2Eh1Xu0+CL e9SSpZPCAZxWzDHWMzNqGt47ANs9F5ucTGgNLZfnrF2k2vUKk8qbxRgZInOPUN3UJc+7 C5oq42tiA8k8TPxqjgcv1x6lNNx4DoaPTjZ5dr7xnRkehhEJqxbuUWSiajKiHMxYWrj3 E7SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PuQmyRVl; spf=pass (google.com: domain of linux-kernel+bounces-19751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19751-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d31-20020a631d5f000000b005c6eb3502bfsi6272573pgm.309.2024.01.08.07.22.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 07:22:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PuQmyRVl; spf=pass (google.com: domain of linux-kernel+bounces-19751-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19751-ouuuleilei=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 39C1AB22E29 for ; Mon, 8 Jan 2024 15:20:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 86B0D537F1; Mon, 8 Jan 2024 15:18:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="PuQmyRVl" 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 E2002524A2; Mon, 8 Jan 2024 15:18:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FFDFC4166B; Mon, 8 Jan 2024 15:18:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1704727112; bh=yRE6PYaDBQWCEJAQHlZSqyEFDAFo/1wr7VhpyL1bSEE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=PuQmyRVlJoSoS66BS5OQqhtApFrOiQo+Y/7lqQFPVi1KV9C4LwoELM7cncTE3kNHY g8SRiwObOj6/rl6J1bBirQgMmR4fcia6QU8Gfs/GIYUVLyWQOhtUe+gEf8VO5oFht9 MnQzX6XkPB3t1BVvLwsbyLdVjVuES1XvbBhWWbAsiJLpKHbICvnx5bheAeILN+qCw1 XNGWD+n7HDJfbLMteeBd4c0ZgY+qsj2sb0f03ou4OEVGY8FDBTMIigBEVPLDY+YU/M /7eRvvW01raTLIALBDgq9WwXhdrxGAkFcHBFsAZUTO6O5f39uxEvf5qfOiLLbWQ+RL zcHnX8GMnj+UA== From: Eric Van Hensbergen Date: Mon, 08 Jan 2024 15:18:21 +0000 Subject: [PATCH v2 5/8] fs/9p: Eliminate now unused v9fs_get_inode Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240108-ericvh-fix-cache-dups-v2-5-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=1950; i=ericvh@kernel.org; h=from:subject:message-id; bh=yRE6PYaDBQWCEJAQHlZSqyEFDAFo/1wr7VhpyL1bSEE=; b=owEBbQKS/ZANAwAKAYj/1ftKX/+YAcsmYgBlnBJDrhR11jQUqruHWzbI87YKtpGC0MDEnVJll 0M1z1c8j8eJAjMEAAEKAB0WIQSWlvDRlqWQmKTK0VGI/9X7Sl//mAUCZZwSQwAKCRCI/9X7Sl// mKLsEACGqbKDEItypwvOa91xtEAwMpftX9Sft+ackDPWm5aDeLA2e64e4SedBvCKYF07vCzafzP MW55RTiAIn10xwajgkPyFT4U7bW1lxzlTotFeep/6ZudYWnyWwk0mXDOSwKKUQFYCRbdtHZ84Fo tI1dualnmv7Sxr0bY65CR7nIkZV2OPYehNUiZrd9Tb6Z3+OhbbaAB9nzR7SaWLsIHTjYp/X6eSL OQm1QcR1pY/UbtTiXKIGUbc4mlhFq0WCYsK/Wk6XSYllNHGU5V57GAHv6/ng/Xuncj3RPJvL8hB eudIE/88U0XQKhfODWshfXiuAAS9kCnec3fNwCWO1yv67KBz3KlRseQyTYCyBmPQ1zRHK26/zH3 KoZqm+Hx9fCmzjGSCxZNHfxU7yDDrni1ba8ZUcZ3kMO6si7hu4RQqYUD5PmPNfGtK8JfQf88HwW 68E6Nx8hdCqmo84sklNjVWW1lGpC+ptcVD9PPq4zQofJ1GNyZY4qDF6gPo3ScRxx9pFnDszmcFb T9ICozIuQA4JRIikMmzY0VN2XemOjYDqAoj9epT5A5J3NKWiaYkS/GlD3I/02qWM7vENYJXJhsG NP2l01qvJJVaIWbzJrqJMSvWuxvkKIDdoNUEhrtXHtueWSclUnkfZeSLlYfnfp3QZhYgQff+2i/ v04TCZ9KLESaJZA== X-Developer-Key: i=ericvh@kernel.org; a=openpgp; fpr=9696F0D196A59098A4CAD15188FFD5FB4A5FFF98 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787536166552664373 X-GMAIL-MSGID: 1787536166552664373 Now with all inode allocation going through get_from_fid functions we can remove v9fs_get_inode and reduce us down to a single inode allocation path. Signed-off-by: Eric Van Hensbergen --- fs/9p/v9fs_vfs.h | 2 -- fs/9p/vfs_inode.c | 29 ----------------------------- 2 files changed, 31 deletions(-) diff --git a/fs/9p/v9fs_vfs.h b/fs/9p/v9fs_vfs.h index 731e3d14b67d..ad0310deb6c8 100644 --- a/fs/9p/v9fs_vfs.h +++ b/fs/9p/v9fs_vfs.h @@ -40,8 +40,6 @@ extern struct kmem_cache *v9fs_inode_cache; struct inode *v9fs_alloc_inode(struct super_block *sb); void v9fs_free_inode(struct inode *inode); -struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, - dev_t rdev); int v9fs_init_inode(struct v9fs_session_info *v9ses, struct inode *inode, umode_t mode, dev_t rdev); void v9fs_evict_inode(struct inode *inode); diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c index b845ee18a80b..0d06dca353aa 100644 --- a/fs/9p/vfs_inode.c +++ b/fs/9p/vfs_inode.c @@ -333,35 +333,6 @@ int v9fs_init_inode(struct v9fs_session_info *v9ses, } -/** - * v9fs_get_inode - helper function to setup an inode - * @sb: superblock - * @mode: mode to setup inode with - * @rdev: The device numbers to set - */ - -struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t rdev) -{ - int err; - struct inode *inode; - struct v9fs_session_info *v9ses = sb->s_fs_info; - - p9_debug(P9_DEBUG_VFS, "super block: %p mode: %ho\n", sb, mode); - - inode = new_inode(sb); - if (!inode) { - pr_warn("%s (%d): Problem allocating inode\n", - __func__, task_pid_nr(current)); - return ERR_PTR(-ENOMEM); - } - err = v9fs_init_inode(v9ses, inode, mode, rdev); - if (err) { - iput(inode); - return ERR_PTR(err); - } - return inode; -} - /** * v9fs_evict_inode - Remove an inode from the inode cache * @inode: inode to release