This is an automated email from the ASF dual-hosted git repository. linguini1 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 50377d090966ad3e02703fc54f9d88666a967eed Author: Xiang Xiao <[email protected]> AuthorDate: Sat Jun 20 21:39:20 2026 +0800 fs: widen ino_t from uint16_t to uint32_t A 16-bit ino_t can only address 65536 distinct file serial numbers, which is not enough for filesystems with large directory trees and breaks portable software (e.g. dropbear's scp) that expects a wider inode number space. Widen ino_t (and nuttx_ino_t in the hostfs ABI) to uint32_t to match common POSIX practice. Update fs/rpmsgfs/rpmsgfs.h accordingly: promote the 'ino' field in struct rpmsgfs_stat_priv_s from uint16_t to uint32_t and move 'nlink' into the trailing 16-bit slot previously occupied by the reserved field, keeping the overall packed-struct layout/size unchanged. Signed-off-by: Xiang Xiao <[email protected]> --- fs/rpmsgfs/rpmsgfs.h | 5 ++--- include/nuttx/fs/hostfs.h | 2 +- include/sys/types.h | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/rpmsgfs/rpmsgfs.h b/fs/rpmsgfs/rpmsgfs.h index ceb13db779d..0d9f94c1c1a 100644 --- a/fs/rpmsgfs/rpmsgfs.h +++ b/fs/rpmsgfs/rpmsgfs.h @@ -123,8 +123,7 @@ begin_packed_struct struct rpmsgfs_stat_priv_s uint32_t dev; /* Device ID of device containing file */ uint32_t mode; /* File type, attributes, and access mode bits */ uint32_t rdev; /* Device ID (if file is character or block special) */ - uint16_t ino; /* File serial number */ - uint16_t nlink; /* Number of hard links to the file */ + uint32_t ino; /* File serial number */ int64_t size; /* Size of file/directory, in bytes */ int64_t atim_sec; /* Time of last access, seconds */ int64_t atim_nsec; /* Time of last access, nanoseconds */ @@ -136,7 +135,7 @@ begin_packed_struct struct rpmsgfs_stat_priv_s int16_t uid; /* User ID of file */ int16_t gid; /* Group ID of file */ int16_t blksize; /* Block size used for filesystem I/O */ - uint16_t reserved; /* Reserved space */ + uint16_t nlink; /* Number of hard links to the file */ } end_packed_struct; begin_packed_struct struct rpmsgfs_fstat_s diff --git a/include/nuttx/fs/hostfs.h b/include/nuttx/fs/hostfs.h index 65d0c1dd83a..2221591d256 100644 --- a/include/nuttx/fs/hostfs.h +++ b/include/nuttx/fs/hostfs.h @@ -122,7 +122,7 @@ typedef intptr_t nuttx_ssize_t; typedef unsigned int nuttx_gid_t; typedef unsigned int nuttx_uid_t; typedef uint32_t nuttx_dev_t; -typedef uint16_t nuttx_ino_t; +typedef uint32_t nuttx_ino_t; typedef uint16_t nuttx_nlink_t; # ifdef CONFIG_FS_LARGEFILE diff --git a/include/sys/types.h b/include/sys/types.h index 02ed42b08e6..e36aad87d49 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -144,7 +144,7 @@ typedef uint32_t dev_t; /* ino_t is used for file serial numbers */ -typedef uint16_t ino_t; +typedef uint32_t ino_t; /* nlink_t is used for link counts */
