Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp561850lqs; Thu, 13 Jun 2024 20:44:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX7VTtI5gjeRkVfzCRIVU4B5fieBGfwAseCrc/wPl3gmEg0MjSrSrPnVHVzLknZT8pyoFEUk5PEiQwA0NYDwcuTbcw3eeHiw879vq9hgA== X-Google-Smtp-Source: AGHT+IHjLR0KeRzzVGNJh/p0YgD9BhHJp3VH/iGoLqIqJkSHL1ujWNDogEGlPrDLdQ8eTnh9yw/x X-Received: by 2002:ad4:4dc9:0:b0:6b0:86bd:dc92 with SMTP id 6a1803df08f44-6b2afd779d8mr16915486d6.50.1718336674035; Thu, 13 Jun 2024 20:44:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718336674; cv=pass; d=google.com; s=arc-20160816; b=J/AHY4KPZTDISDFEFNg1OGcuo9+ZSgzySEunn83aTdnVi+Ey8GiUe6Z6IW3JtfDCjc onNE5xnlWZLhAgVDdwYUHX23f9nTL6DFOVacoVxHxaWWM9+SO2pRVOajeTQNEZmzNh6K NHC0hmpJY4/jz9tBB2nBXJ9bNcNCBHr5gd/u7q1pvBt3/9VRYQydS3Mv6cUODTZ5qHWW rXb/nP8CKOX/Z+VF41wQhNPV1IVsGg6dEQvTDpXDMZH8VPaIM7ggFvOhUAJAp1eboc0x HN4kxrccySnvR7zfPFylQNLURU+lwK87GFdCqplcBMAG+hPnaUrJo39ObusAKgtZpGUX 4OeQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=/zBSpUOBavgzm34CdikO2eC00JDqR5Z25d701iJKxKE=; fh=+HdF1SWcNPggmowVZtzfZ2+SYSXLLgvZBECjaw6UQek=; b=l1gBT4Bw5uVrylyGZECKEzsZL6rifKowYayPU3uJmO4gqYzV5v8qiiSV/ZuoqtONOB r3k3C6REScmO4059mgn+Y0OgsKxVPA0bZrqDYailop2z89V12bYIV6rG/fEw4nYZckIu 9FFCdSBFR4ebROqHmeo+5fWCeCgxTVkLJaRJWBRHTYlz3anaSMXO5zdWgfwrHzx9pUSz cD5k59Jw0B8AmyD9Kx3sPbU2vD9b9pdLKfm1L3MXObGdeG/Zr9NcveuWt6Mq3AItGoMt 7FHtFP83AQ5JBWmliMfqW9bIdDqPI13Ipm9Rt+ANGrwlIA8GLKMzHuq2NWp2Ow0ZaUlo t60g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lrNyRny7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3801-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3801-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 6a1803df08f44-6b2a5a151besi29641626d6.74.2024.06.13.20.44.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 20:44:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3801-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=lrNyRny7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3801-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3801-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 B04321C2106D for ; Fri, 14 Jun 2024 03:44:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DEC4D146A6C; Fri, 14 Jun 2024 03:44:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="lrNyRny7" X-Original-To: linux-nfs@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 BB695ECC for ; Fri, 14 Jun 2024 03:44:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718336669; cv=none; b=YdHPMr0sQRpZbRG+NMmY4n+HUfXAU7e/54uYnZ074kE2mhZTXSB4a0nivfqB7nUEixIHiMepz4LUCOouiG2JNu6jUFCF4XcosU179OPFxi+xg5Llfo52GiLT3YJdpQg8fQ0QiWWb2owm4/iKLYdaSkGQQLE6i+It1/GkVJb24X4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718336669; c=relaxed/simple; bh=zqo5A9VtZlcvmmu0XkGwH+wtxeFhmulZftxFgSSuOAc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T+U0n4oPTvTPiaDIlKmGZPW44EiYdR9hiTSKUl8Vb9dfh5bFOmxqi3hC99oKD0Y+W7/G59+B0ImDLYUUnuQA9/tb0F6MBwpNTDcKZ+QGH20X9SfvHLVwoEMe0nuXLmARY8G/ibzD+Nx5bUnLtUxAJ+zVZSN7E04mdd1uwyqTy80= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lrNyRny7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E7A48C4AF48; Fri, 14 Jun 2024 03:44:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718336669; bh=zqo5A9VtZlcvmmu0XkGwH+wtxeFhmulZftxFgSSuOAc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lrNyRny7FiZI6JNPNbrvqbmd9CQXjdB3fnogfCxTCMBkQqQXxBS+0K5OvyODEu7Iw pxghXObcBdl9wrwowGcf+l00btqUDd8Laa9tlm5429zFp0g1kgpZsX3lqF6rHIOSgg 2B+h6v0v5NZuvxuKHJxy/Q1mPE16W3OJm6KZ1wW8sxOrdbDRzfzo0zh8rTSUekmYK5 GH6d8ap62vSgUPMhbchFKF+wLPRBLy5F++rMMvS2qLuovEx3lYONbWhFcPx0+zvaKe R74wplAETY8Xb+OCOOQ2iSxwLm6KtiINKggj0E10WbXSxAU8uPR2cAPf4CWLidGyPh JX6L0MrC9NY7w== From: Mike Snitzer To: linux-nfs@vger.kernel.org Cc: Jeff Layton , Chuck Lever , Trond Myklebust , NeilBrown , snitzer@hammerspace.com Subject: [PATCH v3 01/18] nfs: pass nfs_client to nfs_initiate_pgio Date: Thu, 13 Jun 2024 23:44:09 -0400 Message-ID: <20240614034426.31043-2-snitzer@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240614034426.31043-1-snitzer@kernel.org> References: <20240614034426.31043-1-snitzer@kernel.org> Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Weston Andros Adamson The nfs_client is needed for localio support. Otherwise it won't be possible to disable localio if it is attempted but fails. Signed-off-by: Weston Andros Adamson Signed-off-by: Lance Shelton Signed-off-by: Trond Myklebust Signed-off-by: Mike Snitzer --- fs/nfs/filelayout/filelayout.c | 4 ++-- fs/nfs/flexfilelayout/flexfilelayout.c | 6 ++++-- fs/nfs/internal.h | 5 +++-- fs/nfs/pagelist.c | 10 ++++++---- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 29d84dc66ca3..43e16e9e0176 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -486,7 +486,7 @@ filelayout_read_pagelist(struct nfs_pgio_header *hdr) hdr->mds_offset = offset; /* Perform an asynchronous read to ds */ - nfs_initiate_pgio(ds_clnt, hdr, hdr->cred, + nfs_initiate_pgio(ds->ds_clp, ds_clnt, hdr, hdr->cred, NFS_PROTO(hdr->inode), &filelayout_read_call_ops, 0, RPC_TASK_SOFTCONN); return PNFS_ATTEMPTED; @@ -528,7 +528,7 @@ filelayout_write_pagelist(struct nfs_pgio_header *hdr, int sync) hdr->args.offset = filelayout_get_dserver_offset(lseg, offset); /* Perform an asynchronous write */ - nfs_initiate_pgio(ds_clnt, hdr, hdr->cred, + nfs_initiate_pgio(ds->ds_clp, ds_clnt, hdr, hdr->cred, NFS_PROTO(hdr->inode), &filelayout_write_call_ops, sync, RPC_TASK_SOFTCONN); return PNFS_ATTEMPTED; diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 24188af56d5b..327f1a5c9fbe 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -1803,7 +1803,8 @@ ff_layout_read_pagelist(struct nfs_pgio_header *hdr) hdr->mds_offset = offset; /* Perform an asynchronous read to ds */ - nfs_initiate_pgio(ds_clnt, hdr, ds_cred, ds->ds_clp->rpc_ops, + nfs_initiate_pgio(ds->ds_clp, ds_clnt, hdr, ds_cred, + ds->ds_clp->rpc_ops, vers == 3 ? &ff_layout_read_call_ops_v3 : &ff_layout_read_call_ops_v4, 0, RPC_TASK_SOFTCONN); @@ -1871,7 +1872,8 @@ ff_layout_write_pagelist(struct nfs_pgio_header *hdr, int sync) hdr->args.offset = offset; /* Perform an asynchronous write */ - nfs_initiate_pgio(ds_clnt, hdr, ds_cred, ds->ds_clp->rpc_ops, + nfs_initiate_pgio(ds->ds_clp, ds_clnt, hdr, ds_cred, + ds->ds_clp->rpc_ops, vers == 3 ? &ff_layout_write_call_ops_v3 : &ff_layout_write_call_ops_v4, sync, RPC_TASK_SOFTCONN); diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 9f0f4534744b..a9c0c29f7804 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -306,8 +306,9 @@ extern const struct nfs_pageio_ops nfs_pgio_rw_ops; struct nfs_pgio_header *nfs_pgio_header_alloc(const struct nfs_rw_ops *); void nfs_pgio_header_free(struct nfs_pgio_header *); int nfs_generic_pgio(struct nfs_pageio_descriptor *, struct nfs_pgio_header *); -int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr, - const struct cred *cred, const struct nfs_rpc_ops *rpc_ops, +int nfs_initiate_pgio(struct nfs_client *clp, struct rpc_clnt *rpc_clnt, + struct nfs_pgio_header *hdr, const struct cred *cred, + const struct nfs_rpc_ops *rpc_ops, const struct rpc_call_ops *call_ops, int how, int flags); void nfs_free_request(struct nfs_page *req); struct nfs_pgio_mirror * diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index 6efb5068c116..d9b795c538cd 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -844,8 +844,9 @@ static void nfs_pgio_prepare(struct rpc_task *task, void *calldata) rpc_exit(task, err); } -int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr, - const struct cred *cred, const struct nfs_rpc_ops *rpc_ops, +int nfs_initiate_pgio(struct nfs_client *clp, struct rpc_clnt *rpc_clnt, + struct nfs_pgio_header *hdr, const struct cred *cred, + const struct nfs_rpc_ops *rpc_ops, const struct rpc_call_ops *call_ops, int how, int flags) { struct rpc_task *task; @@ -855,7 +856,7 @@ int nfs_initiate_pgio(struct rpc_clnt *clnt, struct nfs_pgio_header *hdr, .rpc_cred = cred, }; struct rpc_task_setup task_setup_data = { - .rpc_client = clnt, + .rpc_client = rpc_clnt, .task = &hdr->task, .rpc_message = &msg, .callback_ops = call_ops, @@ -1070,7 +1071,8 @@ static int nfs_generic_pg_pgios(struct nfs_pageio_descriptor *desc) if (ret == 0) { if (NFS_SERVER(hdr->inode)->nfs_client->cl_minorversion) task_flags = RPC_TASK_MOVEABLE; - ret = nfs_initiate_pgio(NFS_CLIENT(hdr->inode), + ret = nfs_initiate_pgio(NFS_SERVER(hdr->inode)->nfs_client, + NFS_CLIENT(hdr->inode), hdr, hdr->cred, NFS_PROTO(hdr->inode), -- 2.44.0