History log of /haiku/src/add-ons/kernel/file_systems/exfat/Volume.cpp
Revision Date Author Comments
# d72239d2 17-Apr-2020 Suhel Mehta <mehtasuhel@gmail.com>

Move DeviceOpener class to a separate file.

It is used by several of the filesystems, so it seems a good idea to
move it to the shared/ directory.

UFS2, BFS, XFS, EXT2 and EXFAT are adjusted.

Change-Id: I493e37a1e7d3ae24251469f82befd985a3c1dbdd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2489
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 1418cade 11-Jul-2019 Augustin Cavalier <waddlesplash@gmail.com>

file_systems: Pass size argument to ioctl in a lot more places.


# 1d3959ed 26-Feb-2019 Jérôme Duval <jerome.duval@gmail.com>

exfat: checks cluster values.

also use the size of the node for Size(), instead of the valid size.


# 14263044 22-Feb-2019 Jérôme Duval <jerome.duval@gmail.com>

exfat: avoid overflow in Volume::ClusterToBlock().


# 88b72296 25-Jul-2014 Michael Lotz <mmlr@mlotz.ch>

exfat: Add missing locking around SplayTree lookup/insertion.

A lookup in a splay tree does move the looked up entry to the root of
the tree. This means the tree structure is modified on lookup alone.
Obviously the tree structure is also modified when inserting new nodes.

For both of these reasons access to the f{Node|Ino}Tree needs to be
locked on lookup and insert.

Fixes crashes when the tree is concurrently modified by multiple threads
accessing the same exfat volume.

In addition this protects the fNextId field that hands out new inode
ids.


# ebd3bcdb 12-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: handle 4-byte UTF-16 surrogate pairs

... in filenames. Replace the existing Unicode conversion functions
with UTF conversion functions from js that he relicensed MIT for us.

Put the UTF conversion functions in a private but shared code location
so that they can be accessed throughout the kernel.

Right now we only provide functions to convert between UTF-8 and UTF-16.
At some point we should also add functions to convert between UTF-8 and
UTF-32 and UTF-16 and UTF-32 but these aren't needed by exfat.

Remove the old Unicode conversion functions from exfat as they assumed
UCS-2 characters and don't work with UTF-16 used by exfat.

Rename most variables with the term length with code unit where code units
are intended. The term length, when used, means length in bytes while code
units represent either a full 2-byte UTF-16 character or half a 4-byte
surrogate pair.


# 3472fc55 06-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: style fix param/variable renaming

Pass the partition size into the default name, not the device size,
this makes the variable names match the comment.

There is no functional change here, the variable names got renamed
to make it more clear what's happening. We want show the partition
size, not the device size, and we want to error if the device size is less
than the partition size, not if the partition size is less than the device size.


# 48fcadd4 05-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: recheck device size is big enough to hold fs

I didn't mean to omit this check, I just need to save deviceSize below for
get_default_volume_name() so that it will match the mount point name.

Checked to make sure the calculation works on a 2GiB, 32GiB, and 128GiB
(virtual) exfat volume.


# dae266a8 05-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: fix problems with hrev46820

* Set the size of the volume name member var to B_FILE_NAME_LENGTH which is the
max width of a volume name according to the BeBook and the Support Kit code. We'll
deal with trying to stuff the volume name back into the exfat volume label later.
* Rename volume_name() to get_volume_name()
* Pass the name string length into get_volume_name() and use it to avoid buffer overrun.
* Fill name with a blank string if volume has no label.
* Don't memset the name with zeros before doing the conversion from Unicode to UTF-8,
the conversion function will make sure the result is NUL-terminated if it returns B_OK.
* Also check the return value of the Unicode conversion function and return an error if it fails.
* Add get_default_volume_name() method to Utility.cpp which is used to fill out the default
volume name in the case volume name is blank. e.g. 32GiB ExFAT Volume. This now
applies to both the volume name and mount point.
* Use non-metric prefixes for default volume name, e.g. MiB, GiB, TiB
* For an unset volume name fill the volume name with an empty string.
* Remove the leading underscore from _name and _partition parameters
* Replace size constants with sizeof() calls
* Remove Axel from the copyright statement in Utility.cpp, he had nothing to do with it,
add Jérôme (aka korli) because he wrote the code for get_default_volume_name()
(was in Volumes.cpp)
* Remove some trailing spaces from encodings.cpp

