summaryrefslogtreecommitdiff
path: root/lib/sqfs/write_export_table.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-31 16:59:50 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-08-31 17:17:23 +0200
commit2ac43d981859bda063e7067371c1cf246c7f81b0 (patch)
treeca289d2b708a60d13e300cc36ae47839389d26cf /lib/sqfs/write_export_table.c
parent9b3d958fb7c37855a63ed75707281c61dc1d44c4 (diff)
Split libsquashfs.a into low seperate libraries
The idea is to make libsquashfs.a independend of libfstree.a, so it becomes a general purpose squashfs manipulation library. All the high level glue code for libfstree.a and utilites that are overly specific with to tools are moved to a seperate librarby. This commit makes the first step by moving the stuff with dependencies on libfstree to a seperate library. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/write_export_table.c')
-rw-r--r--lib/sqfs/write_export_table.c47
1 files changed, 0 insertions, 47 deletions
diff --git a/lib/sqfs/write_export_table.c b/lib/sqfs/write_export_table.c
deleted file mode 100644
index e42df15..0000000
--- a/lib/sqfs/write_export_table.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/* SPDX-License-Identifier: GPL-3.0-or-later */
-/*
- * write_export_table.c
- *
- * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
- */
-#include "config.h"
-
-#include "highlevel.h"
-#include "util.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-
-int write_export_table(int outfd, fstree_t *fs, sqfs_super_t *super,
- compressor_t *cmp)
-{
- uint64_t *table, start;
- size_t i, size;
- int ret;
-
- if (fs->inode_tbl_size < 1)
- return 0;
-
- table = alloc_array(sizeof(uint64_t), (fs->inode_tbl_size - 1));
-
- if (table == NULL) {
- perror("Allocating NFS export table");
- return -1;
- }
-
- for (i = 1; i < fs->inode_tbl_size; ++i) {
- if (fs->inode_table[i] == NULL) {
- table[i - 1] = htole64(0xFFFFFFFFFFFFFFFF);
- } else {
- table[i - 1] = htole64(fs->inode_table[i]->inode_ref);
- }
- }
-
- size = sizeof(uint64_t) * (fs->inode_tbl_size - 1);
- ret = sqfs_write_table(outfd, super, cmp, table, size, &start);
-
- super->export_table_start = start;
- super->flags |= SQFS_FLAG_EXPORTABLE;
- free(table);
- return ret;
-}