arch/sim/src/sim/up_hostfs.c, fs/hostfs/hostfs_rpmsg.c, include/nuttx/fs/hostfs.h: Sync nuttx_stat_s consistent with standard struct. Standard struct stat layout changed with commit ea577f1ddd31b3f67405cbb2a57806c47dd4dd63.

This commit is contained in:
Gregory Nutt 2019-12-13 08:35:00 -06:00
parent 0d2afbd5cb
commit a4a23ef584
3 changed files with 33 additions and 10 deletions
arch/sim/src/sim
fs/hostfs
include/nuttx/fs

@ -97,12 +97,18 @@ static void host_stat_convert(struct stat *hostbuf, struct nuttx_stat_s *buf)
buf->st_mode |= NUTTX_S_IFSOCK;
}
buf->st_dev = hostbuf->st_dev;
buf->st_ino = hostbuf->st_ino;
buf->st_nlink = hostbuf->st_nlink;
buf->st_uid = hostbuf->st_uid;
buf->st_gid = hostbuf->st_gid;
buf->st_rdev = hostbuf->st_rdev;
buf->st_size = hostbuf->st_size;
buf->st_blksize = hostbuf->st_blksize;
buf->st_blocks = hostbuf->st_blocks;
buf->st_atim = hostbuf->st_atime;
buf->st_mtim = hostbuf->st_mtime;
buf->st_ctim = hostbuf->st_ctime;
buf->st_blksize = hostbuf->st_blksize;
buf->st_blocks = hostbuf->st_blocks;
}
/****************************************************************************

@ -235,13 +235,19 @@ static int hostfs_rpmsg_stat_handler(FAR struct rpmsg_endpoint *ept,
cookie->result = header->result;
if (cookie->result >= 0)
{
buf->st_dev = rsp->buf.st_dev;
buf->st_ino = rsp->buf.st_ino;
buf->st_mode = rsp->buf.st_mode;
buf->st_nlink = rsp->buf.st_nlink;
buf->st_uid = rsp->buf.st_uid;
buf->st_gid = rsp->buf.st_gid;
buf->st_rdev = rsp->buf.st_rdev;
buf->st_size = B2C(rsp->buf.st_size);
buf->st_blksize = B2C(rsp->buf.st_blksize);
buf->st_blocks = rsp->buf.st_blocks;
buf->st_atime = rsp->buf.st_atime;
buf->st_mtime = rsp->buf.st_mtime;
buf->st_ctime = rsp->buf.st_ctime;
buf->st_blksize = B2C(rsp->buf.st_blksize);
buf->st_blocks = rsp->buf.st_blocks;
}
nxsem_post(&cookie->sem);

@ -103,11 +103,16 @@
/* These must match the definitions in include/sys/types.h */
typedef uintptr_t nuttx_size_t;
typedef int32_t nuttx_off_t;
typedef unsigned int nuttx_mode_t;
typedef int16_t nuttx_blksize_t;
typedef int16_t nuttx_gid_t;
typedef int16_t nuttx_uid_t;
typedef uint16_t nuttx_dev_t;
typedef uint16_t nuttx_ino_t;
typedef uint16_t nuttx_nlink_t;
typedef int32_t nuttx_off_t;
typedef uint32_t nuttx_blkcnt_t;
typedef unsigned int nuttx_mode_t;
typedef uintptr_t nuttx_size_t;
/* These must match the definition in include/time.h */
@ -139,13 +144,19 @@ struct nuttx_statfs_s
struct nuttx_stat_s
{
nuttx_mode_t st_mode; /* File type, atributes, and access mode bits */
nuttx_dev_t st_dev; /* Device ID of device containing file */
nuttx_ino_t st_ino; /* File serial number */
nuttx_mode_t st_mode; /* File type, attributes, and access mode bits */
nuttx_nlink_t st_nlink; /* Number of hard links to the file */
nuttx_uid_t st_uid; /* User ID of file */
nuttx_gid_t st_gid; /* Group ID of file */
nuttx_dev_t st_rdev; /* Device ID (if file is character or block special) */
nuttx_off_t st_size; /* Size of file/directory, in bytes */
nuttx_blksize_t st_blksize; /* Blocksize used for filesystem I/O */
nuttx_blkcnt_t st_blocks; /* Number of blocks allocated */
nuttx_time_t st_atim; /* Time of last access */
nuttx_time_t st_mtim; /* Time of last modification */
nuttx_time_t st_ctim; /* Time of last status change */
nuttx_blksize_t st_blksize; /* Block size used for filesystem I/O */
nuttx_blkcnt_t st_blocks; /* Number of blocks allocated */
};
#endif /* __SIM__ */