Thanks Axel.


# 88e24cf6 05-Feb-2014 John Scipione <jscipione@gmail.com>

Revert "exfat: limit backup volume name to 11 characters"

This reverts commit c79381d32a61a570bff305744b1230100c735e22.


# 762b846c 04-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: Set the mountpoint to same as volume name

Fixes #10501

* update copyright headers, attribute to Haiku, Inc. add authors
* volume_name gets filled out by a utility function in Utility.cpp
* update exfat_entry
- rename name_label to just label
- adjust volume_label to have 11 uint16 chars plus 8 uint8 reserved
- add guid partition info
* Added a couple new entry type defines
* fName is 34 bytes long which fits the 11 3-byte UTF-8 chars and a \0


# c79381d3 04-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: limit backup volume name to 11 characters


# aeb03a8f 04-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: style fixes only


# 3f5d1e78 06-May-2013 Jérôme Duval <jerome.duval@gmail.com>

exfat: fixes 64 bit warnings


# ee668d24 04-May-2013 Jerome Duval <jerome.duval@gmail.com>

exfat: Return more than a single dirent at a time in exfat_read_dir().

* similar to what mmlr did in hrev45575 for bfs.
* DirectoryIterator could try to read past the end of the directory.
* replaced a dprintf with a TRACE() statement.


# 46cf7a5a 14-Nov-2012 Przemysław Buczkowski <przemub@yahoo.pl>

