From patchwork Fri Apr 28 17:25:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 9705139 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B2BD6602BE for ; Fri, 28 Apr 2017 17:25:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A6EDF25404 for ; Fri, 28 Apr 2017 17:25:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BC8C28693; Fri, 28 Apr 2017 17:25:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45C6B25404 for ; Fri, 28 Apr 2017 17:25:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S968718AbdD1RZn (ORCPT ); Fri, 28 Apr 2017 13:25:43 -0400 Received: from mail-it0-f65.google.com ([209.85.214.65]:32910 "EHLO mail-it0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S967456AbdD1RZm (ORCPT ); Fri, 28 Apr 2017 13:25:42 -0400 Received: by mail-it0-f65.google.com with SMTP id z67so6487009itb.0 for ; Fri, 28 Apr 2017 10:25:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=WUqKFFeiTAEnUrzoS/qiv905E/M58CI8a/uHK69wbZE=; b=L5NZt6EXbTDabJo9ukUpC59D+QdmM8h+w+epdRJvwYxwV9I5kvaIqss3vl+KV/4XF3 pWIykIoGnrCasdTjboG6pESadao4Xd9HqH1ao5KAuuNTaOlvSqpn4WNtCYO6tusNWJJz jLozMl0YzoEu/WEkBfyjwbSTcFivpMiHUoPOHa//VHNbfQiOL1IUBxFepvU7GmwM3dlp bPthzMReirQi54P5mDvZzDyXpGyyliSJa/ONgmpF5GPA6HEdF0YxRzRjiBb01gkPQLqV yy9qvNECRkBnjx8KBD+KUY5cI1YUE/ixQD8/Pe4eA3TxIlNeWOvRUdUSLs1FgoZ9OJLE Y2Lg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=WUqKFFeiTAEnUrzoS/qiv905E/M58CI8a/uHK69wbZE=; b=L+klq0G0CjOMtu77NN7qSSoH1mdxLpvyxDTnQXt8UxQP/UlYOCWEOpF+ILRbKqzimE 3pVCYtuXwmY2Qq8Fb+HHkr9nj0QSKk6D59Z6pMmmI+5hT8bt5dpso0Q8cEworSW5/SbA +3Vgr9vwFmtzV6BhIMh3EK+QfJFKWjibCwAF0fENEtsI779yMWGbvEwtdzc8YXpOivyR Dzb3nNeR5mjy/V28W4oC99IpitOCwxXK0G3H0i3YI0L/8YFEA/WliCtokpChoGQQrGqb RF1Ze0S7qIGeMQ7IXj7/CYKPRj39L/My0L3WX9UQjGZYoOL+PJPfWbCi8XlqLlLeq7go 6udA== X-Gm-Message-State: AN3rC/4CLMqdcbJvjJ1bjmrXK9qMTRZ9zyPz2cBpZWRcGAgzi6vyVdyc gv1wjWpOimkM4w== X-Received: by 10.36.211.207 with SMTP id n198mr7755298itg.105.1493400341253; Fri, 28 Apr 2017 10:25:41 -0700 (PDT) Received: from localhost.localdomain (c-68-49-162-121.hsd1.mi.comcast.net. [68.49.162.121]) by smtp.gmail.com with ESMTPSA id s40sm66842ite.18.2017.04.28.10.25.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 28 Apr 2017 10:25:40 -0700 (PDT) From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [RFC PATCH 2/5] NFS: Add a mount option to specify number of TCP connections to use Date: Fri, 28 Apr 2017 13:25:32 -0400 Message-Id: <20170428172535.7945-3-trond.myklebust@primarydata.com> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170428172535.7945-2-trond.myklebust@primarydata.com> References: <20170428172535.7945-1-trond.myklebust@primarydata.com> <20170428172535.7945-2-trond.myklebust@primarydata.com> Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allow the user to specify that the client should use multiple connections to the server. For the moment, this functionality will be limited to TCP and to NFSv4.x (x>0). Signed-off-by: Trond Myklebust --- fs/nfs/internal.h | 1 + fs/nfs/super.c | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 31b26cf1b476..31757a742e9b 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -117,6 +117,7 @@ struct nfs_parsed_mount_data { char *export_path; int port; unsigned short protocol; + unsigned short nconnect; } nfs_server; struct security_mnt_opts lsm_opts; diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 54e0f9f2dd94..7eb48934dc79 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -76,6 +76,8 @@ #define NFS_DEFAULT_VERSION 2 #endif +#define NFS_MAX_CONNECTIONS 16 + enum { /* Mount options that take no arguments */ Opt_soft, Opt_hard, @@ -107,6 +109,7 @@ enum { Opt_nfsvers, Opt_sec, Opt_proto, Opt_mountproto, Opt_mounthost, Opt_addr, Opt_mountaddr, Opt_clientaddr, + Opt_nconnect, Opt_lookupcache, Opt_fscache_uniq, Opt_local_lock, @@ -179,6 +182,8 @@ static const match_table_t nfs_mount_option_tokens = { { Opt_mounthost, "mounthost=%s" }, { Opt_mountaddr, "mountaddr=%s" }, + { Opt_nconnect, "nconnect=%s" }, + { Opt_lookupcache, "lookupcache=%s" }, { Opt_fscache_uniq, "fsc=%s" }, { Opt_local_lock, "local_lock=%s" }, @@ -1544,6 +1549,11 @@ static int nfs_parse_mount_options(char *raw, if (mnt->mount_server.addrlen == 0) goto out_invalid_address; break; + case Opt_nconnect: + if (nfs_get_option_ul_bound(args, &option, 1, NFS_MAX_CONNECTIONS)) + goto out_invalid_value; + mnt->nfs_server.nconnect = option; + break; case Opt_lookupcache: string = match_strdup(args); if (string == NULL)