From ecc9010c4bf363f6590b4d76900cf7658029ab62 Mon Sep 17 00:00:00 2001 From: Lionel Sambuc Date: Mon, 12 May 2014 12:00:38 +0200 Subject: [PATCH] Message type for VFS_MOUNT Change-Id: I4114f5a1aa4f9efe49a12996722499b695c17230 --- include/minix/callnr.h | 11 ----------- include/minix/ipc.h | 16 ++++++++++++++++ lib/libc/sys-minix/mount.c | 18 +++++++++--------- servers/vfs/mount.c | 18 +++++++++--------- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 3063c8e9f..c70f2e257 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -232,17 +232,6 @@ #define NR_VFS_CALLS 49 /* highest number from base plus one */ -/* Field names for the mount(2) call. */ -#define VFS_MOUNT_FLAGS m11_i1 /* int */ -#define VFS_MOUNT_DEVLEN m11_s1 /* size_t */ -#define VFS_MOUNT_PATHLEN m11_s2 /* size_t */ -#define VFS_MOUNT_TYPELEN m11_s3 /* size_t */ -#define VFS_MOUNT_LABELLEN m11_s4 /* size_t */ -#define VFS_MOUNT_DEV m11_p1 /* char * */ -#define VFS_MOUNT_PATH m11_p2 /* char * */ -#define VFS_MOUNT_TYPE m11_p3 /* char * */ -#define VFS_MOUNT_LABEL m11_p4 /* char * */ - /* Field names for the umount(2) call. */ #define VFS_UMOUNT_NAME m1_p1 /* char * */ #define VFS_UMOUNT_NAMELEN m1_i1 /* size_t */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 4cce078ed..8d53d647c 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -155,6 +155,21 @@ typedef struct { } mess_lc_vfs_getvfsstat; _ASSERT_MSG_SIZE(mess_lc_vfs_getvfsstat); +typedef struct { + int flags; + size_t devlen; + size_t pathlen; + size_t typelen; + size_t labellen; + vir_bytes dev; + vir_bytes path; + vir_bytes type; + vir_bytes label; + + uint8_t padding[20]; +} mess_lc_vfs_mount; +_ASSERT_MSG_SIZE(mess_lc_vfs_mount); + typedef struct { uint32_t nfds; fd_set *readfds; @@ -629,6 +644,7 @@ typedef struct { mess_fs_vfs_readwrite m_fs_vfs_readwrite; mess_lc_vfs_getvfsstat m_lc_vfs_getvfsstat; + mess_lc_vfs_mount m_lc_vfs_mount; mess_lc_vfs_select m_lc_vfs_select; mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1; diff --git a/lib/libc/sys-minix/mount.c b/lib/libc/sys-minix/mount.c index 3f942b744..1a2dd6902 100644 --- a/lib/libc/sys-minix/mount.c +++ b/lib/libc/sys-minix/mount.c @@ -144,15 +144,15 @@ int minix_mount(char *special, char *name, int mountflags, int srvflags, /* Now perform mount(). */ memset(&m, 0, sizeof(m)); - m.VFS_MOUNT_FLAGS = mountflags; - m.VFS_MOUNT_DEVLEN = special ? strlen(special) + 1 : 0; - m.VFS_MOUNT_PATHLEN = strlen(name) + 1; - m.VFS_MOUNT_TYPELEN = strlen(type) + 1; - m.VFS_MOUNT_LABELLEN = strlen(label) + 1; - m.VFS_MOUNT_DEV = special; - m.VFS_MOUNT_PATH = name; - m.VFS_MOUNT_TYPE = type; - m.VFS_MOUNT_LABEL = label; + m.m_lc_vfs_mount.flags = mountflags; + m.m_lc_vfs_mount.devlen = special ? strlen(special) + 1 : 0; + m.m_lc_vfs_mount.pathlen = strlen(name) + 1; + m.m_lc_vfs_mount.typelen = strlen(type) + 1; + m.m_lc_vfs_mount.labellen = strlen(label) + 1; + m.m_lc_vfs_mount.dev = (vir_bytes)special; + m.m_lc_vfs_mount.path = (vir_bytes)name; + m.m_lc_vfs_mount.type = (vir_bytes)type; + m.m_lc_vfs_mount.label = (vir_bytes)label; r = _syscall(VFS_PROC_NR, VFS_MOUNT, &m); if (r != OK && !use_existing) { diff --git a/servers/vfs/mount.c b/servers/vfs/mount.c index 6d8ef411c..59ddf547e 100644 --- a/servers/vfs/mount.c +++ b/servers/vfs/mount.c @@ -93,15 +93,15 @@ int do_mount(void) vir_bytes label, type, vname1, vname2; size_t vname1_length, vname2_length, label_len, type_len; - mflags = job_m_in.VFS_MOUNT_FLAGS; - label = (vir_bytes) job_m_in.VFS_MOUNT_LABEL; - label_len = (size_t) job_m_in.VFS_MOUNT_LABELLEN; - vname1 = (vir_bytes) job_m_in.VFS_MOUNT_DEV; - vname1_length = (size_t) job_m_in.VFS_MOUNT_DEVLEN; - vname2 = (vir_bytes) job_m_in.VFS_MOUNT_PATH; - vname2_length = (size_t) job_m_in.VFS_MOUNT_PATHLEN; - type = (vir_bytes) job_m_in.VFS_MOUNT_TYPE; - type_len = (size_t) job_m_in.VFS_MOUNT_TYPELEN; + mflags = job_m_in.m_lc_vfs_mount.flags; + label = job_m_in.m_lc_vfs_mount.label; + label_len = job_m_in.m_lc_vfs_mount.labellen; + vname1 = job_m_in.m_lc_vfs_mount.dev; + vname1_length = job_m_in.m_lc_vfs_mount.devlen; + vname2 = job_m_in.m_lc_vfs_mount.path; + vname2_length = job_m_in.m_lc_vfs_mount.pathlen; + type = job_m_in.m_lc_vfs_mount.type; + type_len = job_m_in.m_lc_vfs_mount.typelen; /* Only the super-user may do MOUNT. */ if (!super_user) return(EPERM); -- 2.44.0