OSDN Git Service

android-x86/external-exfat.git
8 months agoAndroid: add mount.exfat pie-x86 q-x86
Chih-Wei Huang [Tue, 9 Apr 2019 10:55:12 +0000 (18:55 +0800)]
Android: add mount.exfat

The vold can use this to mount an exfat partition.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
8 months agoRevert "Use fuse_main() instead of lower level functions."
Chih-Wei Huang [Tue, 9 Apr 2019 10:25:18 +0000 (18:25 +0800)]
Revert "Use fuse_main() instead of lower level functions."

This reverts commit f61d4279d14582d56b039f3ed7b49f5989600c86.

8 months agoRevert "Split mount options into FUSE- and exFAT-specific."
Chih-Wei Huang [Tue, 9 Apr 2019 10:25:12 +0000 (18:25 +0800)]
Revert "Split mount options into FUSE- and exFAT-specific."

This reverts commit 78d28968cbcb7dcb856e153774fdb4ccb38b0fcf.

8 months agoRevert "Wrap platform-specific FUSE options."
Chih-Wei Huang [Tue, 9 Apr 2019 10:23:16 +0000 (18:23 +0800)]
Revert "Wrap platform-specific FUSE options."

This reverts commit 68524e0a51246bba984fce28fc5b23aee0dbd2e0.

8 months agoAndroid: change libexfat to be a shared library
Chih-Wei Huang [Wed, 3 Apr 2019 11:27:15 +0000 (19:27 +0800)]
Android: change libexfat to be a shared library

The library is used by several binaries so it should be shared.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
9 months agoDefine proper feature test macros for glibc.
relan [Sat, 20 Apr 2019 18:31:37 +0000 (21:31 +0300)]
Define proper feature test macros for glibc.

9 months agoAdd support for timezone offsets.
Nathan Hunsperger [Thu, 18 Apr 2019 23:12:49 +0000 (16:12 -0700)]
Add support for timezone offsets.

Timestamps are stored in local time. exFAT includes timezone offset
fields to allow timestamps to remain correct when mounted under a
different timezone. The timezone offset is now used to calculate the
correct timestamp on read, and set on write.

13 months agoAndroid: remove "tags" from Android.bp.
LongPing.WEI [Wed, 28 Nov 2018 06:37:40 +0000 (14:37 +0800)]
Android: remove "tags" from Android.bp.

Android's build system does not support "tags" anymore, remove this line
to fix compilation.

16 months agoBump version to 1.3.0 and update changelog.
relan [Sat, 15 Sep 2018 05:03:24 +0000 (08:03 +0300)]
Bump version to 1.3.0 and update changelog.

16 months agoRepairing: implement unknown entry type fix.
relan [Thu, 23 Mar 2017 05:34:21 +0000 (08:34 +0300)]
Repairing: implement unknown entry type fix.

16 months agoRepairing: implement invalid node checksum fix.
relan [Tue, 14 Mar 2017 05:15:57 +0000 (08:15 +0300)]
Repairing: implement invalid node checksum fix.

16 months agoRepairing: add nodes flushing to fsck.
relan [Tue, 14 Mar 2017 05:08:33 +0000 (08:08 +0300)]
Repairing: add nodes flushing to fsck.

Nodes can now be modified during fsck run, so they should be flushed.

16 months agoRepairing: implement invalid VBR checksum fix.
relan [Sat, 11 Mar 2017 06:52:30 +0000 (09:52 +0300)]
Repairing: implement invalid VBR checksum fix.

16 months agoRepairing: pass struct exfat to verify_vbr_checksum().
relan [Sat, 11 Mar 2017 06:48:36 +0000 (09:48 +0300)]
Repairing: pass struct exfat to verify_vbr_checksum().

Repair hooks need struct exfat.

16 months agoRepairing: document new fsck options.
relan [Sat, 11 Mar 2017 06:46:16 +0000 (09:46 +0300)]
Repairing: document new fsck options.

16 months agoRepairing: add new fsck options.
relan [Sat, 11 Mar 2017 06:43:36 +0000 (09:43 +0300)]
Repairing: add new fsck options.

