OSDN Git Service

android-x86/external-exfat.git
2 years agoDon't define modules for recovery oreo-x86 android-x86-8.1-r1 android-x86-8.1-r2 android-x86-8.1-r3
Chih-Wei Huang [Sun, 10 Dec 2017 16:12:53 +0000 (00:12 +0800)]
Don't define modules for recovery

These modules are not used by us. The rules are even broken since
some required modules are not defined in our source tree.
Before Android 8.1 these rules are just skipped. However, they are
not valid since Android 8.1.

2 years agoMerge branch 'master' of git://github.com/relan/exfat into nougat-x86 nougat-x86 android-x86-7.1-r1 android-x86-7.1-r2 android-x86-7.1-r3
Chih-Wei Huang [Thu, 7 Dec 2017 06:34:33 +0000 (14:34 +0800)]
Merge branch 'master' of git://github.com/relan/exfat into nougat-x86

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 agoMerge branch 'master' of git://github.com/relan/exfat into marshmallow-x86 marshmallow-x86 android-x86-6.0-r3
Chih-Wei Huang [Thu, 23 Mar 2017 14:52:59 +0000 (22:52 +0800)]
Merge branch 'master' of git://github.com/relan/exfat into marshmallow-x86

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 agoMerge branch 'master' of git://github.com/relan/exfat into marshmallow-x86 android-x86-6.0-r1 android-x86-6.0-r2
Chih-Wei Huang [Wed, 6 Jul 2016 19:02:09 +0000 (03:02 +0800)]
Merge branch 'master' of git://github.com/relan/exfat into marshmallow-x86

Conflicts:
libexfat/io.c

3 years agoFix incremental build
Chih-Wei Huang [Wed, 6 Jul 2016 18:27:27 +0000 (02:27 +0800)]
Fix incremental build

Remove old symbolic links in the previous implementation.

3 years agoLink libfuse-lite from ntfs-3g
Chih-Wei Huang [Wed, 6 Jul 2016 17:47:37 +0000 (01:47 +0800)]
Link libfuse-lite from ntfs-3g

3 years agoClean up Android.mk
Chih-Wei Huang [Wed, 6 Jul 2016 17:17:37 +0000 (01:17 +0800)]
Clean up Android.mk

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 agoexfat-fuse: Don't export UTF conversion functions
Steve Kondik [Thu, 21 Jan 2016 22:46:00 +0000 (14:46 -0800)]
exfat-fuse: Don't export UTF conversion functions

 * These will collide with other tools during static linking. Convert
   them to inlines instead.

Change-Id: Icea3a5c2cb46fe034264c6a161868b8253923d03

4 years agoHandle 64-bit offsets correctly on Android
Steve Kondik [Sun, 7 Jul 2013 07:33:03 +0000 (00:33 -0700)]
Handle 64-bit offsets correctly on Android

Note: Retains only relevant portion from original commit:
github.com/CyanogenMod/android_external_exfat/commit/454ec8915dff0002be280915f722107bdc4f7cd0

Change-Id: Ie2db54b16c5638e2b083b538e14e610b0dbba296

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 agoMerge tag 'v1.2.3' into HEAD
Matt Mower [Thu, 24 Dec 2015 16:57:39 +0000 (10:57 -0600)]
Merge tag 'v1.2.3' into HEAD

Change-Id: I9564731ef38f65fc044bfa3e1e6de91cb3c13ea8

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 agoexfat: ifdef android pre-generated config
Matt Mower [Tue, 10 Nov 2015 20:11:55 +0000 (14:11 -0600)]
exfat: ifdef android pre-generated config

Change-Id: I41a5030ab61eaa3bc960fdac6eaa626d03580044

4 years agoexfat: Provide pre-generated config.h for android
Matt Mower [Tue, 10 Nov 2015 18:46:31 +0000 (12:46 -0600)]
exfat: Provide pre-generated config.h for android

We wont be running autoconfig during build, so generate this header for
ready-use in Android.

Change-Id: I603da096851307763c9117aa4dac11b01980ef8a

4 years agoexfat: Rework build configuration
Steve Kondik [Tue, 10 Nov 2015 13:17:30 +0000 (14:17 +0100)]
exfat: Rework build configuration

Change-Id: Ic13f30258a84593a601a3866ebb55cb4eb82f8a9

4 years agoCall exit instead of abort on unhandled errors
Steve Kondik [Sun, 7 Jul 2013 07:34:45 +0000 (00:34 -0700)]
Call exit instead of abort on unhandled errors

 * Abort will show us a very scary stacktrace on Android under some
   situations such as a card being ejected. Call exit(-1) instead.

4 years agoAdd support for building on Android
Steve Kondik [Sun, 7 Jul 2013 07:13:57 +0000 (00:13 -0700)]
Add support for building on Android

Change-Id: I2b510f7f926848910af5282fdb16e33d21e87a4e

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.

4 years agoSupport platform macros for GNU/kFreeBSD and GNU/HURD.
relan [Wed, 7 Oct 2015 19:18:26 +0000 (22:18 +0300)]
Support platform macros for GNU/kFreeBSD and GNU/HURD.

While GNU/kFreeBSD uses glibc it's obviously not Linux, so it requires
explicit __GLIBC__ check. Strangely, but GNU/HURD does not define
__GLIBC__, so check for __GNU__.

4 years agoBump version to 1.2.1 and update changelog.
relan [Thu, 24 Sep 2015 05:45:32 +0000 (08:45 +0300)]
Bump version to 1.2.1 and update changelog.

4 years agoDetect infinite loop in rootdir_size().
relan [Thu, 10 Sep 2015 14:47:16 +0000 (17:47 +0300)]
Detect infinite loop in rootdir_size().

