From patchwork Thu Jun 27 19:54:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 2794801 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 1D3A8BF4A1 for ; Thu, 27 Jun 2013 19:54:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2E8AA2014D for ; Thu, 27 Jun 2013 19:54:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 56320201B0 for ; Thu, 27 Jun 2013 19:54:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753639Ab3F0Tyt (ORCPT ); Thu, 27 Jun 2013 15:54:49 -0400 Received: from mail-gh0-f178.google.com ([209.85.160.178]:44011 "EHLO mail-gh0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753139Ab3F0Tys (ORCPT ); Thu, 27 Jun 2013 15:54:48 -0400 Received: by mail-gh0-f178.google.com with SMTP id g15so470712ghb.37 for ; Thu, 27 Jun 2013 12:54:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=7/U3XDYtohOCCYSj8U3aCcTpc6GbjaJYER0OqVG3H/s=; b=J0LV3QWM2HWMfBxZXjP9XTZAFnVpVr6t2pVYiNI6ausRBVlixsmKSiCga2JpWzjsd9 gntLy7G/1e1Xx2FdbWHmYjBYdd2FlrNzWKiUYeyZzvmbsQYqti+fdBTRkp/mTHpTGfFN aWgR4O++XzTlLT9bDrKLkc+kxZK/ZmdbLczb3i4PXopW7y5DCTOPnLRMq9pVhyKCcHl5 jV/SreJuB1oiZxRXFzI+BiHBh3mtoSW7Y59vsV2IQtiPGhHAB+qd67ua/9qyNVWNmmqC VSqV7cuT9s83EBy41qgUwpXhP5hwh19zcIjICg24O7exDiaC0UIrMxAp1MTVToGlFV4H b9yw== X-Received: by 10.236.229.232 with SMTP id h98mr5524108yhq.177.1372362888061; Thu, 27 Jun 2013 12:54:48 -0700 (PDT) Received: from salusa.poochiereds.net (cpe-107-015-124-230.nc.res.rr.com. [107.15.124.230]) by mx.google.com with ESMTPSA id r23sm6393842yhb.11.2013.06.27.12.54.46 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 27 Jun 2013 12:54:47 -0700 (PDT) From: Jeff Layton To: trond.myklebust@netapp.com Cc: linux-nfs@vger.kernel.org, chuck.lever@oracle.com, Weston.Adamson@netapp.com Subject: [PATCH v4 1/4] nfs: refactor "need_mount" code out of nfs_try_mount Date: Thu, 27 Jun 2013 15:54:38 -0400 Message-Id: <1372362881-32282-2-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1372362881-32282-1-git-send-email-jlayton@redhat.com> References: <1372362881-32282-1-git-send-email-jlayton@redhat.com> X-Gm-Message-State: ALoCoQnCtaHE7t/yMdaxC7R3aHytyky3SU6MemCaS23i9P+f20kix6ceJ2jyookB0B4m07y3HcUn 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, RCVD_IN_DNSWL_HI, 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 This looks like pointless refactoring for now, but we'll flesh out the need_mount case a little more in a later patch. Cc: Chuck Lever Signed-off-by: Jeff Layton --- fs/nfs/super.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 2d7525f..afeee81 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1759,21 +1759,29 @@ static int nfs_request_mount(struct nfs_parsed_mount_data *args, return nfs_select_flavor(args, &request); } +static struct nfs_server *nfs_try_mount_request(struct nfs_mount_info *mount_info, + struct nfs_subversion *nfs_mod) +{ + int status; + + status = nfs_request_mount(mount_info->parsed, mount_info->mntfh); + if (status) + return ERR_PTR(status); + + return nfs_mod->rpc_ops->create_server(mount_info, nfs_mod); +} + struct dentry *nfs_try_mount(int flags, const char *dev_name, struct nfs_mount_info *mount_info, struct nfs_subversion *nfs_mod) { - int status; struct nfs_server *server; - if (mount_info->parsed->need_mount) { - status = nfs_request_mount(mount_info->parsed, mount_info->mntfh); - if (status) - return ERR_PTR(status); - } + if (mount_info->parsed->need_mount) + server = nfs_try_mount_request(mount_info, nfs_mod); + else + server = nfs_mod->rpc_ops->create_server(mount_info, nfs_mod); - /* Get a volume representation */ - server = nfs_mod->rpc_ops->create_server(mount_info, nfs_mod); if (IS_ERR(server)) return ERR_CAST(server);