bfs: fix alignment of struct dirent
This is needed on ARMv7 as inode number is stored using STRD instruction which can result in alignment fault even when SCTLR.A bit is disabled. see ARMARM section A3.2.1, Unaligned data access Change-Id: Ib17bf3f78e84ad7987d8158426bc9b27ded28a8e Reviewed-on: https://review.haiku-os.org/c/haiku/+/5623 Tested-by: Commit checker robot <[email protected]> Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
b65cc53f48
commit
7fe1087ed4
@@ -22,7 +22,10 @@
|
||||
// TODO: temporary solution as long as there is no public I/O requests API
|
||||
#ifndef FS_SHELL
|
||||
# include <io_requests.h>
|
||||
# include <kernel.h>
|
||||
# include <util/fs_trim_support.h>
|
||||
#else
|
||||
# include "fssh_kernel_priv.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1759,7 +1762,7 @@ bfs_read_dir(fs_volume* _volume, fs_vnode* _node, void* _cookie,
|
||||
|
||||
dirent->d_dev = volume->ID();
|
||||
dirent->d_ino = id;
|
||||
dirent->d_reclen = offsetof(struct dirent, d_name) + length + 1;
|
||||
dirent->d_reclen = ROUNDUP(offsetof(struct dirent, d_name) + length + 1, sizeof(void*));
|
||||
|
||||
bufferSize -= dirent->d_reclen;
|
||||
dirent = (struct dirent*)((uint8*)dirent + dirent->d_reclen);
|
||||
|
||||
Reference in New Issue
Block a user