16 months agoRepairing: prepare fsck.
relan [Sat, 11 Mar 2017 06:40:51 +0000 (09:40 +0300)]
Repairing: prepare fsck.

16 months agoRepairing: add repair hooks file.
relan [Sat, 11 Mar 2017 06:33:46 +0000 (09:33 +0300)]
Repairing: add repair hooks file.

16 months agoRepairing: add "repair=n" option.
relan [Sat, 11 Mar 2017 06:20:01 +0000 (09:20 +0300)]
Repairing: add "repair=n" option.

Values:
  0 = do not repair
  1 = ask
  2 = repair automatically

16 months agoFix last updated dates in man pages.
relan [Sat, 15 Sep 2018 04:17:37 +0000 (07:17 +0300)]
Fix last updated dates in man pages.

16 months agoUpdate copyright years in man pages.
relan [Sat, 15 Sep 2018 04:14:01 +0000 (07:14 +0300)]
Update copyright years in man pages.

16 months agoPass stat to filler in readdir for dirent->d_type.
Mark Browning [Thu, 28 Jun 2018 15:30:59 +0000 (15:30 +0000)]
Pass stat to filler in readdir for dirent->d_type.

We have SD card reading code that iterates over the file system using
opendir() and readdir() recursively by checking the struct
dirent::d_type field, which is technically non-portable but works in
ext2, ext3, ext4, and vfat. However, it wasn't working with exfat.

Allows fuse to fill in the d_type field.

16 months agoAndroid: rename binaries to mkfs.exfat and fsck.exfat.
Pierre-Hugues Husson [Thu, 16 Aug 2018 14:56:29 +0000 (16:56 +0200)]
Android: rename binaries to mkfs.exfat and fsck.exfat.

Android Pie now supports exFAT, see

    https://android.googlesource.com/platform/system/vold/+/android-9.0.0_r3/fs/Exfat.cpp#33

21 months agoAndroid: convert Android.mk to Android.bp.
LongPingWEI [Thu, 28 Dec 2017 15:05:09 +0000 (23:05 +0800)]
Android: convert Android.mk to Android.bp.

21 months agoAndroid: fix logcat support building in AOSP.
Pablo Mendez Hernandez [Wed, 24 May 2017 11:23:39 +0000 (11:23 +0000)]
Android: fix logcat support building in AOSP.

Building failed this way:

log.c:51:51: error: use of undeclared identifier fmt
        __android_log_vprint(ANDROID_LOG_FATAL, PACKAGE, fmt, aq);
                                                         ^
log.c:79:51: error: use of undeclared identifier fmt
        __android_log_vprint(ANDROID_LOG_ERROR, PACKAGE, fmt, aq);
                                                         ^
log.c:105:50: error: use of undeclared identifier fmt
        __android_log_vprint(ANDROID_LOG_WARN, PACKAGE, fmt, aq);
                                                        ^

21 months agoAndroid: print log messages to logcat.
relan [Thu, 16 Mar 2017 08:01:54 +0000 (11:01 +0300)]
Android: print log messages to logcat.

Android does not have syslog.

21 months agoAndroid: support building exfat-utils.
liminghao [Fri, 3 Mar 2017 06:23:53 +0000 (14:23 +0800)]
Android: support building exfat-utils.

Build mkexfatfs, exfatfsck, dumpexfat and exfatlabel for Android.

Signed-off-by: liminghao <liminghao@xiaomi.com>
21 months agoFix predefined macro for DragonFlyBSD.
Tomohiro Kusumi [Sun, 1 Apr 2018 05:50:58 +0000 (14:50 +0900)]
Fix predefined macro for DragonFlyBSD.

__DragonFlyBSD__ is not defined in DragonFlyBSD. It's __DragonFly__
without "BSD".

21 months agoFix FreeBSD support, add UBLIO support.
Oleksii Samorukov [Sun, 18 Mar 2018 15:38:44 +0000 (16:38 +0100)]
Fix FreeBSD support, add UBLIO support.

21 months agoExclude OpenBSD from the list of supported operating systems.
relan [Sat, 31 Mar 2018 17:53:12 +0000 (20:53 +0300)]
Exclude OpenBSD from the list of supported operating systems.

OpenBSD's fuse_main() fails with "unknown option ..." when options string
is non-empty. We could live with this if it accepted at least "ro", but it
doesn't.

