From patchwork Tue May 17 16:28:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9114281 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C9D6D9FB14 for ; Tue, 17 May 2016 16:29:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC33C20303 for ; Tue, 17 May 2016 16:29:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1CCAD202EC for ; Tue, 17 May 2016 16:29:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756196AbcEQQ3G (ORCPT ); Tue, 17 May 2016 12:29:06 -0400 Received: from mail-qk0-f193.google.com ([209.85.220.193]:33207 "EHLO mail-qk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756154AbcEQQ3E (ORCPT ); Tue, 17 May 2016 12:29:04 -0400 Received: by mail-qk0-f193.google.com with SMTP id q184so1931446qkf.0 for ; Tue, 17 May 2016 09:29:04 -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=+v3zM8e+uqpij3NK7AjQOHLsjvEUUkcMZ/WhVpkL7bw=; b=mbVSk0aQII/QjAnN6mb/4rnFC51FDTxSxwGmbs8APJ4QH4O1q6+/7+ZcUTmjnSqLZW wQsf/oCrvX74Qdnc/kELIUBHVQPDwwD7hN7NZwg6LfO4vd9S0QehJW7qRYCCYFZbIHBj ZUMSwd5gqK4V6zQQcY2OHEwoY8H1SPXX3IDVc/mX1Swuloz8ZYaX0v2NRldtI90PlELG k03nQJ22Ha4SuzHYc2aj6WPB/jBjYfkftO7l+J7wLbNzy/5/f0HCh1ciAGpue+ekCZNx p/7hcVzKNSJ6FXfoOiL922ZXQwcu3bZEyHbcQ5zmLEvoYtbubLEOKBvqXUAQgdJ0oK/F BffQ== 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=+v3zM8e+uqpij3NK7AjQOHLsjvEUUkcMZ/WhVpkL7bw=; b=RhAYOZ4yTU5AM32Li6izLsYXkWhzH0Wb+OOHr06cRdouGIaMFfq/FA5xWPYYZUfN+b JPUS3Y+ZmsiHg3GuDkYOb6o4XhxOPJcfPg962yPInB9KVRYSk/UoCLp1KYFVcA3wg0ZB n/lqIljf12kmpam3oPCBaBKbAOl94hrrIN5ArAw+eA0bT2ZyCUuolkbagyp3nf5GIjVj ytGNSO4eC08xKaxupmdbKQIFL9AaV39zsLAqoEMBp1vzNrFajlNYoPxEoa5tT6N5+9gD FPhDenWMTJ/yWSTx7UMPMphvpqaQ2SQPxOQDUHhxCU/Hu6Pzd24y5+G2y7J0wjYLrnt8 8Rpg== X-Gm-Message-State: AOPr4FWOnd+qdQcaGmAm9wV1SZRsyLPDhwUzHTobNXWBywzixdgaZxwcXfCYljuDaEOg1Q== X-Received: by 10.55.106.3 with SMTP id f3mr2721326qkc.177.1463502544132; Tue, 17 May 2016 09:29:04 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id a31sm1685827qga.34.2016.05.17.09.29.03 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 17 May 2016 09:29:03 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: Trond Myklebust , Anna Schumaker Cc: Thomas Haynes , linux-nfs@vger.kernel.org, hch@lst.de Subject: [PATCH v4 09/13] flexfiles: add kerneldoc header to nfs4_ff_layout_prepare_ds Date: Tue, 17 May 2016 12:28:44 -0400 Message-Id: <1463502528-11519-10-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1463502528-11519-1-git-send-email-jeff.layton@primarydata.com> References: <1463502528-11519-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.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 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 5532cb14e800..b70133de9505 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 a 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)