summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorrsc <rsc>2006-09-07 14:28:12 +0000
committerrsc <rsc>2006-09-07 14:28:12 +0000
commitbb207a1d42c9a75a64af35de4f12912176ebfc8d (patch)
treeb762f80b034299b64d60d574f6eb23f6c7478068 /file.c
parent52253dce6581ab381091720d3df9f3037ce38f7b (diff)
downloadxv6-labs-bb207a1d42c9a75a64af35de4f12912176ebfc8d.tar.gz
xv6-labs-bb207a1d42c9a75a64af35de4f12912176ebfc8d.tar.bz2
xv6-labs-bb207a1d42c9a75a64af35de4f12912176ebfc8d.zip
comments
Diffstat (limited to 'file.c')
-rw-r--r--file.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/file.c b/file.c
index 4c314ec..95a249b 100644
--- a/file.c
+++ b/file.c
@@ -41,8 +41,7 @@ filealloc(void)
return 0;
}
-// Write to file descriptor;
-// addr is a kernel address, pointing into some process's p->mem.
+// Write to file f. Addr is kernel address.
int
filewrite(struct file *fd, char *addr, int n)
{
@@ -64,7 +63,7 @@ filewrite(struct file *fd, char *addr, int n)
}
}
-// Read from file descriptor.
+// Read from file f. Addr is kernel address.
int
fileread(struct file *fd, char *addr, int n)
{
@@ -85,7 +84,7 @@ fileread(struct file *fd, char *addr, int n)
}
}
-// Close file descriptor.
+// Close file f. (Decrement ref count, close when reaches 0.)
void
fileclose(struct file *fd)
{
@@ -113,7 +112,7 @@ fileclose(struct file *fd)
}
}
-// Get metadata about file descriptor.
+// Get metadata about file f.
int
filestat(struct file *fd, struct stat *st)
{
@@ -126,7 +125,7 @@ filestat(struct file *fd, struct stat *st)
return -1;
}
-// Increment file descriptor reference count.
+// Increment ref count for file f.
void
fileincref(struct file *fd)
{