support read() and write() bigger than one page
This commit is contained in:
parent
cefe223bf5
commit
8baac76050
12 changed files with 95 additions and 62 deletions
|
|
@ -173,7 +173,7 @@ isdirempty(struct inode *dp)
|
|||
struct dirent de;
|
||||
|
||||
for(off=2*sizeof(de); off<dp->size; off+=sizeof(de)){
|
||||
if(readi(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
|
||||
if(readi(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de))
|
||||
panic("isdirempty: readi");
|
||||
if(de.inum != 0)
|
||||
return 0;
|
||||
|
|
@ -217,7 +217,7 @@ sys_unlink(void)
|
|||
}
|
||||
|
||||
memset(&de, 0, sizeof(de));
|
||||
if(writei(dp, (char*)&de, off, sizeof(de)) != sizeof(de))
|
||||
if(writei(dp, 0, (uint64)&de, off, sizeof(de)) != sizeof(de))
|
||||
panic("unlink: writei");
|
||||
if(ip->type == T_DIR){
|
||||
dp->nlink--;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue