From d511f4c87b92d15344e6c4fe8f8c418c7996902a Mon Sep 17 00:00:00 2001 From: Sven Hoexter Date: Sun, 6 Dec 2015 14:38:13 +0100 Subject: [PATCH] Imported Upstream version 1.2.2 --- ChangeLog | 7 +++++++ README | 4 ++++ configure | 20 ++++++++++---------- configure.ac | 2 +- libexfat/cluster.c | 9 ++++++--- libexfat/exfat.h | 1 + libexfat/mount.c | 3 ++- libexfat/node.c | 2 +- libexfat/platform.h | 2 +- 9 files changed, 33 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2ff856c..d6f99d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +1.2.2 (2015-11-09) + +* Improved reliability in case of a sudden unplug: FS will be in a clean state +after closing all files and performing sync(1). +* Fixed compilation on Debian GNU/kFreeBSD and GNU/Hurd platforms. +* Updated mount.exfat-fuse man page. + 1.2.1 (2015-09-24) * Fixed compatibility with Zalman VE-200: now newly created directories do not diff --git a/README b/README index 1e3dff5..8f2fe85 100644 --- a/README +++ b/README @@ -31,6 +31,10 @@ Then install driver and utilities: sudo make install +You can remove them using this command: + + sudo make uninstall + Mounting -------- diff --git a/configure b/configure index 6be5c73..3f05b77 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for Free exFAT implementation 1.2.1. +# Generated by GNU Autoconf 2.69 for Free exFAT implementation 1.2.2. # # Report bugs to . # @@ -579,8 +579,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='Free exFAT implementation' PACKAGE_TARNAME='exfat-utils' -PACKAGE_VERSION='1.2.1' -PACKAGE_STRING='Free exFAT implementation 1.2.1' +PACKAGE_VERSION='1.2.2' +PACKAGE_STRING='Free exFAT implementation 1.2.2' PACKAGE_BUGREPORT='relan@users.noreply.github.com' PACKAGE_URL='https://github.com/relan/exfat' @@ -1228,7 +1228,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures Free exFAT implementation 1.2.1 to adapt to many kinds of systems. +\`configure' configures Free exFAT implementation 1.2.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1294,7 +1294,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of Free exFAT implementation 1.2.1:";; + short | recursive ) echo "Configuration of Free exFAT implementation 1.2.2:";; esac cat <<\_ACEOF @@ -1386,7 +1386,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -Free exFAT implementation configure 1.2.1 +Free exFAT implementation configure 1.2.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1441,7 +1441,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by Free exFAT implementation $as_me 1.2.1, which was +It was created by Free exFAT implementation $as_me 1.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2304,7 +2304,7 @@ fi # Define the identity of the package. PACKAGE='exfat-utils' - VERSION='1.2.1' + VERSION='1.2.2' cat >>confdefs.h <<_ACEOF @@ -4611,7 +4611,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by Free exFAT implementation $as_me 1.2.1, which was +This file was extended by Free exFAT implementation $as_me 1.2.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4678,7 +4678,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -Free exFAT implementation config.status 1.2.1 +Free exFAT implementation config.status 1.2.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index ac9e71f..c6fc314 100644 --- a/configure.ac +++ b/configure.ac @@ -21,7 +21,7 @@ # AC_INIT([Free exFAT implementation], - [1.2.1], + [1.2.2], [relan@users.noreply.github.com], [exfat-utils], [https://github.com/relan/exfat]) diff --git a/libexfat/cluster.c b/libexfat/cluster.c index 523e9fb..fc3657b 100644 --- a/libexfat/cluster.c +++ b/libexfat/cluster.c @@ -149,10 +149,13 @@ static int flush_nodes(struct exfat* ef, struct exfat_node* node) return exfat_flush_node(ef, node); } -int exfat_flush(struct exfat* ef) +int exfat_flush_nodes(struct exfat* ef) { - int rc = flush_nodes(ef, ef->root); + return flush_nodes(ef, ef->root); +} +int exfat_flush(struct exfat* ef) +{ if (ef->cmap.dirty) { if (exfat_pwrite(ef->dev, ef->cmap.chunk, @@ -165,7 +168,7 @@ int exfat_flush(struct exfat* ef) ef->cmap.dirty = false; } - return rc; + return 0; } static bool set_next_cluster(const struct exfat* ef, bool contiguous, diff --git a/libexfat/exfat.h b/libexfat/exfat.h index 122ac5b..97d3692 100644 --- a/libexfat/exfat.h +++ b/libexfat/exfat.h @@ -169,6 +169,7 @@ cluster_t exfat_next_cluster(const struct exfat* ef, const struct exfat_node* node, cluster_t cluster); cluster_t exfat_advance_cluster(const struct exfat* ef, struct exfat_node* node, uint32_t count); +int exfat_flush_nodes(struct exfat* ef); int exfat_flush(struct exfat* ef); int exfat_truncate(struct exfat* ef, struct exfat_node* node, uint64_t size, bool erase); diff --git a/libexfat/mount.c b/libexfat/mount.c index f1fb01a..0d6ce9e 100644 --- a/libexfat/mount.c +++ b/libexfat/mount.c @@ -359,7 +359,8 @@ static void finalize_super_block(struct exfat* ef) void exfat_unmount(struct exfat* ef) { - exfat_flush(ef); /* ignore return code */ + exfat_flush_nodes(ef); /* ignore return code */ + exfat_flush(ef); /* ignore return code */ exfat_put_node(ef, ef->root); exfat_reset_cache(ef); free(ef->root); diff --git a/libexfat/node.c b/libexfat/node.c index f3d10e0..d05f20d 100644 --- a/libexfat/node.c +++ b/libexfat/node.c @@ -664,7 +664,7 @@ int exfat_flush_node(struct exfat* ef, struct exfat_node* node) } node->flags &= ~EXFAT_ATTRIB_DIRTY; - return 0; + return exfat_flush(ef); } static bool erase_entry(struct exfat* ef, struct exfat_node* node) diff --git a/libexfat/platform.h b/libexfat/platform.h index eaa92f8..99fe507 100644 --- a/libexfat/platform.h +++ b/libexfat/platform.h @@ -24,7 +24,7 @@ #ifndef PLATFORM_H_INCLUDED #define PLATFORM_H_INCLUDED -#if defined(__linux__) +#if defined(__linux__) || defined(__GLIBC__) || defined(__GNU__) #include #include -- 2.39.5