Message types for VFS putnode
Change-Id: I0802ccaaaa6ee1b4eb96d62b08f9795c790ce39b
This commit is contained in:
parent
afcde4d208
commit
6a94be7e63
9 changed files with 32 additions and 23 deletions
|
@ -292,6 +292,14 @@ typedef struct {
|
||||||
} mess_fs_vfs_newnode;
|
} mess_fs_vfs_newnode;
|
||||||
_ASSERT_MSG_SIZE(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 {
|
typedef struct {
|
||||||
ino_t inode;
|
ino_t inode;
|
||||||
|
|
||||||
|
@ -457,6 +465,7 @@ typedef struct {
|
||||||
mess_fs_vfs_lookup m_fs_vfs_lookup;
|
mess_fs_vfs_lookup m_fs_vfs_lookup;
|
||||||
mess_vfs_fs_mountpoint m_vfs_fs_mountpoint;
|
mess_vfs_fs_mountpoint m_vfs_fs_mountpoint;
|
||||||
mess_vfs_fs_new_driver m_vfs_fs_new_driver;
|
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_vfs_fs_rdlink m_vfs_fs_rdlink;
|
||||||
mess_fs_vfs_rdlink m_fs_vfs_rdlink;
|
mess_fs_vfs_rdlink m_fs_vfs_rdlink;
|
||||||
mess_vfs_fs_readsuper m_vfs_fs_readsuper;
|
mess_vfs_fs_readsuper m_vfs_fs_readsuper;
|
||||||
|
|
|
@ -37,8 +37,8 @@ int fs_putnode(void)
|
||||||
* Release unused pnode.
|
* Release unused pnode.
|
||||||
*/
|
*/
|
||||||
struct puffs_node *pn;
|
struct puffs_node *pn;
|
||||||
int count = fs_m_in.REQ_COUNT;
|
int count = fs_m_in.m_vfs_fs_putnode.count;
|
||||||
pino_t inum = fs_m_in.REQ_INODE_NR;
|
ino_t inum = fs_m_in.m_vfs_fs_putnode.inode;
|
||||||
|
|
||||||
if ((pn = puffs_pn_nodewalk(global_pu, 0, &inum)) == NULL) {
|
if ((pn = puffs_pn_nodewalk(global_pu, 0, &inum)) == NULL) {
|
||||||
/* XXX Probably removed from the list, see puffs_pn_remove() */
|
/* XXX Probably removed from the list, see puffs_pn_remove() */
|
||||||
|
|
|
@ -280,10 +280,10 @@ int do_putnode(void)
|
||||||
struct inode *ino;
|
struct inode *ino;
|
||||||
int count;
|
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;
|
return EINVAL;
|
||||||
|
|
||||||
count = m_in.REQ_COUNT;
|
count = m_in.m_vfs_fs_putnode.count;
|
||||||
|
|
||||||
if (count <= 0 || count > ino->i_ref) return EINVAL;
|
if (count <= 0 || count > ino->i_ref) return EINVAL;
|
||||||
|
|
||||||
|
|
|
@ -589,11 +589,11 @@ int fs_putnode(void)
|
||||||
struct inode *node;
|
struct inode *node;
|
||||||
|
|
||||||
/* Get the inode specified by its number. */
|
/* 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;
|
return EINVAL;
|
||||||
|
|
||||||
/* Decrease the reference count. */
|
/* 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);
|
assert(node->i_count > 0);
|
||||||
|
|
||||||
|
|
|
@ -38,15 +38,15 @@ int fs_putnode(void)
|
||||||
struct inode *rip;
|
struct inode *rip;
|
||||||
int count;
|
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) {
|
if (!rip) {
|
||||||
printf("%s:%d put_inode: inode #%u dev: %llx not found\n", __FILE__,
|
printf("%s:%d put_inode: inode #%llu dev: %llx not found\n", __FILE__,
|
||||||
__LINE__, (pino_t) fs_m_in.REQ_INODE_NR, fs_dev);
|
__LINE__, fs_m_in.m_vfs_fs_putnode.inode, fs_dev);
|
||||||
panic("fs_putnode failed");
|
panic("fs_putnode failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
count = fs_m_in.REQ_COUNT;
|
count = fs_m_in.m_vfs_fs_putnode.count;
|
||||||
if (count <= 0) {
|
if (count <= 0) {
|
||||||
printf("%s:%d put_inode: bad value for count: %d\n", __FILE__,
|
printf("%s:%d put_inode: bad value for count: %d\n", __FILE__,
|
||||||
__LINE__, count);
|
__LINE__, count);
|
||||||
|
|
|
@ -16,10 +16,10 @@ int fs_putnode()
|
||||||
int count;
|
int count;
|
||||||
struct dir_record *dir = NULL;
|
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);
|
release_dir_record(dir);
|
||||||
|
|
||||||
count = fs_m_in.REQ_COUNT;
|
count = fs_m_in.m_vfs_fs_putnode.count;
|
||||||
|
|
||||||
if (count <= 0) return(EINVAL);
|
if (count <= 0) return(EINVAL);
|
||||||
|
|
||||||
|
|
|
@ -42,15 +42,15 @@ int fs_putnode(void)
|
||||||
struct inode *rip;
|
struct inode *rip;
|
||||||
int count;
|
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) {
|
if(!rip) {
|
||||||
printf("%s:%d put_inode: inode #%u dev: %llx not found\n", __FILE__,
|
printf("%s:%d put_inode: inode #%llu dev: %llx not found\n", __FILE__,
|
||||||
__LINE__, (pino_t) fs_m_in.REQ_INODE_NR, fs_dev);
|
__LINE__, fs_m_in.m_vfs_fs_putnode.inode, fs_dev);
|
||||||
panic("fs_putnode failed");
|
panic("fs_putnode failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
count = fs_m_in.REQ_COUNT;
|
count = fs_m_in.m_vfs_fs_putnode.count;
|
||||||
if (count <= 0) {
|
if (count <= 0) {
|
||||||
printf("%s:%d put_inode: bad value for count: %d\n", __FILE__,
|
printf("%s:%d put_inode: bad value for count: %d\n", __FILE__,
|
||||||
__LINE__, count);
|
__LINE__, count);
|
||||||
|
|
|
@ -33,17 +33,17 @@ int fs_putnode(message *fs_m_in, message *fs_m_out)
|
||||||
struct inode *rip;
|
struct inode *rip;
|
||||||
int count;
|
int count;
|
||||||
dev_t dev;
|
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) {
|
if(!rip) {
|
||||||
printf("%s:%d put_inode: inode #%ld dev: %llx not found\n", __FILE__,
|
printf("%s:%d put_inode: inode #%ld not found\n", __FILE__,
|
||||||
__LINE__, fs_m_in->REQ_INODE_NR, fs_m_in->REQ_DEV);
|
__LINE__, fs_m_in->m_vfs_fs_putnode.inode);
|
||||||
panic("fs_putnode failed");
|
panic("fs_putnode failed");
|
||||||
}
|
}
|
||||||
|
|
||||||
count = fs_m_in->REQ_COUNT;
|
count = fs_m_in->m_vfs_fs_putnode.count;
|
||||||
if (count <= 0) {
|
if (count <= 0) {
|
||||||
printf("%s:%d put_inode: bad value for count: %d\n", __FILE__,
|
printf("%s:%d put_inode: bad value for count: %d\n", __FILE__,
|
||||||
__LINE__, count);
|
__LINE__, count);
|
||||||
|
|
|
@ -701,8 +701,8 @@ int count;
|
||||||
|
|
||||||
/* Fill in request message */
|
/* Fill in request message */
|
||||||
m.m_type = REQ_PUTNODE;
|
m.m_type = REQ_PUTNODE;
|
||||||
m.REQ_INODE_NR = (pino_t) inode_nr;
|
m.m_vfs_fs_putnode.inode = inode_nr;
|
||||||
m.REQ_COUNT = count;
|
m.m_vfs_fs_putnode.count = count;
|
||||||
|
|
||||||
/* Send/rec request */
|
/* Send/rec request */
|
||||||
return fs_sendrec(fs_e, &m);
|
return fs_sendrec(fs_e, &m);
|
||||||
|
|
Loading…
Reference in a new issue