22 months agoPass "ro" option to FUSE when FS is read-only.
relan [Mon, 4 Dec 2017 06:46:58 +0000 (09:46 +0300)]
Pass "ro" option to FUSE when FS is read-only.

No matter the reason why FS is read-only (requested by user or device is
write-protected), we should inform FUSE about this.

22 months agoWrap platform-specific FUSE options.
relan [Thu, 4 May 2017 06:25:39 +0000 (09:25 +0300)]
Wrap platform-specific FUSE options.

fuse_main() fails on unrecognized options.

22 months agoSplit mount options into FUSE- and exFAT-specific.
relan [Wed, 3 May 2017 15:10:40 +0000 (18:10 +0300)]
Split mount options into FUSE- and exFAT-specific.

fuse_main() fails on unrecognized options.

22 months agoUse fuse_main() instead of lower level functions.
relan [Thu, 2 Apr 2015 09:11:53 +0000 (12:11 +0300)]
Use fuse_main() instead of lower level functions.

This significantly simplifies FUSE-related code.

22 months agoUnite code that forms options for FUSE.
relan [Thu, 2 Apr 2015 09:13:01 +0000 (12:13 +0300)]
Unite code that forms options for FUSE.

23 months agoBump version to 1.2.8 and update changelog.
relan [Sat, 3 Feb 2018 07:59:38 +0000 (10:59 +0300)]
Bump version to 1.2.8 and update changelog.

23 months agoUpdate copyright years.
relan [Sat, 3 Feb 2018 07:29:39 +0000 (10:29 +0300)]
Update copyright years.

2 years agoFix searching for free slots in the root directory.
m4rkusxxl [Fri, 19 Jan 2018 06:44:43 +0000 (09:44 +0300)]
Fix searching for free slots in the root directory.

When we need to place n entries and slot at position x is occupied, we
should check x+1 instead of jumping to x+n. Otherwise we may end up
putting new entries beyond a 0x00 entry, which Windows 10 interprets as
an end-of-directory mark and does not look farther.

2 years agoFix compilation on GNU/HURD.
relan [Sat, 16 Dec 2017 12:46:13 +0000 (15:46 +0300)]
Fix compilation on GNU/HURD.

2 years agoUpdate exfatlabel man page.
relan [Tue, 5 Sep 2017 14:39:15 +0000 (17:39 +0300)]
Update exfatlabel man page.

Add sentence about how to remove volume name.

2 years agoCorrect spelling mistake in a comment.
Edward Betts [Wed, 30 Aug 2017 10:13:31 +0000 (11:13 +0100)]
Correct spelling mistake in a comment.

2 years agoBump version to 1.2.7 and update changelog.
relan [Mon, 5 Jun 2017 07:05:16 +0000 (10:05 +0300)]
Bump version to 1.2.7 and update changelog.

2 years agoFix clusters bitmap size.
relan [Tue, 2 May 2017 17:19:57 +0000 (20:19 +0300)]
Fix clusters bitmap size.

The last two clusters were erroneously considered invalid. Note that
clusters numbering starts with 2.

2 years agoClean up unused parameters in libexfat.
relan [Sat, 1 Apr 2017 06:39:47 +0000 (09:39 +0300)]
Clean up unused parameters in libexfat.

2 years agoFix crash when started with stdin, stdout or stderr closed.
relan [Sat, 25 Mar 2017 06:24:09 +0000 (09:24 +0300)]
Fix crash when started with stdin, stdout or stderr closed.

2 years agoCheck clusters count validity.
relan [Tue, 21 Mar 2017 06:56:25 +0000 (09:56 +0300)]
Check clusters count validity.

Other checks heavily depend on clusters count value.

2 years agoCheck that file or directory size does not exceed clusters heap.
relan [Mon, 20 Mar 2017 06:04:57 +0000 (09:04 +0300)]
Check that file or directory size does not exceed clusters heap.

2 years agoRefactor error handling in exfat_mount().
relan [Sun, 19 Mar 2017 18:22:50 +0000 (21:22 +0300)]
Refactor error handling in exfat_mount().

Free struct exfat members in a separate function that can be called both
from exfat_unmount() and exfat_mount().

