Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1076523lqt; Fri, 7 Jun 2024 07:27:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/SxJUT+oa9PyF78rEMQA85aFmgzRfvMVyRXsYHH31O4RjO7VhpAdNoNxml+P0OkeY9sxJJiM2qun4XH1ci/U/49TCjSdKEE/bt3zrVw== X-Google-Smtp-Source: AGHT+IHk8n/+0pQ1SwBmrj1rpqBMCNTrT7WDmkVX0YWM5PwKnAPCELiHkH0k2Cqp9tQQusj8tZNM X-Received: by 2002:ac8:7c46:0:b0:440:3894:843e with SMTP id d75a77b69052e-44041cb001amr35433881cf.52.1717770420324; Fri, 07 Jun 2024 07:27:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717770420; cv=pass; d=google.com; s=arc-20160816; b=qNDKFHouaKuyi7jpADqi7aZZpqhvestI6lVqwq8VdWVGZjmujM9beUItCcvFRq1N39 LEYF+vU0ofynT/Enopty5gC5ARP2JMY3oEMvYp1mzf2Ju9EJxJijH1Fb3vDV5xwxuTlX Hi/ePU7tvF2fDbNEKqCMiD8OxKN3llkR04oEUZYGPYzk1SF9xDyddpyLXBTLSD4j+hMq p6CqJuifG+1xV0q+m9ttSvbvXnifr/h0CSa4kUQ0CgtSJw3Zzuu82S/amjWZYaBujRCN js51Pp/tRUnxhYZ9edvacktr2/MAjAuy+r04JpjyAXw1QcGM8UN4lmBwrzh7zOLQlJBv /mEA== 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=EnNYWyXHuhFDL7wZWOuq2QeE/ImTtkP9BLnZljXVaag=; fh=OUKZWod6C22emJS3X689dwhO5bDgGbDS06P/Z6+EGqk=; b=l8p1WFbLFWymONCEvkT5GJr2DHCJwR+o/vL7PMXjsTlSXSvWt9YjI9oH8+e839tL3u YykNfspSrUAV5ZpLyX0wlu6dR8rouLac/MElpCsdgUwaKZfOTv2KS24FnUwLfWzvuCfC uvSubs7cerJ2v4L8Z7UcZyraRYf7pm6iUb7oSlaPOEZWzoniQ5bQLIbOjM/Zi9Izzjsi KLT9S3ACZ11chuV/H1QRPquW0lbhh2RpnwJO4TUmgT7/MpR5auCLqFivX2kKVMARO7Nz 3NLfyotgPdYJLN7ZvszFvgprLHsT7rVFptA0thEJYlATczD/e5AwA73me13V+Bl/2Z89 lR4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-nfs+bounces-3587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3587-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 d75a77b69052e-44042afadcfsi5747421cf.428.2024.06.07.07.27.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 07:27:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3587-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; arc=pass (i=1); spf=pass (google.com: domain of linux-nfs+bounces-3587-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3587-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 F2DFF1C22C97 for ; Fri, 7 Jun 2024 14:26:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F85D194A7D; Fri, 7 Jun 2024 14:26:54 +0000 (UTC) X-Original-To: linux-nfs@vger.kernel.org Received: from mail-ot1-f46.google.com (mail-ot1-f46.google.com [209.85.210.46]) (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 B8D741667DE for ; Fri, 7 Jun 2024 14:26:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717770414; cv=none; b=OLnrI+ZGCjWu4S/+Z1aH6kqZThFVhjm+pbL/El8skB3vNV5fhyCaB4WFnPhJTOdyxPRmCeP4tZcS/gFOFFLbjq9kK02roOtIVCYRguQwzYJ1XmU+1xAEdPS4/ecckf2ZxY1bo67m8GZNj4kGvCvf20Rvx+1wF4dcgFLQhaLC298= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717770414; c=relaxed/simple; bh=amhGV0eM29wfHo/NxsXnP4zfpYzz6VFtteyCvaazjTI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LhduvnFMxC1cu9kAXbkvKiwYEOziqxr7vDZn1boIL3xBbJDSHm7hyJ7HtYwUkmJ9jA7yZ+ROMr4MQOoRf05t2dQ1IthhEOkx0LQEzoxtZEe4tVmOrg8m2RcMrZ5J5QA+QeNHkrvxcRWIgXs9AqM6U7GpsMe8TiDcHCQ4jX0cFSw= 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.46 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-f46.google.com with SMTP id 46e09a7af769-6f93e7ebaf6so1136413a34.2 for ; Fri, 07 Jun 2024 07:26:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717770411; x=1718375211; 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=EnNYWyXHuhFDL7wZWOuq2QeE/ImTtkP9BLnZljXVaag=; b=b1zpqpDVspGEvaWffv262qT1rocviDWsMZG5p/hYSHpsqXdyuQJchuTGsmcpNuboTP x07+uF38trAdxeEJIK9QlpzJrUZbP12mTq9Cwbx3cdPhcB29umDfNBQGWp5oW42ypgJO mkCa8nU5pUI9klzcwGvg1O3ZZHlqIlpcXnyXqE0kOZiZpvApX/HJr2M7CzY2r2ZPB0Pa A5lu29yr18Qph3gfuW+gAQg/HWROT1nuo+m+hkAKyN91ci8sq3zU4eV8hNIqntFZz6eU mrvqyVneAez5tDgFQ9ByiEJie1gex4oZESPhxBDWEOhvCCDSCj7KzKA5qs2dnNqhSNwF fCYQ== X-Gm-Message-State: AOJu0YwrlOESZeuTnX22oLFa6aL4PweCpsltkUtkwKqjCImUp9Sd8VG3 3UDGxqqhGtoiYSbtjWzd8NUC9SeaNWj5yDD9zEEXlbBpi5Cd3EXM61r6A6Spa/i7+48TIpv9oJj c2Ou5Uw== X-Received: by 2002:a9d:75c4:0:b0:6f9:57e0:831a with SMTP id 46e09a7af769-6f957e0848cmr2189256a34.33.1717770411314; Fri, 07 Jun 2024 07:26:51 -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 af79cd13be357-795330b2310sm170869585a.84.2024.06.07.07.26.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 07:26:50 -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 02/29] nfs: pass nfs_client to nfs_initiate_commit Date: Fri, 7 Jun 2024 10:26:19 -0400 Message-ID: <20240607142646.20924-3-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 | 3 ++- fs/nfs/flexfilelayout/flexfilelayout.c | 2 +- fs/nfs/internal.h | 3 ++- fs/nfs/pnfs_nfs.c | 3 ++- fs/nfs/write.c | 9 ++++++--- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 43e16e9e0176..0c4a1fbb6a19 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -1009,7 +1009,8 @@ static int filelayout_initiate_commit(struct nfs_commit_data *data, int how) fh = select_ds_fh_from_commit(lseg, data->ds_commit_index); if (fh) data->args.fh = fh; - return nfs_initiate_commit(ds_clnt, data, NFS_PROTO(data->inode), + return nfs_initiate_commit(ds->ds_clp, ds_clnt, data, + NFS_PROTO(data->inode), &filelayout_commit_call_ops, how, RPC_TASK_SOFTCONN); out_err: diff --git a/fs/nfs/flexfilelayout/flexfilelayout.c b/fs/nfs/flexfilelayout/flexfilelayout.c index 327f1a5c9fbe..dee4bc560b8e 100644 --- a/fs/nfs/flexfilelayout/flexfilelayout.c +++ b/fs/nfs/flexfilelayout/flexfilelayout.c @@ -1948,7 +1948,7 @@ static int ff_layout_initiate_commit(struct nfs_commit_data *data, int how) if (fh) data->args.fh = fh; - ret = nfs_initiate_commit(ds_clnt, data, ds->ds_clp->rpc_ops, + ret = nfs_initiate_commit(ds->ds_clp, ds_clnt, data, ds->ds_clp->rpc_ops, vers == 3 ? &ff_layout_commit_call_ops_v3 : &ff_layout_commit_call_ops_v4, how, RPC_TASK_SOFTCONN); diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index a9c0c29f7804..13c28cae45c5 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -525,7 +525,8 @@ extern void nfs_pageio_init_write(struct nfs_pageio_descriptor *pgio, extern void nfs_pageio_reset_write_mds(struct nfs_pageio_descriptor *pgio); extern void nfs_commit_free(struct nfs_commit_data *p); extern void nfs_commit_prepare(struct rpc_task *task, void *calldata); -extern int nfs_initiate_commit(struct rpc_clnt *clnt, +extern int nfs_initiate_commit(struct nfs_client *clp, + struct rpc_clnt *clnt, struct nfs_commit_data *data, const struct nfs_rpc_ops *nfs_ops, const struct rpc_call_ops *call_ops, diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c index 88e061bd711b..b29b50c2c933 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c @@ -534,7 +534,8 @@ pnfs_generic_commit_pagelist(struct inode *inode, struct list_head *mds_pages, list_del(&data->list); if (data->ds_commit_index < 0) { nfs_init_commit(data, NULL, NULL, cinfo); - nfs_initiate_commit(NFS_CLIENT(inode), data, + nfs_initiate_commit(NFS_SERVER(inode)->nfs_client, + NFS_CLIENT(inode), data, NFS_PROTO(data->inode), data->mds_ops, how, RPC_TASK_CRED_NOREF); diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 2329cbb0e446..c9cfa1308264 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1667,7 +1667,9 @@ void nfs_commitdata_release(struct nfs_commit_data *data) } EXPORT_SYMBOL_GPL(nfs_commitdata_release); -int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data, +int nfs_initiate_commit(struct nfs_client *clp, + struct rpc_clnt *rpc_clnt, + struct nfs_commit_data *data, const struct nfs_rpc_ops *nfs_ops, const struct rpc_call_ops *call_ops, int how, int flags) @@ -1681,7 +1683,7 @@ int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data, }; struct rpc_task_setup task_setup_data = { .task = &data->task, - .rpc_client = clnt, + .rpc_client = rpc_clnt, .rpc_message = &msg, .callback_ops = call_ops, .callback_data = data, @@ -1814,7 +1816,8 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how, nfs_init_commit(data, head, NULL, cinfo); if (NFS_SERVER(inode)->nfs_client->cl_minorversion) task_flags = RPC_TASK_MOVEABLE; - return nfs_initiate_commit(NFS_CLIENT(inode), data, NFS_PROTO(inode), + return nfs_initiate_commit(NFS_SERVER(inode)->nfs_client, + NFS_CLIENT(inode), data, NFS_PROTO(inode), data->mds_ops, how, RPC_TASK_CRED_NOREF | task_flags); } -- 2.44.0