changeset 291:4265c6e825af

fix
author menikon
date Sat, 25 Jan 2020 19:02:35 +0900
parents 696c6bdc1074
children 08cd784ddbc0
files src/impl/file_impl_inode.cbc
diffstat 1 files changed, 7 insertions(+), 37 deletions(-) [+]
line wrap: on
line diff
--- a/src/impl/file_impl_inode.cbc	Sat Jan 25 16:42:09 2020 +0900
+++ b/src/impl/file_impl_inode.cbc	Sat Jan 25 19:02:35 2020 +0900
@@ -16,18 +16,21 @@
     file->n  = 0;
     file->fd  = 0;
     file->stat = C_statinode;
+    file->cbc_stat = C_cbc_statinode;
     file->read = C_readinode;
     file->write = C_writeinode;
     file->close = C_closeinode;
     return file;
 }
 
-__code statinode(struct inode* ip, struct stat* st, __code next(...)) { //:skip
+__code statinode(struct inode* ip, struct stat* st, __code next(int ret, ...)) { //:skip
 
-    goto cbc_statinode(ip, st, next(...));
+    goto cbc_statinode(ip, st, next(ret, ...));
 }
 
-__code cbc_statinode((struct inode* ip, struct stat* st, __code next(...)){
+__code cbc_statinode((struct inode* ip, struct stat* st, __code next(int ret, ...)){
+
+    goto next(...);
 }
 
 __code readinode(struct inode* file, char* addr, __code next(...)) {
@@ -42,39 +45,6 @@
 
 __code closeinode(struct inode* file,int fd, __code next(...)) {
 
-    goto file->cbc_inodecolse(file->file, next);
-}
-
-__code cbc_inodeclose(struct inode* inode, struct file* file, __code next(...)){
-  struct file ff;
-  acquire(*ftable.loc)
-
-  if (f->ref < 1) {
-      goto cbc_context->kernel_error->panic("file close");
-  }
-  goto inode->cbc_inodeclose2(f,ff,next);
+    goto next(...);
 }
 
-__code cbc_inodeclose2(struct inode* inode, struct file* file, struct file* ff, __code next(...)){
-  if (--f->ref > 0) {
-     release(&ftable.lock);
-     goto cbc_context->return();
-  }
-  goto inode->cbc_inodeclose3(f,ff,next);
-}
-
-__code cbc_inodeclose3(struct inode* inode, struct file* file, struct file* ff, __code next(...)){
-  *ff = *f;
-  f->ref = 0;
-  f->type = FD_NONE;
-  relsease(&ftable.lock);
-  struct inode* i = ff.inode;
-
-  goto inode->cbc_inodeclose4(i,next);
-}
-
-__code cbc_inodeclose4(struct inode* inode,__code next(...)){
-
-
-
-}