From patchwork Thu Sep 26 18:40:02 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benny Halevy X-Patchwork-Id: 2950101 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 7C2DABFF0B for ; Thu, 26 Sep 2013 18:40:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D0E9C202D1 for ; Thu, 26 Sep 2013 18:40:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1573120258 for ; Thu, 26 Sep 2013 18:40:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753295Ab3IZSkG (ORCPT ); Thu, 26 Sep 2013 14:40:06 -0400 Received: from mail-qa0-f52.google.com ([209.85.216.52]:64693 "EHLO mail-qa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752808Ab3IZSkF (ORCPT ); Thu, 26 Sep 2013 14:40:05 -0400 Received: by mail-qa0-f52.google.com with SMTP id k4so1091998qaq.4 for ; Thu, 26 Sep 2013 11:40:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=xv1vlU6lVI0Xp/E6Wz6hXulUfV3BT92XSnX8QZK22Ho=; b=P5M13jAkwSpQgMIhNCsss7edCBf1DnXVz7Axg1UeqKwnygJq0aLvtiS9lbCP5ck6ES 1pUVbTtgXUAXenpnTrVOsptmA6LgCpS280r9l45yNUdEqP5bAXXBclai49GylgodN372 N1RV7Rq6X7bIWHYqs4aLbdiOKPmj+lGW6sy0McmweKE8KzuvzneEUwp8cFKpba1r+Qmu Fo5HfzOhiKUfB9RiirQZfhV0Q228rMxfbRD0akedZKYbnYEJi1YqnDOTTKubWiSlw3dH Z4jPR2BMBEo8v6XE8MyKcafJkliZQ2PtoOMo1iGr5g6EE3UdKxogDFfkWx8CQS6KIcYr 7bQA== X-Received: by 10.224.3.5 with SMTP id 5mr8786138qal.10.1380220805136; Thu, 26 Sep 2013 11:40:05 -0700 (PDT) Received: from bhalevy-lt.il.tonian.com.com (nat-pool-bos-u.redhat.com. [66.187.233.207]) by mx.google.com with ESMTPSA id f14sm5106851qej.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 26 Sep 2013 11:40:04 -0700 (PDT) From: Benny Halevy To: " J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: [PATCH RFC v0 03/49] pnfsd: return pnfs flags on exchange_id Date: Thu, 26 Sep 2013 14:40:02 -0400 Message-Id: <1380220802-12810-1-git-send-email-bhalevy@primarydata.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <52447EA0.7070004@primarydata.com> References: <52447EA0.7070004@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=-9.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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: Benny Halevy Set the cl_exchange_flags to be non_pnfs if we do not set either pnfs or ds (in the plain old nfs41 case). Note that we always set both MDS and DS exchangeid capability flags when CONFIG_PNFSD is enabled. The client needs to remember what the session is used for if it cares to distiguish between DSs and MDSs. EXCHGID4_FLAG_USE_NON_PNFS should be set when the server does not support operations (e.g. LAYOUTGET) or attributes that pertain to pNFS. [extraced from pnfsd: Initial pNFS server implementation.] Signed-off-by: Benny Halevy [pnfsd: Fixup nfsd4_set_ex_flags.] Signed-off-by: Dean Hildebrand [pnfsd: set EXCHGID4_FLAG_USE_NON_PNFS when !CONFIG_PNFSD] [pnfsd: fix compiler warning in nfsd4_set_ex_flags when CONFIG_PNFSD is not defined] [pnfsd: always set both MDS and DS exchangeid capability flags] Signed-off-by: Benny Halevy Signed-off-by: Benny Halevy --- fs/nfsd/nfs4state.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 57a0340..21c15fc 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -1614,8 +1614,12 @@ static bool clp_used_exchangeid(struct nfs4_client *clp) static void nfsd4_set_ex_flags(struct nfs4_client *new, struct nfsd4_exchange_id *clid) { - /* pNFS is not supported */ +#if defined(CONFIG_PNFSD) + new->cl_exchange_flags |= EXCHGID4_FLAG_USE_PNFS_MDS | + EXCHGID4_FLAG_USE_PNFS_DS; +#else /* CONFIG_PNFSD */ new->cl_exchange_flags |= EXCHGID4_FLAG_USE_NON_PNFS; +#endif /* CONFIG_PNFSD */ /* Referrals are supported, Migration is not. */ new->cl_exchange_flags |= EXCHGID4_FLAG_SUPP_MOVED_REFER;