2 years agoRemove excessive check in free_cluster().
relan [Fri, 17 Mar 2017 06:41:47 +0000 (09:41 +0300)]
Remove excessive check in free_cluster().

Cluster validity has already been checked.

2 years agoImprove upper bound check in CLUSTER_INVALID() macro.
relan [Fri, 17 Mar 2017 05:31:43 +0000 (08:31 +0300)]
Improve upper bound check in CLUSTER_INVALID() macro.

Check that cluster value does not exceed actual number of clusters. Note
that clusters numbering starts with 2.

2 years agoPass struct exfat to check_node().
relan [Fri, 17 Mar 2017 05:17:45 +0000 (08:17 +0300)]
Pass struct exfat to check_node().

Future version of CLUSTER_INVALID() macro will need it.

2 years agoBump version to 1.2.6 and update changelog.
relan [Sat, 28 Jan 2017 18:57:08 +0000 (21:57 +0300)]
Bump version to 1.2.6 and update changelog.

2 years agoUpdate copyright years.
relan [Sat, 28 Jan 2017 18:30:31 +0000 (21:30 +0300)]
Update copyright years.

3 years agoAdd tail entries support.
relan [Tue, 10 Jan 2017 07:02:14 +0000 (10:02 +0300)]
Add tail entries support.

Tail entries are optional continuations that can appear after the name
entries. Their type is in 0xe0-0xff range. Sony uses them to save some
metadata along with video clips files.

Those entries can be safely ignored but must be included into checksum
calculations.

3 years agoGeneric I/O for directories: switch readdir().
relan [Thu, 29 Dec 2016 07:47:49 +0000 (10:47 +0300)]
Generic I/O for directories: switch readdir().

3 years agoGeneric I/O for directories: switch find_slot().
relan [Thu, 29 Dec 2016 07:24:04 +0000 (10:24 +0300)]
Generic I/O for directories: switch find_slot().

3 years agoGeneric I/O for directories: switch exfat_flush_node().
relan [Sat, 24 Dec 2016 08:38:31 +0000 (11:38 +0300)]
Generic I/O for directories: switch exfat_flush_node().

3 years agoGeneric I/O for directories: switch rename_entry().
relan [Sat, 24 Dec 2016 07:05:09 +0000 (10:05 +0300)]
Generic I/O for directories: switch rename_entry().

3 years agoGeneric I/O for directories: switch erase_entry().
relan [Fri, 23 Dec 2016 18:34:09 +0000 (21:34 +0300)]
Generic I/O for directories: switch erase_entry().

3 years agoGeneric I/O for directories: switch commit_entry().
relan [Fri, 23 Dec 2016 17:59:43 +0000 (20:59 +0300)]
Generic I/O for directories: switch commit_entry().

3 years agoGeneric I/O for directories: switch find_label().
relan [Thu, 22 Dec 2016 05:52:59 +0000 (08:52 +0300)]
Generic I/O for directories: switch find_label().

3 years agoGeneric I/O for directories: switch exfat_set_label().
relan [Thu, 22 Dec 2016 05:50:42 +0000 (08:50 +0300)]
Generic I/O for directories: switch exfat_set_label().

3 years agoGeneric I/O for directories: do not update times.
relan [Sat, 24 Dec 2016 08:10:10 +0000 (11:10 +0300)]
Generic I/O for directories: do not update times.

3 years agoGeneric I/O for directories: add [read|write]_entries().
relan [Thu, 22 Dec 2016 05:46:34 +0000 (08:46 +0300)]
Generic I/O for directories: add [read|write]_entries().

Begin conversion to exfat_generic_pread()/exfat_generic_pwrite()
functions for manipulations with directories contents. This simplifies
code a lot.

3 years agoRename node field flags to attrib.
relan [Tue, 27 Dec 2016 06:18:58 +0000 (09:18 +0300)]
Rename node field flags to attrib.

Now it contains only exFAT attributes (from meta2).

3 years agoReplace node flags with bit fields.
relan [Tue, 27 Dec 2016 05:53:38 +0000 (08:53 +0300)]
Replace node flags with bit fields.

Bit fields are safer and more readable.

