From: Lionel Sambuc Date: Mon, 28 Apr 2014 17:12:06 +0000 (+0200) Subject: Message types for VFS putnode X-Git-Tag: v3.3.0~337 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch11.html?a=commitdiff_plain;h=6a94be7e63fc9bb9eff3dad252530505675d58f5;p=minix.git Message types for VFS putnode Change-Id: I0802ccaaaa6ee1b4eb96d62b08f9795c790ce39b --- diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 7450ac3f0..5279e16ce 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -292,6 +292,14 @@ typedef struct { } mess_fs_vfs_newnode; _ASSERT_MSG_SIZE(mess_fs_vfs_newnode); +typedef struct { + uint64_t count; + ino_t inode; + + uint8_t data[40]; +} mess_vfs_fs_putnode; +_ASSERT_MSG_SIZE(mess_vfs_fs_putnode); + typedef struct { ino_t inode; @@ -457,6 +465,7 @@ typedef struct { mess_fs_vfs_lookup m_fs_vfs_lookup; mess_vfs_fs_mountpoint m_vfs_fs_mountpoint; mess_vfs_fs_new_driver m_vfs_fs_new_driver; + mess_vfs_fs_putnode m_vfs_fs_putnode; mess_vfs_fs_rdlink m_vfs_fs_rdlink; mess_fs_vfs_rdlink m_fs_vfs_rdlink; mess_vfs_fs_readsuper m_vfs_fs_readsuper; diff --git a/lib/libpuffs/inode.c b/lib/libpuffs/inode.c index 66aabadd3..629ea8dca 100644 --- a/lib/libpuffs/inode.c +++ b/lib/libpuffs/inode.c @@ -37,8 +37,8 @@ int fs_putnode(void) * Release unused pnode. */ struct puffs_node *pn; - int count = fs_m_in.REQ_COUNT; - pino_t inum = fs_m_in.REQ_INODE_NR; + int count = fs_m_in.m_vfs_fs_putnode.count; + ino_t inum = fs_m_in.m_vfs_fs_putnode.inode; if ((pn = puffs_pn_nodewalk(global_pu, 0, &inum)) == NULL) { /* XXX Probably removed from the list, see puffs_pn_remove() */ diff --git a/lib/libsffs/inode.c b/lib/libsffs/inode.c index aed2f09bc..7ef877fac 100644 --- a/lib/libsffs/inode.c +++ b/lib/libsffs/inode.c @@ -280,10 +280,10 @@ int do_putnode(void) struct inode *ino; int count; - if ((ino = find_inode(m_in.REQ_INODE_NR)) == NULL) + if ((ino = find_inode(m_in.m_vfs_fs_putnode.inode)) == NULL) return EINVAL; - count = m_in.REQ_COUNT; + count = m_in.m_vfs_fs_putnode.count; if (count <= 0 || count > ino->i_ref) return EINVAL; diff --git a/lib/libvtreefs/inode.c b/lib/libvtreefs/inode.c index baf835118..002d0d1e2 100644 --- a/lib/libvtreefs/inode.c +++ b/lib/libvtreefs/inode.c @@ -589,11 +589,11 @@ int fs_putnode(void) struct inode *node; /* Get the inode specified by its number. */ - if ((node = find_inode(fs_m_in.REQ_INODE_NR)) == NULL) + if ((node = find_inode(fs_m_in.m_vfs_fs_putnode.inode)) == NULL) return EINVAL; /* Decrease the reference count. */ - node->i_count -= fs_m_in.REQ_COUNT - 1; + node->i_count -= fs_m_in.m_vfs_fs_putnode.count - 1; assert(node->i_count > 0); diff --git a/servers/ext2/inode.c b/servers/ext2/inode.c index 0fdc3f38e..eb7799e1f 100644 --- a/servers/ext2/inode.c +++ b/servers/ext2/inode.c @@ -38,15 +38,15 @@ int fs_putnode(void) struct inode *rip; int count; - rip = find_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR); + rip = find_inode(fs_dev, fs_m_in.m_vfs_fs_putnode.inode); if (!rip) { - printf("%s:%d put_inode: inode #%u dev: %llx not found\n", __FILE__, - __LINE__, (pino_t) fs_m_in.REQ_INODE_NR, fs_dev); + printf("%s:%d put_inode: inode #%llu dev: %llx not found\n", __FILE__, + __LINE__, fs_m_in.m_vfs_fs_putnode.inode, fs_dev); panic("fs_putnode failed"); } - count = fs_m_in.REQ_COUNT; + count = fs_m_in.m_vfs_fs_putnode.count; if (count <= 0) { printf("%s:%d put_inode: bad value for count: %d\n", __FILE__, __LINE__, count); diff --git a/servers/iso9660fs/inode.c b/servers/iso9660fs/inode.c index 03830b7ec..07ba73bf0 100644 --- a/servers/iso9660fs/inode.c +++ b/servers/iso9660fs/inode.c @@ -16,10 +16,10 @@ int fs_putnode() int count; struct dir_record *dir = NULL; - dir = get_dir_record(fs_m_in.REQ_INODE_NR); + dir = get_dir_record(fs_m_in.m_vfs_fs_putnode.inode); release_dir_record(dir); - count = fs_m_in.REQ_COUNT; + count = fs_m_in.m_vfs_fs_putnode.count; if (count <= 0) return(EINVAL); diff --git a/servers/mfs/inode.c b/servers/mfs/inode.c index ce529a1e0..69f6d4b44 100644 --- a/servers/mfs/inode.c +++ b/servers/mfs/inode.c @@ -42,15 +42,15 @@ int fs_putnode(void) struct inode *rip; int count; - rip = find_inode(fs_dev, (pino_t) fs_m_in.REQ_INODE_NR); + rip = find_inode(fs_dev, fs_m_in.m_vfs_fs_putnode.inode); if(!rip) { - printf("%s:%d put_inode: inode #%u dev: %llx not found\n", __FILE__, - __LINE__, (pino_t) fs_m_in.REQ_INODE_NR, fs_dev); + printf("%s:%d put_inode: inode #%llu dev: %llx not found\n", __FILE__, + __LINE__, fs_m_in.m_vfs_fs_putnode.inode, fs_dev); panic("fs_putnode failed"); } - count = fs_m_in.REQ_COUNT; + count = fs_m_in.m_vfs_fs_putnode.count; if (count <= 0) { printf("%s:%d put_inode: bad value for count: %d\n", __FILE__, __LINE__, count); diff --git a/servers/pfs/inode.c b/servers/pfs/inode.c index 6d1b3d2f4..29a2d198f 100644 --- a/servers/pfs/inode.c +++ b/servers/pfs/inode.c @@ -33,17 +33,17 @@ int fs_putnode(message *fs_m_in, message *fs_m_out) struct inode *rip; int count; dev_t dev; - pino_t inum; + ino_t inum; - rip = find_inode( (pino_t) fs_m_in->REQ_INODE_NR); + rip = find_inode(fs_m_in->m_vfs_fs_putnode.inode); if(!rip) { - printf("%s:%d put_inode: inode #%ld dev: %llx not found\n", __FILE__, - __LINE__, fs_m_in->REQ_INODE_NR, fs_m_in->REQ_DEV); + printf("%s:%d put_inode: inode #%ld not found\n", __FILE__, + __LINE__, fs_m_in->m_vfs_fs_putnode.inode); panic("fs_putnode failed"); } - count = fs_m_in->REQ_COUNT; + count = fs_m_in->m_vfs_fs_putnode.count; if (count <= 0) { printf("%s:%d put_inode: bad value for count: %d\n", __FILE__, __LINE__, count); diff --git a/servers/vfs/request.c b/servers/vfs/request.c index 99264760a..25a8d38b9 100644 --- a/servers/vfs/request.c +++ b/servers/vfs/request.c @@ -701,8 +701,8 @@ int count; /* Fill in request message */ m.m_type = REQ_PUTNODE; - m.REQ_INODE_NR = (pino_t) inode_nr; - m.REQ_COUNT = count; + m.m_vfs_fs_putnode.inode = inode_nr; + m.m_vfs_fs_putnode.count = count; /* Send/rec request */ return fs_sendrec(fs_e, &m);