From patchwork Thu Oct 11 15:11:34 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 1582331 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 5D7A3DFABE for ; Thu, 11 Oct 2012 15:11:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758733Ab2JKPLg (ORCPT ); Thu, 11 Oct 2012 11:11:36 -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 S1757691Ab2JKPLg (ORCPT ); Thu, 11 Oct 2012 11:11:36 -0400 Received: by mail-ie0-f174.google.com with SMTP id k13so3136165iea.19 for ; Thu, 11 Oct 2012 08:11:36 -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=M2HLve/PRPl8uLamJ++aeGz07p9ODohdSggNfFrgVE4=; b=W+McvIKwNCkdnsG81RzEDO6X64MxXxJr56kOeGrg2EKNzQ4/SUM0qYB8b92/AKq1LP uE3MV1P0yil/VLuheAy71nhhr4kkJ3wV9kMh6bbCgk1z2iO5FAoZD3DdT3vxBHMbIoDf gIkdCbn6D9265m4XXE2ZcbmHHVXX2j0KgWP/ziGLhkIkyx6S+DpoDVZwJpUrrMCp7PqT F7Ukt6sFrB8seqrxO6uirmG2yPLHDBrQOav6mLco/cpLlg51Fp3IVPT4KhEOF/+0eiOd 5nFe1avgvEhUtE9ZJPmTbwTlYgolcklA7MatVZcPRH+26016CTbTRbtaOR23io8mVSIZ oV7A== Received: by 10.50.213.35 with SMTP id np3mr1189560igc.22.1349968295968; Thu, 11 Oct 2012 08:11:35 -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 qn3sm4049618igc.7.2012.10.11.08.11.35 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 11 Oct 2012 08:11:35 -0700 (PDT) From: Chuck Lever Subject: [PATCH 6/8] mountd: Add exportent_release() To: steved@redhat.com Cc: bfields@redhat.com, linux-nfs@vger.kernel.org Date: Thu, 11 Oct 2012 11:11:34 -0400 Message-ID: <20121011151134.4665.44892.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 Split out the logic that releases dynamically allocated data in an exportent. The junction resolution code will invoke this to clean up the junction exportent once it has been dumped to the kernel. Signed-off-by: Chuck Lever --- support/export/export.c | 19 ++++++++++++------- support/include/exportfs.h | 1 + 2 files changed, 13 insertions(+), 7 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/support/export/export.c b/support/export/export.c index 4fda30a..17ceca9 100644 --- a/support/export/export.c +++ b/support/export/export.c @@ -31,16 +31,21 @@ static nfs_export * export_allowed_internal(const struct addrinfo *ai, const char *path); +void +exportent_release(struct exportent *eep) +{ + xfree(eep->e_squids); + xfree(eep->e_sqgids); + free(eep->e_mountpoint); + free(eep->e_fslocdata); + free(eep->e_uuid); + xfree(eep->e_hostname); +} + static void export_free(nfs_export *exp) { - xfree(exp->m_export.e_squids); - xfree(exp->m_export.e_sqgids); - free(exp->m_export.e_mountpoint); - free(exp->m_export.e_fslocdata); - free(exp->m_export.e_uuid); - - xfree(exp->m_export.e_hostname); + exportent_release(&exp->m_export); xfree(exp); } diff --git a/support/include/exportfs.h b/support/include/exportfs.h index 99916e5..5960feb 100644 --- a/support/include/exportfs.h +++ b/support/include/exportfs.h @@ -141,6 +141,7 @@ nfs_export * export_find(const struct addrinfo *ai, nfs_export * export_allowed(const struct addrinfo *ai, const char *path); nfs_export * export_create(struct exportent *, int canonical); +void exportent_release(struct exportent *); void export_freeall(void); int export_export(nfs_export *); int export_unexport(nfs_export *);