summaryrefslogtreecommitdiff
path: root/lib/common/write_export_table.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-15 17:01:04 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-16 14:46:24 +0100
commit7f567bb6ee1954e2d8a886b1d3dcb8cb4a1ed486 (patch)
tree2415e990e0e6b63fd092d6c6f7fdaf63ccf014ad /lib/common/write_export_table.c
parent5e2298a3a3f00e6f55ceda2b1c35192d67c9feb4 (diff)
Use the sqfs_dir_writer_t to create the NFS export table
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/common/write_export_table.c')
-rw-r--r--lib/common/write_export_table.c43
1 files changed, 0 insertions, 43 deletions
diff --git a/lib/common/write_export_table.c b/lib/common/write_export_table.c
deleted file mode 100644
index c0d4993..0000000
--- a/lib/common/write_export_table.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/* SPDX-License-Identifier: GPL-3.0-or-later */
-/*
- * write_export_table.c
- *
- * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
- */
-#include "common.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-int write_export_table(const char *filename, sqfs_file_t *file,
- fstree_t *fs, sqfs_super_t *super,
- sqfs_compressor_t *cmp)
-{
- sqfs_u64 *table, start;
- size_t i, size;
- int ret;
-
- if (fs->inode_tbl_size < 1)
- return 0;
-
- table = calloc(1, sizeof(sqfs_u64) * fs->inode_tbl_size);
-
- if (table == NULL) {
- perror("Allocating NFS export table");
- return -1;
- }
-
- for (i = 0; i < fs->inode_tbl_size; ++i) {
- table[i] = htole64(fs->inode_table[i]->inode_ref);
- }
-
- size = sizeof(sqfs_u64) * fs->inode_tbl_size;
- ret = sqfs_write_table(file, cmp, table, size, &start);
- if (ret)
- sqfs_perror(filename, "writing NFS export table", ret);
-
- super->export_table_start = start;
- super->flags |= SQFS_FLAG_EXPORTABLE;
- free(table);
- return ret;
-}