From ad7e3e56c8dd12936df9c23f10842b917a582f60 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Mon, 12 May 2014 11:49:08 +0200 Subject: [PATCH] Message type for VFS_{,F}STATVFS1 Change-Id: Iaf71cdddb48f64d84773029da2c0666f5462f198 --- include/minix/callnr.h | 7 ------- include/minix/ipc.h | 12 ++++++++++++ lib/libc/sys-minix/fstatvfs.c | 6 +++--- lib/libc/sys-minix/statvfs.c | 8 ++++---- servers/vfs/stadir.c | 14 +++++++------- 5 files changed, 26 insertions(+), 21 deletions(-) diff --git a/include/minix/callnr.h b/include/minix/callnr.h index b110b588c..3063c8e9f 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -232,13 +232,6 @@ #define NR_VFS_CALLS 49 /* highest number from base plus one */ -/* Field names for the statvfs1(2) and fstatvfs1(2) calls. */ -#define VFS_STATVFS1_LEN m1_i1 /* size_t */ -#define VFS_STATVFS1_NAME m1_p1 /* const char * */ -#define VFS_STATVFS1_FD m1_i1 /* int */ -#define VFS_STATVFS1_BUF m1_p2 /* struct statvfs * */ -#define VFS_STATVFS1_FLAGS m1_i2 /* int */ - /* Field names for the mount(2) call. */ #define VFS_MOUNT_FLAGS m11_i1 /* int */ #define VFS_MOUNT_DEVLEN m11_s1 /* size_t */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 367afb89b..4cce078ed 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -166,6 +166,17 @@ typedef struct { } mess_lc_vfs_select; _ASSERT_MSG_SIZE(mess_lc_vfs_select); +typedef struct { + int fd; + int flags; + size_t len; + vir_bytes name; + vir_bytes buf; + + uint8_t padding[36]; +} mess_lc_vfs_statvfs1; +_ASSERT_MSG_SIZE(mess_lc_vfs_statvfs1); + typedef struct { dev_t device; off_t seek_pos; @@ -619,6 +630,7 @@ typedef struct { mess_lc_vfs_getvfsstat m_lc_vfs_getvfsstat; mess_lc_vfs_select m_lc_vfs_select; + mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1; mess_vfs_fs_breadwrite m_vfs_fs_breadwrite; mess_vfs_fs_chmod m_vfs_fs_chmod; diff --git a/lib/libc/sys-minix/fstatvfs.c b/lib/libc/sys-minix/fstatvfs.c index 2f0900405..ca2b6ee1d 100644 --- a/lib/libc/sys-minix/fstatvfs.c +++ b/lib/libc/sys-minix/fstatvfs.c @@ -14,9 +14,9 @@ int fstatvfs1(int fd, struct statvfs *buffer, int flags) message m; memset(&m, 0, sizeof(m)); - m.VFS_STATVFS1_FD = fd; - m.VFS_STATVFS1_BUF = (char *) buffer; - m.VFS_STATVFS1_FLAGS = flags; + m.m_lc_vfs_statvfs1.fd = fd; + m.m_lc_vfs_statvfs1.buf = (vir_bytes)buffer; + m.m_lc_vfs_statvfs1.flags = flags; return(_syscall(VFS_PROC_NR, VFS_FSTATVFS1, &m)); } diff --git a/lib/libc/sys-minix/statvfs.c b/lib/libc/sys-minix/statvfs.c index cdca3eab2..b61b4e260 100644 --- a/lib/libc/sys-minix/statvfs.c +++ b/lib/libc/sys-minix/statvfs.c @@ -15,10 +15,10 @@ int statvfs1(const char *name, struct statvfs *buffer, int flags) message m; memset(&m, 0, sizeof(m)); - m.VFS_STATVFS1_LEN = strlen(name) + 1; - m.VFS_STATVFS1_NAME = (char *) __UNCONST(name); - m.VFS_STATVFS1_BUF = (char *) buffer; - m.VFS_STATVFS1_FLAGS = flags; + m.m_lc_vfs_statvfs1.len = strlen(name) + 1; + m.m_lc_vfs_statvfs1.name = (vir_bytes)name; + m.m_lc_vfs_statvfs1.buf = (vir_bytes)buffer; + m.m_lc_vfs_statvfs1.flags = flags; return(_syscall(VFS_PROC_NR, VFS_STATVFS1, &m)); } diff --git a/servers/vfs/stadir.c b/servers/vfs/stadir.c index a95bfc8f3..1993826f2 100644 --- a/servers/vfs/stadir.c +++ b/servers/vfs/stadir.c @@ -302,10 +302,10 @@ int do_statvfs(void) vir_bytes vname1, statbuf; size_t vname1_length; - vname1 = (vir_bytes) job_m_in.VFS_STATVFS1_NAME; - vname1_length = (size_t) job_m_in.VFS_STATVFS1_LEN; - statbuf = (vir_bytes) job_m_in.VFS_STATVFS1_BUF; - flags = job_m_in.VFS_STATVFS1_FLAGS; + vname1 = job_m_in.m_lc_vfs_statvfs1.name; + vname1_length = job_m_in.m_lc_vfs_statvfs1.len; + statbuf = job_m_in.m_lc_vfs_statvfs1.buf; + flags = job_m_in.m_lc_vfs_statvfs1.flags; lookup_init(&resolve, fullpath, PATH_NOFLAGS, &vmp, &vp); resolve.l_vmnt_lock = VMNT_READ; @@ -332,9 +332,9 @@ int do_fstatvfs(void) int r, rfd, flags; vir_bytes statbuf; - rfd = job_m_in.VFS_STATVFS1_FD; - statbuf = (vir_bytes) job_m_in.VFS_STATVFS1_BUF; - flags = job_m_in.VFS_STATVFS1_FLAGS; + rfd = job_m_in.m_lc_vfs_statvfs1.fd; + statbuf = job_m_in.m_lc_vfs_statvfs1.buf; + flags = job_m_in.m_lc_vfs_statvfs1.flags; /* Is the file descriptor valid? */ if ((rfilp = get_filp(rfd, VNODE_READ)) == NULL) return(err_code); -- 2.44.0