refactor: Swap %Ld for %lld in all format usages* %Ld is an undocumented alias for %lld in glibc.* muslc doesn't implement it for this reason.* While we will likely never drop %Ld support, lets
refactor: Swap %Ld for %lld in all format usages* %Ld is an undocumented alias for %lld in glibc.* muslc doesn't implement it for this reason.* While we will likely never drop %Ld support, lets clean house and set a better example.Change-Id: Id46dad3104abae483e80cc5c05d1464d3ecd8030Reviewed-on: https://review.haiku-os.org/c/haiku/+/6636Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
show more ...
Adjust all struct dirent creations (again), this time to use offsetof().The dirent struct is not packed, so offsetof(dirent, d_name) != sizeof(dirent).Thus in order not to waste the alignment byte
Adjust all struct dirent creations (again), this time to use offsetof().The dirent struct is not packed, so offsetof(dirent, d_name) != sizeof(dirent).Thus in order not to waste the alignment bytes (which are significant,on x86_64 at least, sizeof(dirent)==32, but offsetof(...)=26.)This is also the most portable way to handle things, and shouldwork just fine in cross-platform code that has a non-zero-sized d_name.
file_systems: fs_read_link() doesn't use a user bufferintroduced in hrev26728 and hrev54107.Change-Id: I3e98d54e829bcce559c43a8ee1abe4d889c0a571Reviewed-on: https://review.haiku-os.org/c/haiku/+
file_systems: fs_read_link() doesn't use a user bufferintroduced in hrev26728 and hrev54107.Change-Id: I3e98d54e829bcce559c43a8ee1abe4d889c0a571Reviewed-on: https://review.haiku-os.org/c/haiku/+/2819Reviewed-by: waddlesplash <waddlesplash@gmail.com>
storage/SymLink: Fix Be API regression in ReadLinkAfter this patch, "UnitTester BSymLink" passes.BSymLink::ReadLink() in BeOS would always return the length of thelink unless an error occurred.
storage/SymLink: Fix Be API regression in ReadLinkAfter this patch, "UnitTester BSymLink" passes.BSymLink::ReadLink() in BeOS would always return the length of thelink unless an error occurred. Before this patch, Haiku instead seemedto emulate posix readlink() behavior, returning the number of bytescopied into the output buffer.BeOS also did not guarantee that the string written into the outputbuffer is NULL terminated if the output buffer cannot contain theentire link contents, but the Haiku implementation does since it is isa basic safety issue.This patch fixes this and updates the Haiku API docs to describe thebehavior explicitly.Fixing this required changing behavior in bfs_read_link, whichrequired changes in many more places.docs/user/storage/SymLink.dox:src/kits/storage/SymLink.cpp:* Don't return B_BUFFER_OVERFLOW if the provided buffer is not large enough to hold the link contents.* Update documentation to clearly describe behavior.src/add-ons/kernel/file_systems/bfs/kernel_interface.cpp:* Change bfs_read_link() to always return the link length. This is called by common_read_link in the VFS, which is called by _kern_read_link().src/add-ons/kernel/file_systems/btrfs/kernel_interface.cpp:src/add-ons/kernel/file_systems/exfat/kernel_interface.cpp:src/add-ons/kernel/file_systems/ext2/kernel_interface.cpp:src/add-ons/kernel/file_systems/iso9660/kernel_interface.cpp:src/add-ons/kernel/file_systems/netfs/client/netfs.cpp:src/add-ons/kernel/file_systems/nfs/nfs_add_on.c:src/add-ons/kernel/file_systems/ramfs/kernel_interface.cpp:src/add-ons/kernel/file_systems/reiserfs/Iterators.cpp:src/add-ons/kernel/file_systems/reiserfs/Iterators.h:src/add-ons/kernel/file_systems/reiserfs/Volume.cpp:src/add-ons/kernel/file_systems/reiserfs/Volume.h:* Update the implementation of read_link for these filesystems. Some of them were incorrect, and some had just copied the posix behavior of bfs from before this patch.* Use user_memcpy in ext2_read_link()* Use user_memcpy in nfs fs_read_link()* Use user_memcpy in reiserfs StreamReader::_ReadIndirectItem and StreamReader::_ReadDirectItem* Remove unused method Volume::ReadObject in reiserfs.src/add-ons/kernel/file_systems/packagefs/nodes/UnpackingLeafNode.cpp:src/add-ons/kernel/file_systems/packagefs/package_links/PackageLinkSymlink.cpp:* Update UnpackingLeafNode::ReadSymlink and PackageSymLink::ReadSymLink() to set the bufferSize out parameter to the symlink length. Both of these are called by packagefs_read_symlink.* Use user_memcpysrc/add-ons/kernel/file_systems/netfs/client/netfs.cpp:* netfs seems mostly unimplemented. Added a FIXME note for future implementers so that they know to implement the correct behavior.src/system/libroot/posix/unistd/link.c:* readlinkat() was just wrapping _kern_read_link() because before this patch it had expected posix behavior. But now it does not, so we need to return the number of bytes written to the output buffer.src/build/libroot/fs.cpp:* Update _kern_read_link() in the compatibility code to emulate the Haiku behavior on the host system. This is done by using an intermediate buffer that is guaranteed to fit the link contents and returning its length. The intermediate buffer is copied into the output buffer until there is no more room.src/tests/kits/storage/SymLinkTest.cpp:* This patch also resolves some test failures similar to those resolved in ee8cf35f0 which fixed tests for BNode. The tests were failing because Haiku's error checking is just better. BeOS allowed constructing a BSymLink with BSymLink(BDirectory*, const char*) with the entry name of "". The same is true of the equivilant SetTo() method. The BSymLink object will appear valid until you attempt to use it by, for example, calling the ReadLink method, which will return B_BAD_VALUE. Haiku does a more appropriate thing and returns B_ENTRY_NOT_FOUND, for this constructor and the equivilant SetTo(BDirectory*, const char*) method. This patch fixes these test assertions to match Haiku behavior.docs/develop/file_systems/overview.txt:* Add notes for future filesystem driver implementers to call this mistake when implementing fs_vnode_ops::read_symlink.docs/user/drivers/fs_interface.dox:* Fix documentation for fs_vnode_ops::read_symlinkChange-Id: I8bcb8b2a0c9333059c84ace15844c32d4efeed9dReviewed-on: https://review.haiku-os.org/c/haiku/+/2502Reviewed-by: waddlesplash <waddlesplash@gmail.com>Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
file_systems: Pass size argument to ioctl in a lot more places.
file_systems: Remove now-redundant bounds checks before file_cache_read().Change-Id: Iafb7d188c7e7cb4406d924eb3354a7ede40c6641Reviewed-on: https://review.haiku-os.org/c/1421Reviewed-by: waddlespl
file_systems: Remove now-redundant bounds checks before file_cache_read().Change-Id: Iafb7d188c7e7cb4406d924eb3354a7ede40c6641Reviewed-on: https://review.haiku-os.org/c/1421Reviewed-by: waddlesplash <waddlesplash@gmail.com>Reviewed-by: Michael Lotz <mmlr@mlotz.ch>
iso9660_shell: Use the fs_shell from src/tools; fix the build.
iso9660: fix PVS 2430 to 2435.* Incorrect handling of realloc() failure (if reallocation fails,original buffer is still allocated and must be freed),* Use of bit shift on signed integer (undefine
iso9660: fix PVS 2430 to 2435.* Incorrect handling of realloc() failure (if reallocation fails,original buffer is still allocated and must be freed),* Use of bit shift on signed integer (undefined behavior in C and C++).
add-ons/kernel: Use UsePrivateKernelHeaders where appropriate
cdda, fat, iso9660: clear tv_nsecs fields in the stat struct* devfs in fact doesn't provide a zeroed buffer.
iso9960, exfat, fat: Corrected time conversion mistakes.* Fixes #9524* Some style cleanupSigned-off-by: Jerome Duval <jerome.duval@gmail.com>
Automatic whitespace cleanup. No functional change.This push (ok, the previous changeset) fixes #9486.
iso9660 fs driver bugfix + code refactoringSigned-off-by: Matt Madia <mattmadia@gmail.com>
This must be a 64 bit computation for disks larger than 4GB.* This closes ticket #8460.* Patch from jahaiku, thanks!
Fix iso9660 add-on.hrev43777 introduced a regression that resulted in the symlink flag byteno longer getting skipped in non-trace builds. Fixes #8369.
Fixes some occurrences of 'variable set but not used', disables Werror for problematic items.
Align all filesystem relevant places to use B_UNSUPPORTED for unsupportedinstead of a mix of B_NOT_SUPPORTED and B_UNSUPPORTED. This allows checking fora specific error code. Probably one of those
Align all filesystem relevant places to use B_UNSUPPORTED for unsupportedinstead of a mix of B_NOT_SUPPORTED and B_UNSUPPORTED. This allows checking fora specific error code. Probably one of those should be phased out...git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43025 a95241bf-73f2-0310-859d-f6bbb57e9c96
* fix trace typedef size to fix iso9660 tracinggit-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42597 a95241bf-73f2-0310-859d-f6bbb57e9c96
Patch by kaliber (ticket #6333): Removed many instances ofpassing an additional -Wall to the compiler, which may actuallyhave unwanted effects. -Wall is standard by the build system.Also, -Wno-mul
Patch by kaliber (ticket #6333): Removed many instances ofpassing an additional -Wall to the compiler, which may actuallyhave unwanted effects. -Wall is standard by the build system.Also, -Wno-multichar was passed unnecessarily for Haiku targets.I didn't remove it for the bfs_shell, hope this is what Ingo meantin the ticket.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39314 a95241bf-73f2-0310-859d-f6bbb57e9c96
added a file system call preallocate() as described in #6285, currently unusedgit-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39006 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Fixed CID 1508: a corrupted rockridge entry could cause a kernel panic.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38429 a95241bf-73f2-0310-859d-f6bbb57e9c96
* iso9660_volume::volSetIDString[] should have been 129 bytes in size, not 29. This fixes (a harmless) out of bounds array access, and CID 1359.git-svn-id: file:///srv/svn/repos/haiku/haiku/trun
* iso9660_volume::volSetIDString[] should have been 129 bytes in size, not 29. This fixes (a harmless) out of bounds array access, and CID 1359.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38423 a95241bf-73f2-0310-859d-f6bbb57e9c96
bonefish + axeld:* Reverted r31809 as it introduced a race condition; if the I/O request had been notified, it could already been deleted at that point.* Instead, we need to notify the request in
bonefish + axeld:* Reverted r31809 as it introduced a race condition; if the I/O request had been notified, it could already been deleted at that point.* Instead, we need to notify the request in each file system/driver that uses it. Added new notify_io_request() function that does that exactly.* Added a TODO comment to the userlandfs where the request notification needs a bit more thought.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31903 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Added support for the io() hook. Not yet tested.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30906 a95241bf-73f2-0310-859d-f6bbb57e9c96
* Cleanup.git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30905 a95241bf-73f2-0310-859d-f6bbb57e9c96
123