diff --git a/Makefile.am b/Makefile.am index d4558c59..5f0156ad 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ libsquashfuse_la_SOURCES = swap.c cache.c table.c dir.c file.c fs.c \ nonstd-pread.c nonstd-stat.c \ squashfs_fs.h common.h nonstd-internal.h nonstd.h swap.h cache.h table.h \ dir.h file.h decompress.h xattr.h squashfuse.h hash.h stack.h traverse.h \ - util.h + util.h fs.h libsquashfuse_la_CPPFLAGS = $(ZLIB_CPPFLAGS) $(XZ_CPPFLAGS) $(LZO_CPPFLAGS) \ $(LZ4_CPPFLAGS) libsquashfuse_la_LIBADD = $(ZLIB_LIBS) $(XZ_LIBS) $(LZO_LIBS) $(LZ4_LIBS) diff --git a/cache.c b/cache.c index 85f618e9..5264d5af 100644 --- a/cache.c +++ b/cache.c @@ -24,7 +24,7 @@ */ #include "cache.h" -#include "squashfuse.h" +#include "fs.h" #include diff --git a/common.h b/common.h index 43423783..aeac5c67 100644 --- a/common.h +++ b/common.h @@ -27,19 +27,19 @@ #include "config.h" +#include +#include +#include + #ifdef _WIN32 #include #else - #include typedef mode_t sqfs_mode_t; typedef uid_t sqfs_id_t; typedef off_t sqfs_off_t; typedef int sqfs_fd_t; #endif -#include -#include - typedef enum { SQFS_OK, SQFS_ERR, diff --git a/decompress.c b/decompress.c index eb0ec312..510d38bf 100644 --- a/decompress.c +++ b/decompress.c @@ -24,7 +24,7 @@ */ #include "decompress.h" -#include "squashfuse.h" +#include "squashfs_fs.h" #include diff --git a/dir.c b/dir.c index 9b85da20..5425916e 100644 --- a/dir.c +++ b/dir.c @@ -24,11 +24,12 @@ */ #include "dir.h" +#include "fs.h" +#include "swap.h" + #include #include -#include "squashfuse.h" - /* Read some directory metadata, updating the dir structure as necessary */ static sqfs_err sqfs_dir_md_read(sqfs *fs, sqfs_dir *dir, void *buf, size_t size); diff --git a/dir.h b/dir.h index 03c4023d..5ae0bfa6 100644 --- a/dir.h +++ b/dir.h @@ -27,8 +27,6 @@ #include "common.h" -#include - #include "squashfs_fs.h" typedef struct { diff --git a/file.c b/file.c index 19a6a4fd..6ba8199b 100644 --- a/file.c +++ b/file.c @@ -24,13 +24,13 @@ */ #include "file.h" -#include +#include "fs.h" +#include "swap.h" +#include "table.h" + +#include #include #include -#include -#include - -#include "squashfuse.h" sqfs_err sqfs_frag_entry(sqfs *fs, struct squashfs_fragment_entry *frag, uint32_t idx) { diff --git a/file.h b/file.h index a6161f31..d79be5dc 100644 --- a/file.h +++ b/file.h @@ -27,10 +27,9 @@ #include "common.h" -#include +#include "squashfs_fs.h" #include "cache.h" -#include "squashfs_fs.h" sqfs_err sqfs_frag_entry(sqfs *fs, struct squashfs_fragment_entry *frag, uint32_t idx); diff --git a/fs.c b/fs.c index 5ce373d3..930ae5f3 100644 --- a/fs.c +++ b/fs.c @@ -22,16 +22,18 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "squashfuse.h" +#include "fs.h" +#include "file.h" #include "nonstd.h" +#include "swap.h" +#include "xattr.h" -#include -#include #include #include #include + #define DATA_CACHED_BLKS 1 #define FRAG_CACHED_BLKS 3 diff --git a/fs.h b/fs.h new file mode 100644 index 00000000..3d7397ed --- /dev/null +++ b/fs.h @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2012 Dave Vasilevsky + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#ifndef SQFS_FS_H +#define SQFS_FS_H + +#include "common.h" + +#include "squashfs_fs.h" + +#include "cache.h" +#include "decompress.h" +#include "table.h" + +struct sqfs { + sqfs_fd_t fd; + struct squashfs_super_block sb; + sqfs_table id_table; + sqfs_table frag_table; + sqfs_table export_table; + sqfs_cache md_cache; + sqfs_cache data_cache; + sqfs_cache frag_cache; + sqfs_cache blockidx; + sqfs_decompressor decompressor; + + struct squashfs_xattr_id_table xattr_info; + sqfs_table xattr_table; +}; + +typedef uint32_t sqfs_xattr_idx; +struct sqfs_inode { + struct squashfs_base_inode base; + int nlink; + sqfs_xattr_idx xattr; + + sqfs_md_cursor next; + + union { + struct { + int major, minor; + } dev; + size_t symlink_size; + struct { + uint64_t start_block; + uint64_t file_size; + uint32_t frag_idx; + uint32_t frag_off; + } reg; + struct { + uint32_t start_block; + uint16_t offset; + uint32_t dir_size; + uint16_t idx_count; + uint32_t parent_inode; + } dir; + } xtra; +}; + +void sqfs_version_supported(int *min_major, int *min_minor, int *max_major, + int *max_minor); + +/* Number of groups of size 'group' required to hold size 'total' */ +size_t sqfs_divceil(uint64_t total, size_t group); + + +sqfs_err sqfs_init(sqfs *fs, sqfs_fd_t fd); +void sqfs_destroy(sqfs *fs); + +/* Ok to call these even on incompletely constructed filesystems */ +void sqfs_version(sqfs *fs, int *major, int *minor); +sqfs_compression_type sqfs_compression(sqfs *fs); + + +void sqfs_md_header(uint16_t hdr, bool *compressed, uint16_t *size); +void sqfs_data_header(uint32_t hdr, bool *compressed, uint32_t *size); + +sqfs_err sqfs_block_read(sqfs *fs, sqfs_off_t pos, bool compressed, uint32_t size, + size_t outsize, sqfs_block **block); +void sqfs_block_dispose(sqfs_block *block); + +sqfs_err sqfs_md_block_read(sqfs *fs, sqfs_off_t pos, size_t *data_size, + sqfs_block **block); +sqfs_err sqfs_data_block_read(sqfs *fs, sqfs_off_t pos, uint32_t hdr, + sqfs_block **block); + +/* Don't dispose after getting block, it's in the cache */ +sqfs_err sqfs_md_cache(sqfs *fs, sqfs_off_t *pos, sqfs_block **block); +sqfs_err sqfs_data_cache(sqfs *fs, sqfs_cache *cache, sqfs_off_t pos, + uint32_t hdr, sqfs_block **block); + +void sqfs_md_cursor_inode(sqfs_md_cursor *cur, sqfs_inode_id id, sqfs_off_t base); + +sqfs_err sqfs_md_read(sqfs *fs, sqfs_md_cursor *cur, void *buf, size_t size); + + +sqfs_err sqfs_inode_get(sqfs *fs, sqfs_inode *inode, sqfs_inode_id id); + +sqfs_mode_t sqfs_mode(int inode_type); +sqfs_err sqfs_id_get(sqfs *fs, uint16_t idx, sqfs_id_t *id); + +/* Puts up to *size characters of the link name into buf. Always null- + * terminates the buffer. Pass null as buf to have the size returned. */ +sqfs_err sqfs_readlink(sqfs *fs, sqfs_inode *inode, char *buf, size_t *size); + +/* Find inode_id by inode_num */ +int sqfs_export_ok(sqfs *fs); +sqfs_err sqfs_export_inode(sqfs *fs, sqfs_inode_num n, sqfs_inode_id *i); + +/* Find the root inode */ +sqfs_inode_id sqfs_inode_root(sqfs *fs); + +#endif diff --git a/fuseprivate.c b/fuseprivate.c index ca9b19bf..6c9f8a4e 100644 --- a/fuseprivate.c +++ b/fuseprivate.c @@ -22,18 +22,13 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" +#include "fuseprivate.h" #include -#include #include #include #include -#include - -#include -#include "fuseprivate.h" #include "nonstd.h" sqfs_err sqfs_stat(sqfs *fs, sqfs_inode *inode, struct stat *st) { diff --git a/fuseprivate.h b/fuseprivate.h index be8e972f..7e2304df 100644 --- a/fuseprivate.h +++ b/fuseprivate.h @@ -25,9 +25,12 @@ #ifndef SQFS_FUSEPRIVATE_H #define SQFS_FUSEPRIVATE_H -#include #include "squashfuse.h" +#include + +#include + /* Common functions for FUSE high- and low-level clients */ /* Fill in a stat structure. Does not set st_ino */ diff --git a/hash.c b/hash.c index 489ba612..bc0e0453 100644 --- a/hash.c +++ b/hash.c @@ -26,7 +26,6 @@ #include #include -#include static sqfs_err sqfs_hash_add_internal(sqfs_hash *h, int doubling, sqfs_hash_key k, sqfs_hash_value v) { diff --git a/hl.c b/hl.c index 1e760e75..33216ebd 100644 --- a/hl.c +++ b/hl.c @@ -22,23 +22,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" +#include "squashfuse.h" +#include "fuseprivate.h" + +#include "nonstd.h" #include -#include -#include #include #include #include -#include -#include -#include -#include -#include "fuseprivate.h" -#include "squashfuse.h" -#include "nonstd.h" -#include "util.h" typedef struct sqfs_hl sqfs_hl; struct sqfs_hl { diff --git a/ll.c b/ll.c index d6a46a5d..52ae6465 100644 --- a/ll.c +++ b/ll.c @@ -22,23 +22,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" +#include "ll.h" +#include "fuseprivate.h" + +#include "nonstd.h" #include -#include #include #include #include #include -#include -#include -#include - -#include "ll.h" -#include "squashfuse.h" -#include "nonstd.h" -#include "fuseprivate.h" -#include "util.h" static const double SQFS_TIMEOUT = DBL_MAX; diff --git a/ll.h b/ll.h index 1fb224d3..81ce9271 100644 --- a/ll.h +++ b/ll.h @@ -25,11 +25,10 @@ #ifndef SQFS_LL_H #define SQFS_LL_H -#include "config.h" -#include - #include "squashfuse.h" +#include + typedef struct sqfs_ll sqfs_ll; struct sqfs_ll { sqfs fs; diff --git a/ll_inode.c b/ll_inode.c index dbfbf523..c1bd433d 100644 --- a/ll_inode.c +++ b/ll_inode.c @@ -22,13 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" #include "ll.h" + #include "hash.h" #include "nonstd.h" #include -#include #include #include diff --git a/ls.c b/ls.c index a9a3e64c..a681f244 100644 --- a/ls.c +++ b/ls.c @@ -22,16 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "squashfuse.h" -#include #include #include -#include #include -#include "squashfuse.h" -#include "traverse.h" -#include "util.h" #define PROGNAME "squashfuse_ls" diff --git a/nonstd-daemon.c b/nonstd-daemon.c index 880aab0e..f078a7b1 100644 --- a/nonstd-daemon.c +++ b/nonstd-daemon.c @@ -28,7 +28,7 @@ #include "nonstd-internal.h" #include -#include "ll.h" +#include int sqfs_ll_daemonize(int fg) { #if HAVE_DECL_FUSE_DAEMONIZE diff --git a/nonstd-pread.c b/nonstd-pread.c index 0328b5e4..28185c72 100644 --- a/nonstd-pread.c +++ b/nonstd-pread.c @@ -24,32 +24,28 @@ */ #include "config.h" -#define SQFEATURE NONSTD_PREAD_DEF -#include "nonstd-internal.h" - #ifdef _WIN32 - -#include "win32.h" - -ssize_t sqfs_pread(HANDLE file, void *buf, size_t count, sqfs_off_t off) { - DWORD bread; - OVERLAPPED ov = { 0 }; - ov.Offset = (DWORD)off; - ov.OffsetHigh = (DWORD)(off >> 32); - - if (ReadFile(file, buf, count, &bread, &ov) == FALSE) - return -1; - return bread; -} - + #include "win32.h" + + ssize_t sqfs_pread(HANDLE file, void *buf, size_t count, sqfs_off_t off) { + DWORD bread; + OVERLAPPED ov = { 0 }; + ov.Offset = (DWORD)off; + ov.OffsetHigh = (DWORD)(off >> 32); + + if (ReadFile(file, buf, count, &bread, &ov) == FALSE) + return -1; + return bread; + } #else + #define SQFEATURE NONSTD_PREAD_DEF + #include "nonstd-internal.h" -#include - -#include "common.h" + #include -ssize_t sqfs_pread(sqfs_fd_t fd, void *buf, size_t count, sqfs_off_t off) { - return pread(fd, buf, count, off); -} + #include "common.h" + ssize_t sqfs_pread(sqfs_fd_t fd, void *buf, size_t count, sqfs_off_t off) { + return pread(fd, buf, count, off); + } #endif diff --git a/nonstd.h b/nonstd.h index 54d3c850..29fb7b94 100644 --- a/nonstd.h +++ b/nonstd.h @@ -25,6 +25,8 @@ #ifndef SQFS_STD_H #define SQFS_STD_H +#include "common.h" + /* Non-standard functions that we need */ dev_t sqfs_makedev(int maj, int min); diff --git a/squashfuse.h b/squashfuse.h index 8e3496fb..7d9747a7 100644 --- a/squashfuse.h +++ b/squashfuse.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012 Dave Vasilevsky + * Copyright (c) 2014 Dave Vasilevsky * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,118 +22,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef SQFS_SWAPFUSE_H -#define SQFS_SWAPFUSE_H +#ifndef SQFS_SQUASHFUSE_H +#define SQFS_SQUASHFUSE_H -#include "common.h" - -#include "cache.h" -#include "decompress.h" #include "dir.h" #include "file.h" -#include "squashfs_fs.h" -#include "swap.h" -#include "table.h" +#include "fs.h" +#include "traverse.h" +#include "util.h" #include "xattr.h" -#include - -struct sqfs { - sqfs_fd_t fd; - struct squashfs_super_block sb; - sqfs_table id_table; - sqfs_table frag_table; - sqfs_table export_table; - sqfs_cache md_cache; - sqfs_cache data_cache; - sqfs_cache frag_cache; - sqfs_cache blockidx; - sqfs_decompressor decompressor; - - struct squashfs_xattr_id_table xattr_info; - sqfs_table xattr_table; -}; - -typedef uint32_t sqfs_xattr_idx; -struct sqfs_inode { - struct squashfs_base_inode base; - int nlink; - sqfs_xattr_idx xattr; - - sqfs_md_cursor next; - - union { - struct { - int major, minor; - } dev; - size_t symlink_size; - struct { - uint64_t start_block; - uint64_t file_size; - uint32_t frag_idx; - uint32_t frag_off; - } reg; - struct { - uint32_t start_block; - uint16_t offset; - uint32_t dir_size; - uint16_t idx_count; - uint32_t parent_inode; - } dir; - } xtra; -}; - -void sqfs_version_supported(int *min_major, int *min_minor, int *max_major, - int *max_minor); - -/* Number of groups of size 'group' required to hold size 'total' */ -size_t sqfs_divceil(uint64_t total, size_t group); - - -sqfs_err sqfs_init(sqfs *fs, sqfs_fd_t fd); -void sqfs_destroy(sqfs *fs); - -/* Ok to call these even on incompletely constructed filesystems */ -void sqfs_version(sqfs *fs, int *major, int *minor); -sqfs_compression_type sqfs_compression(sqfs *fs); - - -void sqfs_md_header(uint16_t hdr, bool *compressed, uint16_t *size); -void sqfs_data_header(uint32_t hdr, bool *compressed, uint32_t *size); - -sqfs_err sqfs_block_read(sqfs *fs, sqfs_off_t pos, bool compressed, uint32_t size, - size_t outsize, sqfs_block **block); -void sqfs_block_dispose(sqfs_block *block); - -sqfs_err sqfs_md_block_read(sqfs *fs, sqfs_off_t pos, size_t *data_size, - sqfs_block **block); -sqfs_err sqfs_data_block_read(sqfs *fs, sqfs_off_t pos, uint32_t hdr, - sqfs_block **block); - -/* Don't dispose after getting block, it's in the cache */ -sqfs_err sqfs_md_cache(sqfs *fs, sqfs_off_t *pos, sqfs_block **block); -sqfs_err sqfs_data_cache(sqfs *fs, sqfs_cache *cache, sqfs_off_t pos, - uint32_t hdr, sqfs_block **block); - -void sqfs_md_cursor_inode(sqfs_md_cursor *cur, sqfs_inode_id id, sqfs_off_t base); - -sqfs_err sqfs_md_read(sqfs *fs, sqfs_md_cursor *cur, void *buf, size_t size); - - -sqfs_err sqfs_inode_get(sqfs *fs, sqfs_inode *inode, sqfs_inode_id id); - -sqfs_mode_t sqfs_mode(int inode_type); -sqfs_err sqfs_id_get(sqfs *fs, uint16_t idx, sqfs_id_t *id); - -/* Puts up to *size characters of the link name into buf. Always null- - * terminates the buffer. Pass null as buf to have the size returned. */ -sqfs_err sqfs_readlink(sqfs *fs, sqfs_inode *inode, char *buf, size_t *size); - -/* Find inode_id by inode_num */ -int sqfs_export_ok(sqfs *fs); -sqfs_err sqfs_export_inode(sqfs *fs, sqfs_inode_num n, sqfs_inode_id *i); - -/* Find the root inode */ -sqfs_inode_id sqfs_inode_root(sqfs *fs); - #endif diff --git a/stack.h b/stack.h index 45bf8330..0e040679 100644 --- a/stack.h +++ b/stack.h @@ -27,8 +27,6 @@ #include "common.h" -#include - typedef void (*sqfs_stack_free_t)(void *v); typedef struct { diff --git a/swap.h b/swap.h index cedb3a8e..f97f81ae 100644 --- a/swap.h +++ b/swap.h @@ -25,7 +25,7 @@ #ifndef SQFS_SWAP_H #define SQFS_SWAP_H -#include +#include "common.h" #define SQFS_MAGIC_SWAP 0x68737173 @@ -35,7 +35,6 @@ void sqfs_swapin16(uint16_t *v); void sqfs_swapin32(uint32_t *v); void sqfs_swapin64(uint64_t *v); -#include "common.h" #include "squashfs_fs.h" #include "swap.h.inc" diff --git a/table.c b/table.c index 15151d79..c035398f 100644 --- a/table.c +++ b/table.c @@ -24,8 +24,10 @@ */ #include "table.h" -#include "squashfuse.h" +#include "fs.h" #include "nonstd.h" +#include "squashfs_fs.h" +#include "swap.h" #include #include diff --git a/table.h b/table.h index d43bf63b..1f1e39be 100644 --- a/table.h +++ b/table.h @@ -27,8 +27,6 @@ #include "common.h" -#include - typedef struct { size_t each; uint64_t *blocks; diff --git a/traverse.c b/traverse.c index d0fce7ab..80067213 100644 --- a/traverse.c +++ b/traverse.c @@ -24,7 +24,7 @@ */ #include "traverse.h" -#include "squashfuse.h" +#include "fs.h" #include #include diff --git a/traverse.h b/traverse.h index 0cfb1945..0202a0af 100644 --- a/traverse.h +++ b/traverse.h @@ -26,8 +26,9 @@ #define SQFS_TRAVERSE_H #include "common.h" -#include "stack.h" + #include "dir.h" +#include "stack.h" typedef struct { bool dir_end; diff --git a/util.c b/util.c index e42fef38..0c2f192b 100644 --- a/util.c +++ b/util.c @@ -22,14 +22,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include "config.h" +#include "util.h" + +#include "fs.h" #include #include #include -#include "util.h" - /* TODO: WIN32 implementation of open/close */ /* TODO: i18n of error messages */ sqfs_err sqfs_open_image(sqfs *fs, const char *image) { diff --git a/util.h b/util.h index 5a4dc546..ae62dd14 100644 --- a/util.h +++ b/util.h @@ -25,7 +25,7 @@ #ifndef SQFS_UTIL_H #define SQFS_UTIL_H -#include "squashfuse.h" +#include "common.h" /* Open a filesystem and print errors to stderr. */ sqfs_err sqfs_open_image(sqfs *fs, const char *image); diff --git a/xattr.c b/xattr.c index 079a6d09..08c07e29 100644 --- a/xattr.c +++ b/xattr.c @@ -24,8 +24,9 @@ */ #include "xattr.h" -#include "squashfuse.h" +#include "fs.h" #include "nonstd.h" +#include "swap.h" #include #include diff --git a/xattr.h b/xattr.h index e15c0b7f..454a8424 100644 --- a/xattr.h +++ b/xattr.h @@ -29,8 +29,6 @@ #include "squashfs_fs.h" -#include - /* Initialize xattr handling for this fs */ sqfs_err sqfs_xattr_init(sqfs *fs);