]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
mountd: Add exportent_release()
authorChuck Lever <chuck.lever@oracle.com>
Fri, 19 Oct 2012 14:38:51 +0000 (10:38 -0400)
committerSteve Dickson <steved@redhat.com>
Mon, 22 Oct 2012 13:44:02 +0000 (09:44 -0400)
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 <chuck.lever@oracle.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
support/export/export.c
support/include/exportfs.h

index 0257903b45b233d4f44ad8df461655291516b132..6b1d0459b78806f959348d8cf0665f3f06311f0b 100644 (file)
@@ -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);
 }
 
index 99916e515af13691cbada636b10664673b7600dd..5960febf2c997fbd5b6f4c9e50928b6e096d4365 100644 (file)
@@ -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 *);