From patchwork Mon Feb 2 22:38:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5764831 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6F281BF440 for ; Mon, 2 Feb 2015 22:39:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 80410209E9 for ; Mon, 2 Feb 2015 22:39:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 98373209E8 for ; Mon, 2 Feb 2015 22:39:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965349AbbBBWjx (ORCPT ); Mon, 2 Feb 2015 17:39:53 -0500 Received: from mail-pa0-f43.google.com ([209.85.220.43]:63253 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965042AbbBBWjx (ORCPT ); Mon, 2 Feb 2015 17:39:53 -0500 Received: by mail-pa0-f43.google.com with SMTP id eu11so87898308pac.2 for ; Mon, 02 Feb 2015 14:39:52 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=s5HHQvoATjdKlXbS23er8ojmoUKVsWjKesCZLRp8AI8=; b=LOnpyG0r53g+h8DbqAlhIl6ljCh4P68eZj4y8C+btSC0tMDJaEZxrPRdZ+GetOum4S l8J7lCQYvdQPwVoG6BvJ6T7fo+5gCdqh6+PuFfCkaT82B+Kn/9q9E9xB8bWJq03Bq+Dr ExoyvJKr3B03Zq62IkohSGg2ypc0/8fFZdtrDJZDrYuRMWm1oeuFYZQU7n7iqYBUVscx /lW8pbxWnDgqy5DNQ4Dub83nhEb3Re/WTYlpq3xHm4T6WHS91WzA9I5akMzYumB3pm5i kdIFNsPMxS3f5KEQKBRyY8Q90NM34SGkn6aCo+F0M3ydmuETCjM45Xon+3/LVDWunWWc pwLw== X-Gm-Message-State: ALoCoQkmemTrpo8jWNucIDHO2QNXWGqGxkcpqoYnKj9ICvrT1bl36bwP4XbgVkDn4N65K0CuPoTx X-Received: by 10.68.172.193 with SMTP id be1mr1582012pbc.64.1422916792879; Mon, 02 Feb 2015 14:39:52 -0800 (PST) Received: from localhost.localdomain ([50.242.95.105]) by mx.google.com with ESMTPSA id bx13sm94656pdb.19.2015.02.02.14.39.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Feb 2015 14:39:52 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing list Subject: [PATCH v6 12/53] nfs: allow different protocol in nfs_initiate_commit Date: Mon, 2 Feb 2015 14:38:26 -0800 Message-Id: <1422916747-86649-13-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1422916747-86649-1-git-send-email-loghyr@primarydata.com> References: <1422916747-86649-1-git-send-email-loghyr@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Peng Tao pnfs flexfile layout client may want to use NFSv3 ops rather than the default MDS v4 ops. Signed-off-by: Peng Tao Signed-off-by: Tom Haynes --- fs/nfs/filelayout/filelayout.c | 2 +- fs/nfs/internal.h | 1 + fs/nfs/pnfs_nfs.c | 1 + fs/nfs/write.c | 7 ++++--- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 25c4896..e5a3c5b 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -1055,7 +1055,7 @@ 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, + return nfs_initiate_commit(ds_clnt, data, NFS_PROTO(data->inode), &filelayout_commit_call_ops, how, RPC_TASK_SOFTCONN); out_err: diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 495c516..331f11f 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -434,6 +434,7 @@ extern void nfs_write_prepare(struct rpc_task *task, void *calldata); extern void nfs_commit_prepare(struct rpc_task *task, void *calldata); extern int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data, + const struct nfs_rpc_ops *nfs_ops, const struct rpc_call_ops *call_ops, int how, int flags); extern void nfs_init_commit(struct nfs_commit_data *data, diff --git a/fs/nfs/pnfs_nfs.c b/fs/nfs/pnfs_nfs.c index 23c851d..c87f664 100644 --- a/fs/nfs/pnfs_nfs.c +++ b/fs/nfs/pnfs_nfs.c @@ -278,6 +278,7 @@ pnfs_generic_commit_pagelist(struct inode *inode, struct list_head *mds_pages, if (!data->lseg) { nfs_init_commit(data, mds_pages, NULL, cinfo); nfs_initiate_commit(NFS_CLIENT(inode), data, + NFS_PROTO(data->inode), data->mds_ops, how, 0); } else { struct pnfs_commit_bucket *buckets; diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 54d4857..8800bd3 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1465,6 +1465,7 @@ 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, + const struct nfs_rpc_ops *nfs_ops, const struct rpc_call_ops *call_ops, int how, int flags) { @@ -1486,7 +1487,7 @@ int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data, .priority = priority, }; /* Set up the initial task struct. */ - NFS_PROTO(data->inode)->commit_setup(data, &msg); + nfs_ops->commit_setup(data, &msg); dprintk("NFS: %5u initiated commit call\n", data->task.tk_pid); @@ -1589,8 +1590,8 @@ nfs_commit_list(struct inode *inode, struct list_head *head, int how, /* Set up the argument struct */ nfs_init_commit(data, head, NULL, cinfo); atomic_inc(&cinfo->mds->rpcs_out); - return nfs_initiate_commit(NFS_CLIENT(inode), data, data->mds_ops, - how, 0); + return nfs_initiate_commit(NFS_CLIENT(inode), data, NFS_PROTO(inode), + data->mds_ops, how, 0); out_bad: nfs_retry_commit(head, NULL, cinfo); cinfo->completion_ops->error_cleanup(NFS_I(inode));