Make it so that we can tear down the file descriptor hash table.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
extern int fssetdm_by_handle (void *__hanp, size_t __hlen,
struct fsdmidata *__fsdmi);
+void fshandle_destroy(void);
+
#ifdef __cplusplus
}
#endif
static struct fdhash *fdhash_head = NULL;
+void
+fshandle_destroy(void)
+{
+ struct fdhash *nexth;
+ struct fdhash *h = fdhash_head;
+
+ while (h) {
+ nexth = h->fnxt;
+ free(h);
+ h = nexth;
+ }
+}
+
int
path_to_fshandle(
char *path, /* input, path to convert */