Message types for VFS putnode

Change-Id: I0802ccaaaa6ee1b4eb96d62b08f9795c790ce39b
This commit is contained in:
Lionel Sambuc 2014-04-28 19:12:06 +02:00
parent afcde4d208
commit 6a94be7e63
9 changed files with 32 additions and 23 deletions

View file

@ -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;

View file

@ -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() */

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);