From 96b3577b2c08bb79856eb06349feb3eaf5a569bc Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Mon, 12 May 2014 15:04:23 +0200 Subject: [PATCH] Message type for VFS_MKNOD Change-Id: Ief8c6664d79c320a70543c10b758b784fdfa7cfd --- include/minix/callnr.h | 6 ------ include/minix/ipc.h | 12 ++++++++++++ lib/libc/sys-minix/mknod.c | 8 ++++---- servers/vfs/open.c | 8 ++++---- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 1b1ec4b61..da1fbb8cc 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -232,12 +232,6 @@ #define NR_VFS_CALLS 49 /* highest number from base plus one */ -/* Field names for the mknod(2) call. */ -#define VFS_MKNOD_NAME m1_p1 /* const char * */ -#define VFS_MKNOD_LEN m1_i1 /* size_t */ -#define VFS_MKNOD_MODE m1_i2 /* mode_t */ -#define VFS_MKNOD_DEV m1_ull1 /* dev_t */ - /* Field names for the open(2), chdir(2), chmod(2), chroot(2), rmdir(2), and * unlink(2) calls. */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index bfb2c0ef4..ff4bce19d 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -216,6 +216,17 @@ typedef struct { } mess_vfs_lc_lseek; _ASSERT_MSG_SIZE(mess_vfs_lc_lseek); +typedef struct { + dev_t device; + + vir_bytes name; + size_t len; + mode_t mode; + + uint8_t padding[36]; +} mess_lc_vfs_mknod; +_ASSERT_MSG_SIZE(mess_lc_vfs_mknod); + typedef struct { int flags; size_t devlen; @@ -794,6 +805,7 @@ typedef struct { mess_lc_vfs_ioctl m_lc_vfs_ioctl; mess_lc_vfs_link m_lc_vfs_link; mess_lc_vfs_lseek m_lc_vfs_lseek; + mess_lc_vfs_mknod m_lc_vfs_mknod; mess_lc_vfs_mount m_lc_vfs_mount; mess_lc_vfs_pipe2 m_lc_vfs_pipe2; mess_lc_vfs_readlink m_lc_vfs_readlink; diff --git a/lib/libc/sys-minix/mknod.c b/lib/libc/sys-minix/mknod.c index a425b61c1..54ce586a8 100644 --- a/lib/libc/sys-minix/mknod.c +++ b/lib/libc/sys-minix/mknod.c @@ -12,10 +12,10 @@ int mknod(const char *name, mode_t mode, dev_t dev) message m; memset(&m, 0, sizeof(m)); - m.VFS_MKNOD_LEN = strlen(name) + 1; - m.VFS_MKNOD_MODE = mode; - m.VFS_MKNOD_DEV = dev; - m.VFS_MKNOD_NAME = (char *) __UNCONST(name); + m.m_lc_vfs_mknod.len = strlen(name) + 1; + m.m_lc_vfs_mknod.mode = mode; + m.m_lc_vfs_mknod.device = dev; + m.m_lc_vfs_mknod.name = (vir_bytes)name; return(_syscall(VFS_PROC_NR, VFS_MKNOD, &m)); } diff --git a/servers/vfs/open.c b/servers/vfs/open.c index 2b5a35f73..098726963 100644 --- a/servers/vfs/open.c +++ b/servers/vfs/open.c @@ -513,10 +513,10 @@ int do_mknod(void) size_t vname1_length; dev_t dev; - vname1 = (vir_bytes) job_m_in.VFS_MKNOD_NAME; - vname1_length = (size_t) job_m_in.VFS_MKNOD_LEN; - mode_bits = (mode_t) job_m_in.VFS_MKNOD_MODE; - dev = job_m_in.VFS_MKNOD_DEV; + vname1 = job_m_in.m_lc_vfs_mknod.name; + vname1_length = job_m_in.m_lc_vfs_mknod.len; + mode_bits = job_m_in.m_lc_vfs_mknod.mode; + dev = job_m_in.m_lc_vfs_mknod.device; lookup_init(&resolve, fullpath, PATH_NOFLAGS, &vmp, &vp); resolve.l_vmnt_lock = VMNT_WRITE; -- 2.44.0