From: Lionel Sambuc Date: Thu, 1 May 2014 08:05:07 +0000 (+0200) Subject: Message types for VFS stat X-Git-Tag: v3.3.0~335 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/rndc.html?a=commitdiff_plain;h=df7e2766c5fc78bd51b5170b6d93e3fb9018aab0;p=minix.git Message types for VFS stat Change-Id: I1d40ae7c3c32a4f7b80c82bc2fa8b157b20a6837 --- diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 2835ce438..68310235b 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -378,6 +378,15 @@ typedef struct { } mess_vfs_fs_slink; _ASSERT_MSG_SIZE(mess_vfs_fs_slink); +typedef struct { + ino_t inode; + + cp_grant_id_t grant; + + uint8_t data[44]; +} mess_vfs_fs_stat; +_ASSERT_MSG_SIZE(mess_vfs_fs_stat); + typedef struct { ino_t inode; time_t actime; @@ -480,6 +489,7 @@ typedef struct { mess_fs_vfs_readsuper m_fs_vfs_readsuper; mess_vfs_fs_rename m_vfs_fs_rename; mess_vfs_fs_slink m_vfs_fs_slink; + mess_vfs_fs_stat m_vfs_fs_stat; mess_vfs_fs_utime m_vfs_fs_utime; mess_vfs_utimens m_vfs_utimens; mess_vm_vfs_mmap m_vm_vfs_mmap; diff --git a/lib/libpuffs/stadir.c b/lib/libpuffs/stadir.c index 7b41174b6..0189ca017 100644 --- a/lib/libpuffs/stadir.c +++ b/lib/libpuffs/stadir.c @@ -20,7 +20,7 @@ int fs_stat(void) register struct puffs_node *pn; /* target pnode */ struct vattr va; struct stat statbuf; - pmode_t mo; + mode_t mo; int s; PUFFS_MAKECRED(pcr, &global_kcred); @@ -29,7 +29,7 @@ int fs_stat(void) return(EINVAL); } - if ((pn = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.REQ_INODE_NR)) == NULL) { + if ((pn = puffs_pn_nodewalk(global_pu, 0, &fs_m_in.m_vfs_fs_stat.inode)) == NULL) { lpuffs_debug("walk failed...\n"); return(EINVAL); } @@ -67,7 +67,7 @@ int fs_stat(void) statbuf.st_gen = va.va_gen; /* Copy the struct to user space. */ - r = sys_safecopyto(fs_m_in.m_source, (cp_grant_id_t) fs_m_in.REQ_GRANT, + r = sys_safecopyto(fs_m_in.m_source, fs_m_in.m_vfs_fs_stat.grant, (vir_bytes) 0, (vir_bytes) &statbuf, (size_t) sizeof(statbuf)); diff --git a/lib/libsffs/stat.c b/lib/libsffs/stat.c index 2a78860bb..997027873 100644 --- a/lib/libsffs/stat.c +++ b/lib/libsffs/stat.c @@ -48,7 +48,7 @@ int do_stat(void) pino_t ino_nr; int r; - ino_nr = m_in.REQ_INODE_NR; + ino_nr = m_in.m_vfs_fs_stat.inode; /* Don't increase the inode refcount: it's already open anyway */ if ((ino = find_inode(ino_nr)) == NULL) @@ -91,7 +91,7 @@ int do_stat(void) if (HAS_CHILDREN(ino)) stat.st_nlink++; } - return sys_safecopyto(m_in.m_source, m_in.REQ_GRANT, 0, + return sys_safecopyto(m_in.m_source, m_in.m_vfs_fs_stat.grant, 0, (vir_bytes) &stat, sizeof(stat)); } diff --git a/lib/libvtreefs/stadir.c b/lib/libvtreefs/stadir.c index 82c313334..ab9cfe478 100644 --- a/lib/libvtreefs/stadir.c +++ b/lib/libvtreefs/stadir.c @@ -19,7 +19,7 @@ int fs_stat(void) struct inode *node; int r; - if ((node = find_inode(fs_m_in.REQ_INODE_NR)) == NULL) + if ((node = find_inode(fs_m_in.m_vfs_fs_stat.inode)) == NULL) return EINVAL; memset(&statbuf, 0, sizeof(struct stat)); @@ -50,7 +50,7 @@ int fs_stat(void) statbuf.st_ctime = cur_time; /* Copy the struct to user space. */ - return sys_safecopyto(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0, + return sys_safecopyto(fs_m_in.m_source, fs_m_in.m_vfs_fs_stat.grant, 0, (vir_bytes) &statbuf, (phys_bytes) sizeof(statbuf)); } diff --git a/servers/ext2/stadir.c b/servers/ext2/stadir.c index f99d54efb..2db84269a 100644 --- a/servers/ext2/stadir.c +++ b/servers/ext2/stadir.c @@ -67,10 +67,10 @@ int fs_stat() register int r; /* return value */ register struct inode *rip; /* target inode */ - if ((rip = get_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR)) == NULL) + if ((rip = get_inode(fs_dev, fs_m_in.m_vfs_fs_stat.inode)) == NULL) return(EINVAL); - r = stat_inode(rip, fs_m_in.m_source, (cp_grant_id_t) fs_m_in.REQ_GRANT); + r = stat_inode(rip, fs_m_in.m_source, fs_m_in.m_vfs_fs_stat.grant); put_inode(rip); /* release the inode */ return(r); } diff --git a/servers/iso9660fs/stadir.c b/servers/iso9660fs/stadir.c index 2db8eb30b..17f807214 100644 --- a/servers/iso9660fs/stadir.c +++ b/servers/iso9660fs/stadir.c @@ -83,8 +83,8 @@ int fs_stat() struct dir_record *dir; r = EINVAL; - if ((dir = get_dir_record(fs_m_in.REQ_INODE_NR)) != NULL) { - r = stat_dir_record(dir, 0, fs_m_in.m_source, fs_m_in.REQ_GRANT); + if ((dir = get_dir_record(fs_m_in.m_vfs_fs_stat.inode)) != NULL) { + r = stat_dir_record(dir, 0, fs_m_in.m_source, fs_m_in.m_vfs_fs_stat.grant); release_dir_record(dir); } diff --git a/servers/mfs/stadir.c b/servers/mfs/stadir.c index a5da2ea57..0ca88ec26 100644 --- a/servers/mfs/stadir.c +++ b/servers/mfs/stadir.c @@ -127,10 +127,10 @@ int fs_stat() register int r; /* return value */ register struct inode *rip; /* target inode */ - if ((rip = get_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR)) == NULL) + if ((rip = get_inode(fs_dev, fs_m_in.m_vfs_fs_stat.inode)) == NULL) return(EINVAL); - r = stat_inode(rip, fs_m_in.m_source, (cp_grant_id_t) fs_m_in.REQ_GRANT); + r = stat_inode(rip, fs_m_in.m_source, fs_m_in.m_vfs_fs_stat.grant); put_inode(rip); /* release the inode */ return(r); } diff --git a/servers/pfs/stadir.c b/servers/pfs/stadir.c index e3909fec2..f0d27150a 100644 --- a/servers/pfs/stadir.c +++ b/servers/pfs/stadir.c @@ -62,9 +62,9 @@ int fs_stat(message *fs_m_in, message *fs_m_out) register int r; /* return value */ register struct inode *rip; /* target inode */ - if( (rip = find_inode(fs_m_in->REQ_INODE_NR)) == NULL) return(EINVAL); + if( (rip = find_inode(fs_m_in->m_vfs_fs_stat.inode)) == NULL) return(EINVAL); get_inode(rip->i_dev, rip->i_num); /* mark inode in use */ - r = stat_inode(rip, fs_m_in->m_source, (cp_grant_id_t) fs_m_in->REQ_GRANT); + r = stat_inode(rip, fs_m_in->m_source, fs_m_in->m_vfs_fs_stat.grant); put_inode(rip); /* release the inode */ return(r); } diff --git a/servers/vfs/request.c b/servers/vfs/request.c index 234c916bd..8fbbe6479 100644 --- a/servers/vfs/request.c +++ b/servers/vfs/request.c @@ -1092,8 +1092,8 @@ int req_stat_actual(endpoint_t fs_e, ino_t inode_nr, endpoint_t proc_e, /* Fill in request message */ m.m_type = REQ_STAT; - m.REQ_INODE_NR = (pino_t) inode_nr; - m.REQ_GRANT = grant_id; + m.m_vfs_fs_stat.inode = inode_nr; + m.m_vfs_fs_stat.grant = grant_id; /* Send/rec request */ r = fs_sendrec(fs_e, &m);