Seem to have fixed dirbuf allocation.

Dirbuf allocation was broken, fixed it.
Added more comments on reading directories.

Issues: fs0 ought to check buf address for sys_readdir(). Currently
test0 is passing an area on its stack and fs0 is writing the data to its own
address space (i.e. an area on its own stack.)
This commit is contained in:
Bahadir Balban
2008-04-13 00:23:21 +01:00
parent 367e455506
commit 2efffdfa88
5 changed files with 22 additions and 19 deletions

View File

@@ -277,6 +277,7 @@ int sys_readdir(l4id_t sender, int fd, void *buf, int count)
if (count < dirent_size)
return 0;
printf("%s: Filling in . (curdir)\n", __TASKNAME__);
fill_dirent(buf, v->vnum, nbytes, ".");
nbytes += dirent_size;
buf += dirent_size;
@@ -285,11 +286,13 @@ int sys_readdir(l4id_t sender, int fd, void *buf, int count)
if (count < dirent_size)
return 0;
printf("%s: Filling in .. (pardir)\n", __TASKNAME__);
fill_dirent(buf, d->parent->vnode->vnum, nbytes, "..");
nbytes += dirent_size;
buf += dirent_size;
count -= dirent_size;
printf("%s: Filling in other dir contents\n", __TASKNAME__);
/* Copy fs-specific dir to buf in struct dirent format */
if ((total = v->ops.filldir(buf, v, count)) < 0) {
l4_ipc_return(total);