From: Lionel Sambuc Date: Mon, 28 Apr 2014 16:54:18 +0000 (+0200) Subject: Message types for VFS newnode X-Git-Tag: v3.3.0~348 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/mdoc.3.txt?a=commitdiff_plain;h=83cd8ba616808aa4e7cd77a261c22577b5aa5f8f;p=minix.git Message types for VFS newnode Change-Id: I5c0790fc1104182ab08bcae699c60a364833c360 --- diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 2eed98994..bd799c364 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -204,6 +204,30 @@ typedef struct { } mess_fs_vfs_lookup; _ASSERT_MSG_SIZE(mess_fs_vfs_lookup); +typedef struct { + dev_t device; + + mode_t mode; + uid_t uid; + gid_t gid; + + uint8_t data[36]; +} mess_vfs_fs_newnode; +_ASSERT_MSG_SIZE(mess_vfs_fs_newnode); + +typedef struct { + off_t file_size; + dev_t device; + ino_t inode; + + mode_t mode; + uid_t uid; + gid_t gid; + + uint8_t data[20]; +} mess_fs_vfs_newnode; +_ASSERT_MSG_SIZE(mess_fs_vfs_newnode); + typedef struct { dev_t device; @@ -300,6 +324,8 @@ typedef struct { mess_mmap m_mmap; mess_notify m_notify; mess_sigcalls m_sigcalls; + mess_vfs_fs_newnode m_vfs_fs_newnode; + mess_fs_vfs_newnode m_fs_vfs_newnode; mess_vfs_fs_create m_vfs_fs_create; mess_fs_vfs_create m_fs_vfs_create; mess_vfs_fs_lookup m_vfs_fs_lookup; diff --git a/servers/pfs/open.c b/servers/pfs/open.c index 27273dab2..b3f17643c 100644 --- a/servers/pfs/open.c +++ b/servers/pfs/open.c @@ -11,16 +11,16 @@ int fs_newnode(message *fs_m_in, message *fs_m_out) { register int r = OK; - pmode_t bits; + mode_t bits; struct inode *rip; uid_t uid; gid_t gid; dev_t dev; - uid = (uid_t) fs_m_in->REQ_UID; - gid = (gid_t) fs_m_in->REQ_GID; - bits = (pmode_t) fs_m_in->REQ_MODE; - dev = fs_m_in->REQ_DEV; + uid = fs_m_in->m_vfs_fs_newnode.uid; + gid = fs_m_in->m_vfs_fs_newnode.gid; + bits = fs_m_in->m_vfs_fs_newnode.mode; + dev = fs_m_in->m_vfs_fs_newnode.device; /* Try to allocate the inode */ if( (rip = alloc_inode(dev, bits, uid, gid) ) == NULL) return(err_code); @@ -42,12 +42,12 @@ int fs_newnode(message *fs_m_in, message *fs_m_out) free_inode(rip); } else { /* Fill in the fields of the response message */ - fs_m_out->RES_INODE_NR = rip->i_num; - fs_m_out->RES_MODE = rip->i_mode; - fs_m_out->RES_FILE_SIZE = rip->i_size; - fs_m_out->RES_UID = rip->i_uid; - fs_m_out->RES_GID = rip->i_gid; - fs_m_out->RES_DEV = dev; + fs_m_out->m_fs_vfs_newnode.inode = rip->i_num; + fs_m_out->m_fs_vfs_newnode.mode = rip->i_mode; + fs_m_out->m_fs_vfs_newnode.file_size = rip->i_size; + fs_m_out->m_fs_vfs_newnode.uid = rip->i_uid; + fs_m_out->m_fs_vfs_newnode.gid = rip->i_gid; + fs_m_out->m_fs_vfs_newnode.device = dev; } return(r); diff --git a/servers/vfs/request.c b/servers/vfs/request.c index 7be7b4384..f3f56aa6a 100644 --- a/servers/vfs/request.c +++ b/servers/vfs/request.c @@ -634,21 +634,21 @@ int req_newnode( /* Fill in request message */ m.m_type = REQ_NEWNODE; - m.REQ_MODE = (pmode_t) dmode; - m.REQ_DEV = dev; - m.REQ_UID = (puid_t) uid; - m.REQ_GID = (pgid_t) gid; + m.m_vfs_fs_newnode.mode = dmode; + m.m_vfs_fs_newnode.device = dev; + m.m_vfs_fs_newnode.uid = uid; + m.m_vfs_fs_newnode.gid = gid; /* Send/rec request */ r = fs_sendrec(fs_e, &m); res->fs_e = m.m_source; - res->inode_nr = (ino_t) m.RES_INODE_NR; - res->fmode = (mode_t) m.RES_MODE; - res->fsize = m.RES_FILE_SIZE; - res->dev = m.RES_DEV; - res->uid = (uid_t) m.RES_UID; - res->gid = (gid_t) m.RES_GID; + res->inode_nr = m.m_fs_vfs_newnode.inode; + res->fmode = m.m_fs_vfs_newnode.mode; + res->fsize = m.m_fs_vfs_newnode.file_size; + res->dev = m.m_fs_vfs_newnode.device; + res->uid = m.m_fs_vfs_newnode.uid; + res->gid = m.m_fs_vfs_newnode.gid; return(r); }