Mercurial > hg > Members > menikon > CbC_xv6
comparison src/impl/file_impl_inode.cbc @ 198:6e28bd30e8a7
fix
author | menikon <e165723@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 22 Jan 2020 20:28:26 +0900 |
parents | 4cfff673e1f6 |
children | 696c6bdc1074 |
comparison
equal
deleted
inserted
replaced
194:4cfff673e1f6 | 198:6e28bd30e8a7 |
---|---|
30 goto next(...); | 30 goto next(...); |
31 } | 31 } |
32 | 32 |
33 __code closeinode(struct inode* file,int fd, __code next(...)) { | 33 __code closeinode(struct inode* file,int fd, __code next(...)) { |
34 | 34 |
35 goto next(...); | 35 goto file->cbc_inodecolse(file->file, next); |
36 } | 36 } |
37 | |
38 __code cbc_inodeclose(struct inode* inode, struct file* file, __code next(...)){ | |
39 struct file ff; | |
40 acquire(*ftable.loc) | |
41 | |
42 if (f->ref < 1) { | |
43 goto cbc_context->kernel_error->panic("file close"); | |
44 } | |
45 goto inode->cbc_inodeclose2(f,ff,next); | |
46 } | |
47 | |
48 __code cbc_inodeclose2(struct inode* inode, struct file* file, struct file* ff, __code next(...)){ | |
49 if (--f->ref > 0) { | |
50 release(&ftable.lock); | |
51 goto cbc_context->return(); | |
52 } | |
53 goto inode->cbc_inodeclose3(f,ff,next); | |
54 } | |
55 | |
56 __code cbc_inodeclose3(struct inode* inode, struct file* file, struct file* ff, __code next(...)){ | |
57 *ff = *f; | |
58 f->ref = 0; | |
59 f->type = FD_NONE; | |
60 relsease(&ftable.lock); | |
61 struct inode* i = ff.inode; | |
62 | |
63 goto inode->cbc_inodeclose4(i,next); | |
64 } | |
65 | |
66 __code cbc_inodeclose4(struct inode* inode,__code next(...)){ | |
67 | |
68 | |
69 | |
70 } |