Message type and related cleanup
- Intorduce and use a message type for VFS_GETDENTS, VFS_READ, VFS_WRITE. - Some cleanup to related functions where vir_bytes are replaced (and casted to/from, in parameter definition and local variables as well. This allow to see more clearly which function receives unsafe (pointer) values, or at least values which are not supposed to be valid in the address space of VFS. The current patch does so only for the minimal amount of functions which are concerned with the introduction of the new message type. Change-Id: I0cdca97409c4016d02fae067b48bf55d37572c5c
This commit is contained in:
@@ -232,9 +232,4 @@
|
||||
|
||||
#define NR_VFS_CALLS 49 /* highest number from base plus one */
|
||||
|
||||
/* Field names for the read(2), write(2), and getdents(2) calls. */
|
||||
#define VFS_READWRITE_FD m1_i1 /* int */
|
||||
#define VFS_READWRITE_BUF m1_p1 /* char * */
|
||||
#define VFS_READWRITE_LEN m1_i2 /* size_t */
|
||||
|
||||
#endif /* !_MINIX_CALLNR_H */
|
||||
|
||||
@@ -225,7 +225,7 @@ _ASSERT_MSG_SIZE(mess_lc_vfs_getvfsstat);
|
||||
typedef struct {
|
||||
int fd;
|
||||
unsigned long req;
|
||||
void *arg;
|
||||
vir_bytes arg;
|
||||
|
||||
uint8_t padding[44];
|
||||
} mess_lc_vfs_ioctl;
|
||||
@@ -312,6 +312,15 @@ typedef struct {
|
||||
} mess_lc_vfs_readlink;
|
||||
_ASSERT_MSG_SIZE(mess_lc_vfs_readlink);
|
||||
|
||||
typedef struct {
|
||||
int fd;
|
||||
vir_bytes buf;
|
||||
size_t len;
|
||||
|
||||
uint8_t padding[44];
|
||||
} mess_lc_vfs_readwrite;
|
||||
_ASSERT_MSG_SIZE(mess_lc_vfs_readwrite);
|
||||
|
||||
typedef struct {
|
||||
uint32_t nfds;
|
||||
fd_set *readfds;
|
||||
@@ -866,6 +875,7 @@ typedef struct {
|
||||
mess_lc_vfs_path m_lc_vfs_path;
|
||||
mess_lc_vfs_pipe2 m_lc_vfs_pipe2;
|
||||
mess_lc_vfs_readlink m_lc_vfs_readlink;
|
||||
mess_lc_vfs_readwrite m_lc_vfs_readwrite;
|
||||
mess_lc_vfs_select m_lc_vfs_select;
|
||||
mess_lc_vfs_stat m_lc_vfs_stat;
|
||||
mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1;
|
||||
|
||||
Reference in New Issue
Block a user