3 years agoRename write_entry() to commit_entry().
relan [Fri, 23 Dec 2016 17:34:59 +0000 (20:34 +0300)]
Rename write_entry() to commit_entry().

This function doesn't just write an entry, it also constructs a new node
and adds it into the tree.

3 years agoUse ROUND_UP() macro instead of DIV_ROUND_UP().
relan [Sun, 15 Jan 2017 17:52:39 +0000 (20:52 +0300)]
Use ROUND_UP() macro instead of DIV_ROUND_UP().

3 years agoPropagate ENOSPC on write.
relan [Tue, 27 Dec 2016 14:22:12 +0000 (17:22 +0300)]
Propagate ENOSPC on write.

Return -errno from exfat_generic_pread()/exfat_generic_pwrite()
functions to distinguish between I/O error and out-of-space error.

3 years agoReduce the sizes of name buffers.
relan [Mon, 26 Dec 2016 06:41:57 +0000 (09:41 +0300)]
Reduce the sizes of name buffers.

EXFAT_NAME_MAX is the number of 16-bit code units, not Unicode
characters. When converting to UTF-8, 3 bytes are enough to keep any
Unicode character encoded by a 16-bit code unit.

3 years agoChange output buffer size semantics for UTF functions.
relan [Tue, 20 Dec 2016 08:26:52 +0000 (11:26 +0300)]
Change output buffer size semantics for UTF functions.

Make them consistent with other string functions: now output buffer size
includes potential null terminator, i.e. this is total size. This change
also means that if output buffer isn't large enough it can be left
unterminated (indicated by the -ENAMETOOLONG return value).

3 years agoRemove buffer size argument for exfat_get_name().
relan [Tue, 20 Dec 2016 08:22:32 +0000 (11:22 +0300)]
Remove buffer size argument for exfat_get_name().

The output buffer is always UTF8_BYTES(EXFAT_NAME_MAX)+1 characters. No
need to repeat this every time.

3 years agoAvoid name length calculation in exfat_calc_name_hash().
relan [Fri, 16 Dec 2016 05:52:32 +0000 (08:52 +0300)]
Avoid name length calculation in exfat_calc_name_hash().

We always know it when exfat_calc_name_hash() is called, so pass file
name length as an argument.

3 years agoRefactor file entry checksum calculation.
relan [Thu, 15 Dec 2016 05:19:52 +0000 (08:19 +0300)]
Refactor file entry checksum calculation.

Move actual algorithm implementation into add_checksum_byte() function.
Avoid utf16_length() call: we already have valid file name length.
Avoid extra data copying: take it from the name buffer instead of making
a temporary file name entry.

3 years agoFix max file name length.
relan [Thu, 15 Dec 2016 05:14:30 +0000 (08:14 +0300)]
Fix max file name length.

In exFAT file name limit is 255 16-bit code units, not 256. That's
because name length field size is 1 byte.

3 years agoBump version to 1.2.5 and update changelog.
relan [Mon, 5 Dec 2016 10:53:19 +0000 (13:53 +0300)]
Bump version to 1.2.5 and update changelog.

3 years agoMove meta2 fields checking into check_node().
relan [Tue, 19 Jul 2016 15:47:28 +0000 (18:47 +0300)]
Move meta2 fields checking into check_node().

There we know node name and print it if an error is detected.

3 years agoAdd node start cluster checks.
relan [Tue, 19 Jul 2016 15:29:25 +0000 (18:29 +0300)]
Add node start cluster checks.

3 years agoRun all checks in check_node().
relan [Tue, 19 Jul 2016 10:34:46 +0000 (13:34 +0300)]
Run all checks in check_node().

Do not stop node validation on the first error.

3 years agoImprove error messages in opendir().
relan [Sat, 12 Nov 2016 07:22:51 +0000 (10:22 +0300)]
Improve error messages in opendir().

3 years agodumpexfat: print version number only when requested.
Daniel Drake [Wed, 20 Jul 2016 18:13:56 +0000 (12:13 -0600)]
dumpexfat: print version number only when requested.

If the version number is printed only when the -V arg is given,
it's easier to use the output of this tool in external scripts.

