summaryrefslogtreecommitdiff
path: root/fs.c
diff options
context:
space:
mode:
authorrtm <rtm>2006-08-11 13:55:18 +0000
committerrtm <rtm>2006-08-11 13:55:18 +0000
commit17a856577f9db766b8ef7099d0575d378dff5dd1 (patch)
tree53d0c687d9c9bf83d097a2171c48d04a569c5a61 /fs.c
parent5be0039ce9e22f140a29e167526c64c723c5be3c (diff)
downloadxv6-labs-17a856577f9db766b8ef7099d0575d378dff5dd1.tar.gz
xv6-labs-17a856577f9db766b8ef7099d0575d378dff5dd1.tar.bz2
xv6-labs-17a856577f9db766b8ef7099d0575d378dff5dd1.zip
init creates console, opens 0/1/2, runs sh
sh accepts 0-argument commands (like userfs) reads from console
Diffstat (limited to 'fs.c')
-rw-r--r--fs.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/fs.c b/fs.c
index b298d7f..cbf417e 100644
--- a/fs.c
+++ b/fs.c
@@ -101,6 +101,7 @@ iget(uint dev, uint inum)
goto loop;
}
ip->count++;
+ ip->busy = 1;
release(&inode_table_lock);
return ip;
}
@@ -269,16 +270,15 @@ bmap(struct inode *ip, uint bn)
#define min(a, b) ((a) < (b) ? (a) : (b))
int
-readi(struct inode *ip, void *xdst, uint off, uint n)
+readi(struct inode *ip, char *dst, uint off, uint n)
{
- char *dst = (char *) xdst;
uint target = n, n1;
struct buf *bp;
if (ip->type == T_DEV) {
if (ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].d_read)
return -1;
- return devsw[ip->major].d_read (ip->minor, xdst, n);
+ return devsw[ip->major].d_read (ip->minor, dst, n);
}
while(n > 0 && off < ip->size){
@@ -298,7 +298,7 @@ readi(struct inode *ip, void *xdst, uint off, uint n)
#define MIN(a, b) ((a < b) ? a : b)
int
-writei(struct inode *ip, void *addr, uint off, uint n)
+writei(struct inode *ip, char *addr, uint off, uint n)
{
if (ip->type == T_DEV) {
if (ip->major < 0 || ip->major >= NDEV || !devsw[ip->major].d_write)
@@ -404,7 +404,8 @@ mknod(struct inode *dp, char *cp, short type, short major, short minor)
int i;
struct buf *bp = 0;
- cprintf("mknod: %s %d %d %d\n", cp, type, major, minor);
+ cprintf("mknod: dir %d %s %d %d %d\n",
+ dp->inum, cp, type, major, minor);
ip = ialloc(dp->dev, type);
if (ip == 0) return 0;