relan
cf2d9bd161
Update copyright years.
2023-03-02 22:32:35 +03:00
relan
d7e780da26
Maintain valid_size in exfat_node.
2022-12-29 12:48:59 +03:00
relan
cdd8f98023
Fix a couple of typos in comments.
2022-10-04 21:54:01 +03:00
relan
da00dc5d05
Make error handling in find_slot() more robust.
...
check_slot() can potentially return any value besides 0, -EIO and
-EINVAL.
2021-10-23 14:40:58 +03:00
relan
f15b0e4676
Fix more comparisons between signed and unsigned values.
...
Found by gcc 7.4.0.
2020-05-04 18:53:09 +03:00
relan
4610ce90f9
Rename UTF-related functions.
...
Avoid conflicts with Android's libutils. Those functions should have had
the "exfat" prefix from the very beginning...
2020-02-29 11:46:41 +03:00
relan
6893176e00
Fix comparisons between signed and unsigned values.
2020-02-29 11:40:56 +03:00
relan
360084b62e
Fix some signedness warnings.
2019-08-17 19:51:27 +03:00
relan
fdf4e96dc3
Fix unaligned accesses to packed struct members.
2019-07-25 06:59:12 +03:00
Nathan Hunsperger
75f28b558a
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.
2019-04-20 21:14:49 +03:00
relan
f9c0f1b75b
Repairing: implement unknown entry type fix.
2018-09-15 07:52:46 +03:00
relan
53728e5a79
Repairing: implement invalid node checksum fix.
2018-09-15 07:52:46 +03:00
relan
ca712e7ba8
Update copyright years.
2018-02-03 10:29:39 +03:00
m4rkusxxl
21fab6b208
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.
2018-01-19 09:44:43 +03:00
relan
2f6a54823b
Fix clusters bitmap size.
...
The last two clusters were erroneously considered invalid. Note that
clusters numbering starts with 2.
2017-05-02 20:19:57 +03:00
relan
53cdfb64cc
Clean up unused parameters in libexfat.
2017-04-01 09:39:47 +03:00
relan
abab1c28f2
Check that file or directory size does not exceed clusters heap.
2017-03-21 09:46:00 +03:00
relan
cb1a999dce
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.
2017-03-19 19:09:17 +03:00
relan
9dc649a5af
Pass struct exfat to check_node().
...
Future version of CLUSTER_INVALID() macro will need it.
2017-03-17 08:17:45 +03:00
relan
5925b60368
Update copyright years.
2017-01-28 22:11:04 +03:00
relan
fe052b1c4c
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.
2017-01-16 09:36:23 +03:00
relan
09ac9d9cee
Generic I/O for directories: switch readdir().
2017-01-16 09:29:08 +03:00
relan
9e02a1a31f
Generic I/O for directories: switch find_slot().
2017-01-16 09:29:08 +03:00
relan
961b37be87
Generic I/O for directories: switch exfat_flush_node().
2017-01-16 09:29:08 +03:00
relan
95c1b7904c
Generic I/O for directories: switch rename_entry().
2017-01-16 09:29:08 +03:00
relan
cf962cdfdd
Generic I/O for directories: switch erase_entry().
2017-01-16 09:29:08 +03:00
relan
1c510ae0e5
Generic I/O for directories: switch commit_entry().
2017-01-16 09:29:08 +03:00
relan
428f0307f6
Generic I/O for directories: switch find_label().
2017-01-16 09:29:08 +03:00
relan
5735df4e07
Generic I/O for directories: switch exfat_set_label().
2017-01-16 09:29:08 +03:00
relan
13f2af30a7
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.
2017-01-16 09:29:08 +03:00
relan
27bc40ffd7
Rename node field flags to attrib.
...
Now it contains only exFAT attributes (from meta2).
2017-01-16 09:29:08 +03:00
relan
c512e12d79
Replace node flags with bit fields.
...
Bit fields are safer and more readable.
2017-01-16 09:29:08 +03:00
relan
7157501b8b
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.
2017-01-16 09:29:08 +03:00
relan
088ea8a362
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.
2016-12-26 10:01:18 +03:00
relan
758e96d2be
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).
2016-12-26 10:01:18 +03:00
relan
e62b969950
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.
2016-12-26 10:01:18 +03:00
relan
615b0cae5d
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.
2016-12-26 10:01:18 +03:00
relan
b7bac38b16
Move meta2 fields checking into check_node().
...
There we know node name and print it if an error is detected.
2016-12-05 13:38:30 +03:00
relan
575ba4bca6
Add node start cluster checks.
2016-12-05 13:38:30 +03:00
relan
74ab25d6e5
Run all checks in check_node().
...
Do not stop node validation on the first error.
2016-12-05 13:38:30 +03:00
relan
1a2f610852
Improve error messages in opendir().
2016-12-05 13:38:30 +03:00
relan
e10d9d0b41
Remove unused field of struct iterator.
2016-12-05 13:30:47 +03:00
relan
bc5c231dc6
Fix memory leak on error path when directory read fails.
2016-11-12 09:49:33 +03:00
relan
d2a4dd4d36
Update copyright years.
2016-06-03 08:20:53 +03:00
relan
aab123c9ab
Support upcase table compression.
...
Upcase table can use RLE for identity-mapped characters.
2016-06-03 08:11:00 +03:00
relan
1bacc536bb
Fix clusters loss when file renaming replaces target.
...
Add missing exfat_cleanup_node() call after exfat_unlink().
2015-12-19 11:16:21 +03:00
relan
c4d1bc1e67
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.
2015-11-07 11:25:48 +03:00
relan
5d3dd6f2e3
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.
2015-09-24 08:28:42 +03:00
relan
8c4c5fabc4
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.
2015-08-24 08:36:19 +03:00
relan
d3c8cf283f
Update copyright years.
2015-08-24 08:36:18 +03:00