3 years agodumpexfat: add option to show file fragments.
Daniel Drake [Wed, 20 Jul 2016 18:06:17 +0000 (12:06 -0600)]
dumpexfat: add option to show file fragments.

Add an option to show a list of fragments that a given file is composed
of. This is useful for if you want to have low-level access to a file
without going through the file system layers.

3 years agoRemove unused field of struct iterator.
relan [Mon, 5 Dec 2016 10:30:47 +0000 (13:30 +0300)]
Remove unused field of struct iterator.

3 years agoFix memory leak on error path when directory read fails.
relan [Sat, 12 Nov 2016 06:48:06 +0000 (09:48 +0300)]
Fix memory leak on error path when directory read fails.

3 years agoRespect daylight saving time.
relan [Mon, 4 Jul 2016 08:57:02 +0000 (11:57 +0300)]
Respect daylight saving time.

3 years agoUse DIV_ROUND_UP macro.
relan [Sat, 6 Aug 2016 12:24:59 +0000 (15:24 +0300)]
Use DIV_ROUND_UP macro.

3 years agoBump version to 1.2.4 and update changelog.
relan [Fri, 3 Jun 2016 05:28:46 +0000 (08:28 +0300)]
Bump version to 1.2.4 and update changelog.

3 years agoUpdate copyright years.
relan [Fri, 3 Jun 2016 05:20:53 +0000 (08:20 +0300)]
Update copyright years.

3 years agoSupport upcase table compression.
relan [Fri, 25 Mar 2016 10:06:25 +0000 (13:06 +0300)]
Support upcase table compression.

Upcase table can use RLE for identity-mapped characters.

3 years agoRemove ublio support.
relan [Tue, 29 Dec 2015 11:16:05 +0000 (14:16 +0300)]
Remove ublio support.

It was required for FreeBSD. Nowadays nobody is interested in FreeBSD
support. Also, ublio has not been updated since 2007 and looks dead.

3 years agoInstall man pages by default.
relan [Fri, 3 Jun 2016 04:34:01 +0000 (07:34 +0300)]
Install man pages by default.

Users will probably be happier with documentation than without.

3 years agoAdd platform-specific instructions to README.md.
relan [Wed, 27 Jan 2016 10:15:24 +0000 (13:15 +0300)]
Add platform-specific instructions to README.md.

4 years agoEscape commas (and backslashes) in device names.
relan [Tue, 5 Jan 2016 14:10:54 +0000 (17:10 +0300)]
Escape commas (and backslashes) in device names.

Otherwise device names containing commas will be truncated.

4 years agoBump version to 1.2.3 and update changelog.
relan [Sat, 19 Dec 2015 09:12:50 +0000 (12:12 +0300)]
Bump version to 1.2.3 and update changelog.

4 years agoFix clusters loss when file renaming replaces target.
relan [Sat, 19 Dec 2015 08:16:21 +0000 (11:16 +0300)]
Fix clusters loss when file renaming replaces target.

Add missing exfat_cleanup_node() call after exfat_unlink().

4 years agoBump version to 1.2.2 and update changelog.
relan [Mon, 9 Nov 2015 06:14:15 +0000 (09:14 +0300)]
Bump version to 1.2.2 and update changelog.

4 years agoAdd case-insensitivity note to the mount.exfat-fuse man page.
relan [Mon, 9 Nov 2015 05:55:27 +0000 (08:55 +0300)]
Add case-insensitivity note to the mount.exfat-fuse man page.

4 years agoAdd uninstall command to the README.md.
relan [Sat, 7 Nov 2015 08:36:44 +0000 (11:36 +0300)]
Add uninstall command to the README.md.

4 years agoFlush clusters bitmap on each file close.
relan [Sat, 7 Nov 2015 08:10:29 +0000 (11:10 +0300)]
Flush clusters bitmap on each file close.

Put FS into a clean state when all files are closed. Flush to the
non-volatile storage is not enforced though, so there can (and most
probably will) be some dirty data in various OS- and hardware-controlled
caches.

4 years agoMove nodes flush from exfat_flush() into a separate function.
relan [Sat, 7 Nov 2015 08:06:34 +0000 (11:06 +0300)]
Move nodes flush from exfat_flush() into a separate function.

Make exfat_flush() execution time more predictable.