Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1076504lqt; Fri, 7 Jun 2024 07:26:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUF4ZjhgHXO98wcpci5V2IBhJG42FmRO7usDQuiqe5gCbPx2UGLpecsVGHs2D4CsLFFDHUiMqFgQku+AIP5Hnfh7Q6mD+oemTSvq4QkBg== X-Google-Smtp-Source: AGHT+IHUJcoso5TVCONDppXMLblL54nNxBwbLWzSAO/fu38Y1XbmKXpPOJF0BaQ/Xs0W7DZuI7JN X-Received: by 2002:a17:90a:67cb:b0:2b3:9ce8:1239 with SMTP id 98e67ed59e1d1-2c2bc9ba615mr2742554a91.6.1717770417969; Fri, 07 Jun 2024 07:26:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717770417; cv=pass; d=google.com; s=arc-20160816; b=Txi7KkdENz0bjD6yWm1Flu3TDcSz+rZRj6F3t14XpLlzDJoAa8Zd5/CCL4lgAzB/F8 AbfrI7YnHcVCt5Mz+rDpU4RYjF5e7HD1+6bDF+ggZ9Il/6KwVYicJAsn1VCCZMjo9PtB TsWKj9zFweecioOgTPwg5Z6PnLQkvkRRPDW2Jwhi8Eq4EALxbzsAb16nKhjwyHKTL2fi AEGJrPuHCs/VHJCTuIOx2XtNDIb6us2wlbH9+QbxPNbCw6Ac4v+Fvpb9T1z8oh7SmoAV HtD7BE+XH+ZEMOprfe0Diy7iqGedzL3TSs1ny3B215xysaFDohzM5ZA02UNKQwuvgF+9 nyGA== 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; bh=USn/QLhozc2jhp0VH80LWJyVynJZNtqHCfecPyiFPC4=; fh=OUKZWod6C22emJS3X689dwhO5bDgGbDS06P/Z6+EGqk=; b=aVKR3HMq+h9U21VxZbfrE6ycvdQcKrlP5qXLIeps2pIBtGsDQXvlJicZCCvOYXTQXu VACOR/WaRWQw2ZqKwaCZa+W0gbfhM/+eAZKNaQBPJEViXmKUm+cjjMh/5Cs9ulvhYVQk mzFI3xX1X0o04lXlVAdtzayWprQvWMU7VZXj82Lrh00riHVNLfxLhGCZy89Cu3OsvW3P oJnEeh1xq8ml8PQZIvZd+dtVcankdl/QM82B9S/yEeeQv5xoY9eTHj2uENEsQl2JGKEi ruRqFoP/A4OZZpzb0L2ndXA9+HEStiCUxHCwwGWFK72yFU3vi15U1KPdzP5BVtVtVZSu TPnQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-nfs+bounces-3586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3586-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2c2806bcca7si2505728a91.113.2024.06.07.07.26.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 07:26:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-nfs+bounces-3586-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3586-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 8173A283817 for ; Fri, 7 Jun 2024 14:26:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DFCE3194AD3; Fri, 7 Jun 2024 14:26:52 +0000 (UTC) X-Original-To: linux-nfs@vger.kernel.org Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2BA3E194A7D for ; Fri, 7 Jun 2024 14:26:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717770412; cv=none; b=EnAJ1KiIRsidgMZQzU39QZ4U/HJ6WYZwon4LFsx5IDzhmGcUQ/1O30yPjtvXViGFHPMwln+Siz7PL7ba6uBlTMvZcihuYqYpATiZHbvPlmUpQeLhI8tbXgDG0H3afyZZd9dFAOehs1KOuOU88g27dJDfre6bpif3wgHW5Ywf6jw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717770412; c=relaxed/simple; bh=0hD4p+RsLXXmIp/p7P+GiqGXMgQTU+kym+vazbNcDwc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NGcrvb3gXEMlHtbh03q3xX0eI+nWyOKNAMeLoo7vNitKHPQ7TIHKcpHqmLZJFcBu8KNWeodEBZ3R1JMj95VsL+FbLouc2vP/54QDX8bTSUIrf2pxJzx/uS+OCZddwIq32Ks58MntD0SNEJ97D6ZurvsjeRdqGLiTV4gXS+7q64o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=snitzer.net; arc=none smtp.client-ip=209.85.210.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=snitzer.net Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6f9475abde6so1272959a34.3 for ; Fri, 07 Jun 2024 07:26:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717770410; x=1718375210; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=USn/QLhozc2jhp0VH80LWJyVynJZNtqHCfecPyiFPC4=; b=ONVpEJZMMYvqTgafH/jEwVBSZFl9Ih8tDbC5UM9eGc+F6CJbFUBD6ZmT3d7K623QZf DUNZGs8xrQTZ/Qq7fLH66XXYP0cyhXxNN+plLJNy/EFVWpxirF7DPCo/NIVCdx5wKelH oxF6FSRTV1MnXuefmYDVvDpaYfLcwsJOGfN4QVEDe65I9nLFwXa2L3MKaO1iuHIc/Ztm E2pQvhRSeRHtjXWhtOh80m0qUKN1URrKCyOm37/Y7PaURSEpG6rDJkt2mJRPTHZVbS6z 85XpqTLe0k0WbZ4WnVq/Cr/roDIq0UuWv4Wq6kmH4nS9LtqStgdvqI9yQyrCfGGre5ia sDjw== X-Gm-Message-State: AOJu0Yyz5KPqFf9TuR8XPCT+EzDpW+eAFgycEoHayrEIx3RQrr+KY+m+ tfTzYMx+RWFhp6WCTgA3geW4bDx+rC+YhVJ7LZD6Vp+10NWnfjq2qZfXmCHuJOtUcmBAKKiv8A2 ZVJUfmg== X-Received: by 2002:a54:4094:0:b0:3d2:dca:4031 with SMTP id 5614622812f47-3d210d6264fmr2376561b6e.15.1717770409770; Fri, 07 Jun 2024 07:26:49 -0700 (PDT) Received: from localhost (pool-68-160-141-91.bstnma.fios.verizon.net. [68.160.141.91]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6b04f624895sm17691286d6.17.2024.06.07.07.26.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 07:26:49 -0700 (PDT) From: Mike Snitzer To: linux-nfs@vger.kernel.org Cc: Jeff Layton , Chuck Lever , Trond Myklebust , snitzer@hammerspace.com Subject: [for-6.11 PATCH 01/29] nfs: pass nfs_client to nfs_initiate_pgio Date: Fri, 7 Jun 2024 10:26:18 -0400 Message-ID: <20240607142646.20924-2-snitzer@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240607142646.20924-1-snitzer@kernel.org> References: <20240607142646.20924-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. 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