From patchwork Sun May 15 01:06:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 9095801 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 BB4A49F441 for ; Sun, 15 May 2016 01:07:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E583B20268 for ; Sun, 15 May 2016 01:07:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0984F20263 for ; Sun, 15 May 2016 01:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754014AbcEOBHF (ORCPT ); Sat, 14 May 2016 21:07:05 -0400 Received: from mail-qk0-f195.google.com ([209.85.220.195]:36682 "EHLO mail-qk0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754010AbcEOBHB (ORCPT ); Sat, 14 May 2016 21:07:01 -0400 Received: by mail-qk0-f195.google.com with SMTP id l68so11320560qkf.3 for ; Sat, 14 May 2016 18:07: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=FUqUK0x/OpBAp5gIsuBfwOLFlaQJ81Khy/b9S73uWGk=; b=feWLNg2WZdaIDcqSdLmYjjADTAXbxviyOOU10tuekLc4tT5Dw3q5S1MhCsJKiuzHEn XCx6XtiqnHTSsnVv8tcWR5yiPOkM36F56FwnqQIarwsmgmx+6U2HUswpIK3pjn7fn4UO 6lL+vGApSzWT4mXQ3/0sI4JLtgC2hFy/UCk8+pDogvy53cKzRcbA0RmZJlSFQ00sePXt Ft0p1u4GjTg+1Uwpi2Bd22Xpja5CVcafrnE7zS2RLolIdsaHdijpTBhEgcTZLNGc82WC jnfVXFIzL2SeHWkOlPbBARma8/m2gOmlVaKvc9MlHL6g3rmt3txO4gshwdkPRAzb+yo+ XXbA== 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=FUqUK0x/OpBAp5gIsuBfwOLFlaQJ81Khy/b9S73uWGk=; b=eH396PwHMbtoFlunUmMidn3w6G5wCoDUNXymDFv7xiOFtO6YlB8SH9vUWkiR1bmSHL XX8bT1aOeX8h4AMuby+fa9aZ/dhox5WrqoMJ8AO+hBG5/qWx7eUa99L699g5Q/7NikSU MNi36PJDQIAwB1zNDQ+Xp8BMpvu08oWcMORAb7vTlxuME4rtoWAncVYhNBfR2/c332fe y0OwSM4mXdfT+wqO7tv8hg4DyTzlQ1+ZVlhnjKOtgkzwAMLjW3SpH/9+DraxrGosiHOh YbxmjB6CIGfnUecBJRlNtarYpfOR1r9HzdeiWotQZ8HhA7RUBCSybUvSOdgUJQEXD/eN 5Yaw== X-Gm-Message-State: AOPr4FXk4xEskNkyYcvML+2CvcxkyPOr9awWm4Uu3edByZfT3PaQ3JCFY+Azv3iAEvonhg== X-Received: by 10.55.46.197 with SMTP id u188mr24196371qkh.210.1463274420922; Sat, 14 May 2016 18:07:00 -0700 (PDT) Received: from tlielax.poochiereds.net ([2606:a000:1125:4074:3a60:77ff:fe93:a95d]) by smtp.googlemail.com with ESMTPSA id d12sm11520330qhd.13.2016.05.14.18.07.00 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 May 2016 18:07:00 -0700 (PDT) From: Jeff Layton X-Google-Original-From: Jeff Layton To: Trond Myklebust , Anna Schumaker Cc: linux-nfs@vger.kernel.org, hch@infradead.org Subject: [PATCH v3 09/13] flexfiles: add kerneldoc header to nfs4_ff_layout_prepare_ds Date: Sat, 14 May 2016 21:06:38 -0400 Message-Id: <1463274402-17746-10-git-send-email-jeff.layton@primarydata.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1463274402-17746-1-git-send-email-jeff.layton@primarydata.com> References: <1463274402-17746-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..6efd060e731f 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)