Change dev read/write functions
to take inode* instead of minor number. Unlock console inode during console_read and console_write. Otherwise background processes cannot write to console while the shell is reading it waiting for input.
This commit is contained in:
parent
e3f271e880
commit
d844f0f9d9
3 changed files with 12 additions and 7 deletions
4
fs.c
4
fs.c
|
@ -411,7 +411,7 @@ readi(struct inode *ip, char *dst, uint off, uint n)
|
|||
if(ip->type == T_DEV) {
|
||||
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].read)
|
||||
return -1;
|
||||
return devsw[ip->major].read(ip->minor, dst, n);
|
||||
return devsw[ip->major].read(ip, dst, n);
|
||||
}
|
||||
|
||||
if(off > ip->size || off + n < off)
|
||||
|
@ -439,7 +439,7 @@ writei(struct inode *ip, char *src, uint off, uint n)
|
|||
if(ip->type == T_DEV) {
|
||||
if(ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].write)
|
||||
return -1;
|
||||
return devsw[ip->major].write(ip->minor, src, n);
|
||||
return devsw[ip->major].write(ip, src, n);
|
||||
}
|
||||
|
||||
if(off + n < off)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue