From: Lionel Sambuc Date: Mon, 12 May 2014 11:03:55 +0000 (+0200) Subject: Message type for VFS_MAPDRIVER X-Git-Tag: v3.3.0~316 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/migration?a=commitdiff_plain;h=feb9b541da0cda5618718bacababde6259a73a73;p=minix.git Message type for VFS_MAPDRIVER Change-Id: I979a8769b72cd06efbedf0c6735ac3cd0c4dd2e3 --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 3af6514e5..4fe328bf7 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -232,11 +232,6 @@ #define NR_VFS_CALLS 49 /* highest number from base plus one */ -/* Field names for the mapdriver(2) call. */ -#define VFS_MAPDRIVER_MAJOR m1_i1 /* devmajor_t */ -#define VFS_MAPDRIVER_LABELLEN m1_i2 /* size_t */ -#define VFS_MAPDRIVER_LABEL m1_p1 /* char * */ - /* Field names for the fsync(2) call. */ #define VFS_FSYNC_FD m1_i1 /* int */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index e97e06889..f25dcd944 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -229,6 +229,15 @@ typedef struct { } mess_lsys_vfs_copyfd; _ASSERT_MSG_SIZE(mess_lsys_vfs_copyfd); +typedef struct { + devmajor_t major; + size_t labellen; + vir_bytes label; + + uint8_t padding[44]; +} mess_lsys_vfs_mapdriver; +_ASSERT_MSG_SIZE(mess_lsys_vfs_mapdriver); + typedef struct { dev_t device; off_t seek_pos; @@ -689,6 +698,7 @@ typedef struct { mess_lsys_vfs_checkperms m_lsys_vfs_checkperms; mess_lsys_vfs_copyfd m_lsys_vfs_copyfd; + mess_lsys_vfs_mapdriver m_lsys_vfs_mapdriver; mess_vfs_fs_breadwrite m_vfs_fs_breadwrite; mess_vfs_fs_chmod m_vfs_fs_chmod; diff --git a/lib/libsys/mapdriver.c b/lib/libsys/mapdriver.c index e86756088..f72e511a4 100644 --- a/lib/libsys/mapdriver.c +++ b/lib/libsys/mapdriver.c @@ -9,9 +9,9 @@ mapdriver(char *label, devmajor_t major) message m; memset(&m, 0, sizeof(m)); - m.VFS_MAPDRIVER_LABEL = label; - m.VFS_MAPDRIVER_LABELLEN = strlen(label) + 1; - m.VFS_MAPDRIVER_MAJOR = major; + m.m_lsys_vfs_mapdriver.label = (vir_bytes)label; + m.m_lsys_vfs_mapdriver.labellen = strlen(label) + 1; + m.m_lsys_vfs_mapdriver.major = major; return _taskcall(VFS_PROC_NR, VFS_MAPDRIVER, &m); } diff --git a/servers/vfs/dmap.c b/servers/vfs/dmap.c index b4cbe131a..d9b3cfea1 100644 --- a/servers/vfs/dmap.c +++ b/servers/vfs/dmap.c @@ -120,9 +120,9 @@ int do_mapdriver(void) /* Only RS can map drivers. */ if (who_e != RS_PROC_NR) return(EPERM); - label_vir = (vir_bytes) job_m_in.VFS_MAPDRIVER_LABEL; - label_len = (size_t) job_m_in.VFS_MAPDRIVER_LABELLEN; - major = job_m_in.VFS_MAPDRIVER_MAJOR; + label_vir = job_m_in.m_lsys_vfs_mapdriver.label; + label_len = job_m_in.m_lsys_vfs_mapdriver.labellen; + major = job_m_in.m_lsys_vfs_mapdriver.major; /* Get the label */ if (label_len > sizeof(label)) { /* Can we store this label? */