From patchwork Wed Dec 24 07:12:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Haynes X-Patchwork-Id: 5536881 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5C75EBEEA8 for ; Wed, 24 Dec 2014 07:13:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8147B200B4 for ; Wed, 24 Dec 2014 07:13:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6195A201B9 for ; Wed, 24 Dec 2014 07:13:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751441AbaLXHNr (ORCPT ); Wed, 24 Dec 2014 02:13:47 -0500 Received: from mail-ig0-f180.google.com ([209.85.213.180]:36341 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751821AbaLXHNp (ORCPT ); Wed, 24 Dec 2014 02:13:45 -0500 Received: by mail-ig0-f180.google.com with SMTP id h15so6657954igd.1 for ; Tue, 23 Dec 2014 23:13:44 -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=GQ66SSOMmOk4HnQYpdoNyrJ5wNpA8yO+09s8U4sRfLM=; b=YzaDZ6mqyk8+48VpkMXnz0k5ToFSc8cTMXmblmN/A/d4x60VajbUg+zDuAPo4hajlT FZ+ID/M7kSG+cuC807KP0ce3ruF21ws/paDbJfxarBRw0UQ/txpRtcY0jfFiFYZEtDml d2F7ICFQcgjLyGcjZoQhXDOlIWUEhmZZiqbAAzs8qc3VTJ3WrWtSeiEnR/QlAXCsAgKU oeE8hqsPbC521dkJNM19VBiKnD7m4pdyp4TGR77oSsdW13zbtVimEpdkPI2TaSlD1C2q VTtzfVG5A6C9/cFkxLhChAU1/TMU4sMRGNNr/h2dvbRBe8R/vGYOylIdMfzy6wtQfzi6 vWyw== X-Gm-Message-State: ALoCoQktMJWgmwhVLqyxSEhZ5FmZ8236QZ1kQnJ9aZ+LjTkIxwlPJdilauvQ7usnMP6hu1R3lwnR X-Received: by 10.42.204.139 with SMTP id fm11mr25926680icb.87.1419405224447; Tue, 23 Dec 2014 23:13:44 -0800 (PST) Received: from localhost.localdomain (c-68-40-185-14.hsd1.mi.comcast.net. [68.40.185.14]) by mx.google.com with ESMTPSA id 37sm8821410iog.39.2014.12.23.23.13.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 Dec 2014 23:13:44 -0800 (PST) From: Tom Haynes X-Google-Original-From: Tom Haynes To: Trond Myklebust Cc: Linux NFS Mailing List Subject: [PATCH v2 07/49] nfs41: move file layout macros to generic pnfs Date: Tue, 23 Dec 2014 23:12:46 -0800 Message-Id: <1419405208-25975-8-git-send-email-loghyr@primarydata.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1419405208-25975-1-git-send-email-loghyr@primarydata.com> References: <1419405208-25975-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 They can be reused by flexfile layout as well. Also add a code such that if read fails on one DS and there are other DSes available to use, don't resend through MDS but through pNFS so that client can read from other DSes. Reviewed-by: Jeff Layton Signed-off-by: Peng Tao Signed-off-by: Tom Haynes --- fs/nfs/filelayout/filelayout.h | 10 ---------- fs/nfs/pnfs.h | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/fs/nfs/filelayout/filelayout.h b/fs/nfs/filelayout/filelayout.h index f97eea6..2896cb8 100644 --- a/fs/nfs/filelayout/filelayout.h +++ b/fs/nfs/filelayout/filelayout.h @@ -33,13 +33,6 @@ #include "../pnfs.h" /* - * Default data server connection timeout and retrans vaules. - * Set by module paramters dataserver_timeo and dataserver_retrans. - */ -#define NFS4_DEF_DS_TIMEO 600 /* in tenths of a second */ -#define NFS4_DEF_DS_RETRANS 5 - -/* * Field testing shows we need to support up to 4096 stripe indices. * We store each index as a u8 (u32 on the wire) to keep the memory footprint * reasonable. This in turn means we support a maximum of 256 @@ -48,9 +41,6 @@ #define NFS4_PNFS_MAX_STRIPE_CNT 4096 #define NFS4_PNFS_MAX_MULTI_CNT 256 /* 256 fit into a u8 stripe_index */ -/* error codes for internal use */ -#define NFS4ERR_RESET_TO_MDS 12001 - enum stripetype4 { STRIPE_SPARSE = 1, STRIPE_DENSE = 2 diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h index cb666e8..588b2f1 100644 --- a/fs/nfs/pnfs.h +++ b/fs/nfs/pnfs.h @@ -77,6 +77,17 @@ enum pnfs_try_status { #define LAYOUT_NFSV4_1_MODULE_PREFIX "nfs-layouttype4" +/* + * Default data server connection timeout and retrans vaules. + * Set by module parameters dataserver_timeo and dataserver_retrans. + */ +#define NFS4_DEF_DS_TIMEO 600 /* in tenths of a second */ +#define NFS4_DEF_DS_RETRANS 5 + +/* error codes for internal use */ +#define NFS4ERR_RESET_TO_MDS 12001 +#define NFS4ERR_RESET_TO_PNFS 12002 + enum { NFS_LAYOUT_RO_FAILED = 0, /* get ro layout failed stop trying */ NFS_LAYOUT_RW_FAILED, /* get rw layout failed stop trying */