Fix typos: super block -> superblock (#8974)

Signed-off-by: Przemysław Buczkowski <przemub@yahoo.pl>
Signed-off-by: Matt Madia <mattmadia@gmail.com>


# ce9fdaea 10-Feb-2011 Jérôme Duval <korli@users.berlios.de>

* takes into account volume label
* clean up
* directories don't seem to have a valid contiguous flag, fixes directories with many files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40431 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e74e90ae 09-Feb-2011 Jérôme Duval <korli@users.berlios.de>

* Implemented a read-only exFAT file system, tested with a 4GB image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40409 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 88b722965aebd26417161026478cdeb931a2aca5 25-Jul-2014 Michael Lotz <mmlr@mlotz.ch>

exfat: Add missing locking around SplayTree lookup/insertion.

A lookup in a splay tree does move the looked up entry to the root of
the tree. This means the tree structure is modified on lookup alone.
Obviously the tree structure is also modified when inserting new nodes.

For both of these reasons access to the f{Node|Ino}Tree needs to be
locked on lookup and insert.

Fixes crashes when the tree is concurrently modified by multiple threads
accessing the same exfat volume.

In addition this protects the fNextId field that hands out new inode
ids.


# ebd3bcdb9be2d6a57fc5b3270dcb49a9e1894d11 12-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: handle 4-byte UTF-16 surrogate pairs

... in filenames. Replace the existing Unicode conversion functions
with UTF conversion functions from js that he relicensed MIT for us.

Put the UTF conversion functions in a private but shared code location
so that they can be accessed throughout the kernel.

Right now we only provide functions to convert between UTF-8 and UTF-16.
At some point we should also add functions to convert between UTF-8 and
UTF-32 and UTF-16 and UTF-32 but these aren't needed by exfat.

Remove the old Unicode conversion functions from exfat as they assumed
UCS-2 characters and don't work with UTF-16 used by exfat.

Rename most variables with the term length with code unit where code units
are intended. The term length, when used, means length in bytes while code
units represent either a full 2-byte UTF-16 character or half a 4-byte
surrogate pair.


# 3472fc553eb5a8e2d9ff40c9a33f083b6f303081 06-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: style fix param/variable renaming

Pass the partition size into the default name, not the device size,
this makes the variable names match the comment.

There is no functional change here, the variable names got renamed
to make it more clear what's happening. We want show the partition
size, not the device size, and we want to error if the device size is less
than the partition size, not if the partition size is less than the device size.


# 48fcadd44cec578e9dcd4af44e6596714e3086c7 05-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: recheck device size is big enough to hold fs

I didn't mean to omit this check, I just need to save deviceSize below for
get_default_volume_name() so that it will match the mount point name.

Checked to make sure the calculation works on a 2GiB, 32GiB, and 128GiB
(virtual) exfat volume.


# dae266a8a4141d0c1059685b78bb9bd5b27c8389 05-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: fix problems with hrev46820

* Set the size of the volume name member var to B_FILE_NAME_LENGTH which is the
max width of a volume name according to the BeBook and the Support Kit code. We'll
deal with trying to stuff the volume name back into the exfat volume label later.
* Rename volume_name() to get_volume_name()
* Pass the name string length into get_volume_name() and use it to avoid buffer overrun.
* Fill name with a blank string if volume has no label.
* Don't memset the name with zeros before doing the conversion from Unicode to UTF-8,
the conversion function will make sure the result is NUL-terminated if it returns B_OK.
* Also check the return value of the Unicode conversion function and return an error if it fails.
* Add get_default_volume_name() method to Utility.cpp which is used to fill out the default
volume name in the case volume name is blank. e.g. 32GiB ExFAT Volume. This now
applies to both the volume name and mount point.
* Use non-metric prefixes for default volume name, e.g. MiB, GiB, TiB
* For an unset volume name fill the volume name with an empty string.
* Remove the leading underscore from _name and _partition parameters
* Replace size constants with sizeof() calls
* Remove Axel from the copyright statement in Utility.cpp, he had nothing to do with it,
add Jérôme (aka korli) because he wrote the code for get_default_volume_name()
(was in Volumes.cpp)
* Remove some trailing spaces from encodings.cpp

Thanks Axel.


# 88e24cf64fe6a469fdd367cf5f272f52ee59889b 05-Feb-2014 John Scipione <jscipione@gmail.com>

Revert "exfat: limit backup volume name to 11 characters"

This reverts commit c79381d32a61a570bff305744b1230100c735e22.


# 762b846cf8ba678f31a854a85e68003d2071be8d 04-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: Set the mountpoint to same as volume name

Fixes #10501

* update copyright headers, attribute to Haiku, Inc. add authors
* volume_name gets filled out by a utility function in Utility.cpp
* update exfat_entry
- rename name_label to just label
- adjust volume_label to have 11 uint16 chars plus 8 uint8 reserved
- add guid partition info
* Added a couple new entry type defines
* fName is 34 bytes long which fits the 11 3-byte UTF-8 chars and a \0


# c79381d32a61a570bff305744b1230100c735e22 04-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: limit backup volume name to 11 characters


# aeb03a8f68bad446e3f1178fa9ea8cb3c9e460ab 04-Feb-2014 John Scipione <jscipione@gmail.com>

exfat: style fixes only


# 3f5d1e78252bb593cf5b430f37c3d18d779afab1 06-May-2013 Jérôme Duval <jerome.duval@gmail.com>

exfat: fixes 64 bit warnings


# ee668d24e34a6da029d2f188118c023929f97391 04-May-2013 Jerome Duval <jerome.duval@gmail.com>

exfat: Return more than a single dirent at a time in exfat_read_dir().

* similar to what mmlr did in hrev45575 for bfs.
* DirectoryIterator could try to read past the end of the directory.
* replaced a dprintf with a TRACE() statement.


# 46cf7a5a73679c6e4fde91710e4a4885242e49d1 14-Nov-2012 Przemysław Buczkowski <przemub@yahoo.pl>

Fix typos: super block -> superblock (#8974)

Signed-off-by: Przemysław Buczkowski <przemub@yahoo.pl>
Signed-off-by: Matt Madia <mattmadia@gmail.com>


# ce9fdaeae4e2465dfc3cd53954416e9567456ee9 10-Feb-2011 Jérôme Duval <korli@users.berlios.de>

* takes into account volume label
* clean up
* directories don't seem to have a valid contiguous flag, fixes directories with many files.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40431 a95241bf-73f2-0310-859d-f6bbb57e9c96


# e74e90aef91f844d4d3654504cd0776c26a454e5 09-Feb-2011 Jérôme Duval <korli@users.berlios.de>

* Implemented a read-only exFAT file system, tested with a 4GB image.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40409 a95241bf-73f2-0310-859d-f6bbb57e9c96