From patchwork Thu Oct 11 15:11:51 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1582351 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 145FADFABE for ; Thu, 11 Oct 2012 15:11:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758744Ab2JKPLy (ORCPT ); Thu, 11 Oct 2012 11:11:54 -0400 Received: from mail-ie0-f174.google.com ([209.85.223.174]:64939 "EHLO mail-ie0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757691Ab2JKPLx (ORCPT ); Thu, 11 Oct 2012 11:11:53 -0400 Received: by mail-ie0-f174.google.com with SMTP id k13so3136165iea.19 for ; Thu, 11 Oct 2012 08:11:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:subject:to:cc:date:message-id:in-reply-to:references :user-agent:mime-version:content-type:content-transfer-encoding; bh=0r94mdyvtyrJCTeIr+E73qkFGeDYGVTgIFrZegLQ2bQ=; b=uGzEg7vQRcB3yse/fCWlAVvcduorV/CilKKGE6zP6wKwryspxQmV4FpCE1zXW7fGai pDWuTKVDoqD5N2DCGSKSxFt2RhXEm5KhgJz9VzX65x1AI+ZVW5ILbnKTHF2vSmpinGyL RvxkX+3pXtlKKlB1LOzQFILobnYQBVVLO+Zsj/mm8lUHfZJVhmMGdIQFFIJmIGZjq9rF hL9x8652gf3FOw9C0ce0/s4t9xTsqrD71Z2c9PQN5jutW+crjhOZTeIpBGU51kTeJcLc JCzIsSIQWF0ykDiHQM/BjA3lK19W/QJfhOtyO78SG0BqWfLh9EFRjDoj8d4ZlTcpB0zV jpWg== Received: by 10.50.150.144 with SMTP id ui16mr1126696igb.68.1349968313276; Thu, 11 Oct 2012 08:11:53 -0700 (PDT) Received: from lebasque.1015granger.net (adsl-99-26-161-222.dsl.sfldmi.sbcglobal.net. [99.26.161.222]) by mx.google.com with ESMTPS id bp8sm4036386igb.12.2012.10.11.08.11.52 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Oct 2012 08:11:52 -0700 (PDT) From: Chuck Lever Subject: [PATCH 8/8] mountd: Simplify "no junction support" case To: steved@redhat.com Cc: bfields@redhat.com, linux-nfs@vger.kernel.org Date: Thu, 11 Oct 2012 11:11:51 -0400 Message-ID: <20121011151151.4665.80466.stgit@lebasque.1015granger.net> In-Reply-To: <20121011150421.4665.35964.stgit@lebasque.1015granger.net> References: <20121011150421.4665.35964.stgit@lebasque.1015granger.net> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org We've added logic in the "not an export" case in nfsd_fh(), so it's no longer a simple function call. Clean up this code by splitting it into a new function, and make plain what happens when junction support is compiled out. Signed-off-by: Chuck Lever --- utils/mountd/cache.c | 32 +++++++++++++++++++------------- 1 files changed, 19 insertions(+), 13 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/utils/mountd/cache.c b/utils/mountd/cache.c index 457fc9c..8280234 100644 --- a/utils/mountd/cache.c +++ b/utils/mountd/cache.c @@ -1109,11 +1109,24 @@ static struct exportent *lookup_junction(char *dom, const char *pathname, (void)dlclose(handle); return exp; } + +static void lookup_nonexport(FILE *f, char *dom, char *path, + struct addrinfo *ai) +{ + struct exportent *eep; + + eep = lookup_junction(dom, path, ai); + dump_to_cache(f, dom, path, eep); + if (eep == NULL) + return; + exportent_release(eep); + free(eep); +} #else /* !HAVE_NFS_PLUGIN_H */ -static inline struct exportent *lookup_junction(char *UNUSED(dom), - const char *UNUSED(pathname), struct addrinfo *UNUSED(ai)) +static void lookup_nonexport(FILE *f, char *dom, char *path, + struct addrinfo *UNUSED(ai)) { - return NULL; + dump_to_cache(f, dom, path, NULL); } #endif /* !HAVE_NFS_PLUGIN_H */ @@ -1164,16 +1177,9 @@ static void nfsd_export(FILE *f) " or fsid= required", path); dump_to_cache(f, dom, path, NULL); } - } else { - struct exportent *eep; - - eep = lookup_junction(dom, path, ai); - dump_to_cache(f, dom, path, eep); - if (eep != NULL) { - exportent_release(eep); - free(eep); - } - } + } else + lookup_nonexport(f, dom, path, ai); + out: xlog(D_CALL, "nfsd_export: found %p path %s", found, path ? path : NULL); if (dom) free(dom);