From patchwork Mon Nov 18 18:52:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Schumaker X-Patchwork-Id: 3198211 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 A2213C045C for ; Mon, 18 Nov 2013 18:53:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B6F2420522 for ; Mon, 18 Nov 2013 18:53:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B3A31200D5 for ; Mon, 18 Nov 2013 18:53:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753043Ab3KRSw7 (ORCPT ); Mon, 18 Nov 2013 13:52:59 -0500 Received: from mx2.netapp.com ([216.240.18.37]:20402 "EHLO mx2.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752138Ab3KRSw4 (ORCPT ); Mon, 18 Nov 2013 13:52:56 -0500 X-IronPort-AV: E=Sophos;i="4.93,725,1378882800"; d="scan'208";a="57339736" Received: from vmwexceht03-prd.hq.netapp.com ([10.106.76.241]) by mx2-out.netapp.com with ESMTP; 18 Nov 2013 10:52:56 -0800 Received: from smtp2.corp.netapp.com (10.57.159.114) by VMWEXCEHT03-PRD.hq.netapp.com (10.106.76.241) with Microsoft SMTP Server id 14.3.158.1; Mon, 18 Nov 2013 10:52:55 -0800 Received: from davros.com (davros.ocarinaproject.vpn.netapp.com [10.63.237.188]) by smtp2.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id rAIIqrpq025502; Mon, 18 Nov 2013 10:52:54 -0800 (PST) From: Anna Schumaker To: , Subject: [PATCH v2] NFS: Fix kbuild errors due to undefined symbols Date: Mon, 18 Nov 2013 13:52:51 -0500 Message-ID: <1384800771-21649-1-git-send-email-bjschuma@netapp.com> X-Mailer: git-send-email 1.8.4.2 MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 My recent patch 644aa303: "NFS: Enabling v4.2 should not recompile nfsd and lockd" caused build errors when CONFIG_NFS_V4=n, the basic NFS module needs NFS4_MAX_MINOR_VERSION, nfs4_label_alloc() and nfs4_label_free() defined to compile. Signed-off-by: Anna Schumaker --- fs/nfs/internal.h | 15 +++++++++++++++ fs/nfs/nfs4_fs.h | 34 +++++++++------------------------- 2 files changed, 24 insertions(+), 25 deletions(-) diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index bca6a3e..8b5cc04 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -269,6 +269,21 @@ extern const u32 nfs41_maxgetdevinfo_overhead; extern struct rpc_procinfo nfs4_procedures[]; #endif +#ifdef CONFIG_NFS_V4_SECURITY_LABEL +extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); +static inline void nfs4_label_free(struct nfs4_label *label) +{ + if (label) { + kfree(label->label); + kfree(label); + } + return; +} +#else +static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } +static inline void nfs4_label_free(void *label) {} +#endif /* CONFIG_NFS_V4_SECURITY_LABEL */ + /* proc.c */ void nfs_close_context(struct nfs_open_context *ctx, int is_sync); extern struct nfs_client *nfs_init_client(struct nfs_client *clp, diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index e916e86..7545ec2 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h @@ -9,21 +9,20 @@ #ifndef __LINUX_FS_NFS_NFS4_FS_H #define __LINUX_FS_NFS_NFS4_FS_H -#if IS_ENABLED(CONFIG_NFS_V4) - -#define NFS4_MAX_LOOP_ON_RECOVER (10) - -#include - #if defined(CONFIG_NFS_V4_2) #define NFS4_MAX_MINOR_VERSION 2 -#else -#if defined(CONFIG_NFS_V4_1) +#elif defined(CONFIG_NFS_V4_1) #define NFS4_MAX_MINOR_VERSION 1 #else #define NFS4_MAX_MINOR_VERSION 0 -#endif /* CONFIG_NFS_V4_1 */ -#endif /* CONFIG_NFS_V4_2 */ +#endif + +#if IS_ENABLED(CONFIG_NFS_V4) + +#define NFS4_MAX_LOOP_ON_RECOVER (10) + +#include +#include struct idmap; @@ -375,21 +374,6 @@ nfs4_state_protect_write(struct nfs_client *clp, struct rpc_clnt **clntp, } #endif /* CONFIG_NFS_V4_1 */ -#ifdef CONFIG_NFS_V4_SECURITY_LABEL -extern struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags); -static inline void nfs4_label_free(struct nfs4_label *label) -{ - if (label) { - kfree(label->label); - kfree(label); - } - return; -} -#else -static inline struct nfs4_label *nfs4_label_alloc(struct nfs_server *server, gfp_t flags) { return NULL; } -static inline void nfs4_label_free(void *label) {} -#endif /* CONFIG_NFS_V4_SECURITY_LABEL */ - extern const struct nfs4_minor_version_ops *nfs_v4_minor_ops[]; extern const u32 nfs4_fattr_bitmap[3];