From patchwork Thu May 5 18:24:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9026531 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 EB1FCBF29F for ; Thu, 5 May 2016 18:25:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 19317203E3 for ; Thu, 5 May 2016 18:25:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2AE97203C3 for ; Thu, 5 May 2016 18:25:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754743AbcEESZD (ORCPT ); Thu, 5 May 2016 14:25:03 -0400 Received: from mail-qk0-f178.google.com ([209.85.220.178]:33969 "EHLO mail-qk0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754441AbcEESZB (ORCPT ); Thu, 5 May 2016 14:25:01 -0400 Received: by mail-qk0-f178.google.com with SMTP id r184so47767061qkc.1 for ; Thu, 05 May 2016 11:25:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poochiereds-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oI6mGJubAve6EwC4tJmcOn8jPLD2AGYGlK8245+jpic=; b=qUO5ZP/LvK3a6e5EgDEhgLQ1memqkPRswoMuRvwyXbQGmFikhi5w9DPFWskanAJn38 QDTFgPbvDGv1nS/chAaqG2xWd4vRBkLGSm4h+lQqFz0T0n6JqnFKbDZDiAV0c44VF22D b668TcRgqqnjqqyCpUGglo2hhe3wL64phFnanukOj1/iQ4e6i/9Ng/3Vui8J3fzDAr75 WOhCN68DUXoqMEwx1V2fZfBP5S74shBKf4HXO+KpuS9gQRLCWofKG13C/t1qXuQWSr2d ybQY1g4RpcackfISBPXujlTzehZfumFTgenFyNLIgWa2nueR+5oZ/oqg4/zWuDc1PG5D a/Sg== 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=oI6mGJubAve6EwC4tJmcOn8jPLD2AGYGlK8245+jpic=; b=O02Bts0O38sUIZPZO+d2gsJNFggiMIJESZxADuJnk1H8SRv6TZ9zBH7n3u23GQbDo4 DrQG7ogBxWj2iSEF0YxLUotJBAYRtd8iofWWJOzypz4MnjWH+dQQ528HNhtTJrHPCFT8 a6oXybIqoRS+YBEULcf7ncpeTF26Bk42y58Q8Fk//rKqdYJH6WNkv7jkokxdi+l2jerT cGJzHTKnK1Z4+IuUEo92cyi/g8Po6cmWdtQSGqxMt3aU33KbebuLPIpabRxAAolyoQWa Yc+a4GBiRDLMl2xUG0JuuA3mIAMgQC3Oq/dQbZaerha4VbDZKrEUFh/3Gr0xxib2+mb+ BObA== X-Gm-Message-State: AOPr4FVD8xGtmgwGfBj2+DbyfWA+Y8r54woKFFw15xLS2aUbS3A/4JtqhGEhYI4adDe5og== X-Received: by 10.55.26.27 with SMTP id a27mr16385640qka.95.1462472700524; Thu, 05 May 2016 11:25:00 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id x136sm4049807qkb.27.2016.05.05.11.24.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 05 May 2016 11:24:59 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: linux-nfs@vger.kernel.org Cc: hch@lst.de, Anna.Schumaker@netapp.com Subject: [RFC PATCH 6/6] nfs4: add kerneldoc header to nfs4_ff_layout_prepare_ds Date: Thu, 5 May 2016 14:24:48 -0400 Message-Id: <1462472688-5663-7-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1462472688-5663-1-git-send-email-jeff.layton@primarydata.com> References: <1462472688-5663-1-git-send-email-jeff.layton@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=-8.9 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 Signed-off-by: Jeff Layton --- fs/nfs/flexfilelayout/flexfilelayoutdev.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/fs/nfs/flexfilelayout/flexfilelayoutdev.c b/fs/nfs/flexfilelayout/flexfilelayoutdev.c index 5eff05e9eb4d..61094d59ee3a 100644 --- a/fs/nfs/flexfilelayout/flexfilelayoutdev.c +++ b/fs/nfs/flexfilelayout/flexfilelayoutdev.c @@ -342,7 +342,23 @@ out: return fh; } -/* Upon return, either ds is connected, or ds is NULL */ +/** + * nfs4_ff_layout_prepare_ds - prepare a DS connection for an RPC call + * @lseg: the layout segment we're operating on + * @ds_idx: index of the DS to use + * @fail_return: return layout on connect failure? + * + * Try to prepare a DS connection to accept an RPC call. This involves + * selecting a mirror to use and connecting the client to it if it's not + * already connected. + * + * Since we only need single functioning mirror to satisfy a read, we don't + * want to return the layout if there is one. For writes though, any down + * mirror should result in a LAYOUTRETURN. @fail_return is how we distinguish + * between the two cases. + * + * Returns a pointer to a connected DS object on success or NULL on failure. + */ struct nfs4_pnfs_ds * nfs4_ff_layout_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx, bool fail_return)