Otherwise malformed FS can cause hang on mount.

4 years agoCheck sector and cluster size before use.
relan [Wed, 9 Sep 2015 13:58:44 +0000 (16:58 +0300)]
Check sector and cluster size before use.

Otherwise malformed FS can cause heap corruption.

4 years agoDo not set archive bit on directory creation.
relan [Thu, 10 Sep 2015 09:24:59 +0000 (12:24 +0300)]
Do not set archive bit on directory creation.

Windows Exporer does not set archive bit for new directories either.
This fixes compatibility with Zalman VE-200 which is unable to read
images from the _ISO directory if it has archive bit set.

4 years agoMake README.md more text-friendly.
relan [Thu, 24 Sep 2015 05:06:06 +0000 (08:06 +0300)]
Make README.md more text-friendly.

4 years agoUpdate changelog.
relan [Wed, 26 Aug 2015 09:34:01 +0000 (12:34 +0300)]
Update changelog.

4 years agoInclude man pages into distribution.
relan [Fri, 21 Aug 2015 19:04:10 +0000 (22:04 +0300)]
Include man pages into distribution.

They are not installed.

4 years agoCreate symlinks on install.
relan [Wed, 12 Aug 2015 04:47:54 +0000 (07:47 +0300)]
Create symlinks on install.

Install fsck.exfat, mount.exfat and mkfs.exfat convenience aliases.

4 years agoDrop version.h header.
relan [Mon, 29 Jun 2015 12:32:49 +0000 (15:32 +0300)]
Drop version.h header.

Use VERSION define from config.h.

4 years agoInclude local headers before system headers.
relan [Mon, 29 Jun 2015 12:25:00 +0000 (15:25 +0300)]
Include local headers before system headers.

config.h must always be included before stdio.h because it can contain
defines that enable Large File Support (e.g. _FILE_OFFSET_BITS=64 for
glibc on 32-bit machines).

4 years agoAdd .gitignore.
relan [Tue, 4 Aug 2015 15:17:54 +0000 (18:17 +0300)]
Add .gitignore.

It hides everything produced by autoreconf -i && ./configure && make.

4 years agoUse GNU build system (autotools).
relan [Sun, 12 Apr 2015 20:04:13 +0000 (23:04 +0300)]
Use GNU build system (autotools).

4 years agoSupport musl libc that does not define __GLIBC__ macro.
relan [Mon, 27 Jul 2015 18:41:20 +0000 (21:41 +0300)]
Support musl libc that does not define __GLIBC__ macro.

Looks like all libc implementations that support Linux (glibc,
uClibc(-ng), musl and even Bionic) provide the requred defines.
Consider Linux as a single platform.

Signed-off-by: Brendan Heading <brendanheading@gmail.com>
4 years agoTurn "FS is larger than device" error into warning.
relan [Sat, 11 Jul 2015 10:04:51 +0000 (13:04 +0300)]
Turn "FS is larger than device" error into warning.

After formatting a memory card in a Panasonic Lumix DMC TZ-40 camera the
FS appears to be 512 bytes larger than underlying device size. This makes
the last cluster unaccessible. Not a big deal.

4 years agoRecognize optional entries.
relan [Sat, 11 Jul 2015 08:07:53 +0000 (11:07 +0300)]
Recognize optional entries.

Memory cards formatted by Sony cameras have mysterious 0xe1 entries.
Looks like they can be safely ignored. So now if entry type is unknown
and has 0x20 flag set there will be a warning instead of error.

4 years agoFix typo in the dumpexfat man page.
relan [Sat, 13 Jun 2015 12:59:39 +0000 (15:59 +0300)]
Fix typo in the dumpexfat man page.

4 years agoUpdate copyright years.
relan [Sun, 12 Apr 2015 19:52:08 +0000 (22:52 +0300)]
Update copyright years.

4 years agoUpdate man page to reflect the change of umask option default.
relan [Thu, 26 Mar 2015 08:28:24 +0000 (11:28 +0300)]
Update man page to reflect the change of umask option default.

The change has been made in 0f9f49d.

4 years agoAdd /usr/local/lib to LIBPATH on OS X.
relan [Thu, 26 Mar 2015 08:22:27 +0000 (11:22 +0300)]
Add /usr/local/lib to LIBPATH on OS X.

Without this SCons fails to find libosxfuse_i64.

4 years agoMove off_t size check from build script to code.
relan [Thu, 26 Mar 2015 08:16:24 +0000 (11:16 +0300)]
Move off_t size check from build script to code.

Make this check independent from a build system.

4 years agoAdd "create" FUSE operation.
relan [Tue, 24 Mar 2015 20:46:39 +0000 (00:46 +0400)]
Add "create" FUSE operation.

It is required by FreeBSD FUSE implementation.

4 years agoCreate README.md.
relan [Sat, 7 Feb 2015 08:40:06 +0000 (11:40 +0300)]
Create README.md.

4 years agoAdd DEBUG define that enables logging of FUSE events.
relan [Wed, 14 Jan 2015 10:04:22 +0000 (10:04 +0000)]
Add DEBUG define that enables logging of FUSE events.

Signed-off-by: Helg Bredow <xx404@msn.com>
4 years agoPass default_permissions to FUSE.
relan [Wed, 14 Jan 2015 09:53:19 +0000 (09:53 +0000)]
Pass default_permissions to FUSE.

This makes umask, dmask and fmask options work out-of-the-box.

Signed-off-by: Helg Bredow <xx404@msn.com>
4 years agoFix heap corruption: bitmap_size is in bits, not bytes.
relan [Mon, 10 Nov 2014 21:17:12 +0000 (21:17 +0000)]
Fix heap corruption: bitmap_size is in bits, not bytes.