Removed various printfs from fs0 path lookup etc.

This commit is contained in:
Bahadir Balban
2008-09-16 17:41:47 +03:00
parent 510852b8b8
commit 270cead377
4 changed files with 27 additions and 21 deletions

View File

@@ -134,7 +134,7 @@ struct pathdata *pathdata_parse(const char *pathname,
/* Next component */
str = splitpath(&pathbuf, VFS_CHAR_SEP);
}
pathdata_print(pdata);
// pathdata_print(pdata);
return pdata;
}

View File

@@ -35,7 +35,7 @@ int pager_sys_open(l4id_t sender, l4id_t opener, int fd)
struct tcb *task;
struct vnode *v;
printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
// printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
/* Check if such task exists */
if (!(task = find_task(opener))) {
@@ -503,7 +503,8 @@ int sys_readdir(l4id_t sender, int fd, void *buf, int count)
struct dentry *d;
struct tcb *t;
printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
// printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
/* Get the task */
BUG_ON(!(t = find_task(sender)));

View File

@@ -55,7 +55,7 @@ int vfs_read(unsigned long vnum, unsigned long file_offset,
{
int err;
printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
// printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
l4_save_ipcregs();
@@ -91,7 +91,7 @@ int vfs_open(l4id_t opener, int fd, unsigned long *vnum, unsigned long *length)
{
int err;
printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
// printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
l4_save_ipcregs();
@@ -253,7 +253,7 @@ int vfs_write(unsigned long vnum, unsigned long file_offset,
{
int err;
printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
// printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
l4_save_ipcregs();
write_mr(L4SYS_ARG0, vnum);
@@ -309,7 +309,7 @@ int vfs_update_file_stats(struct vm_file *f)
{
int err;
printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
// printf("%s/%s\n", __TASKNAME__, __FUNCTION__);
l4_save_ipcregs();
write_mr(L4SYS_ARG0, vm_file_to_vnum(f));

View File

@@ -6,6 +6,7 @@
#include <fcntl.h>
#include <string.h>
#include <tests.h>
#include <l4lib/arch/syslib.h>
int fileio2(void)
{
@@ -14,6 +15,7 @@ int fileio2(void)
int err;
char buf[128];
off_t offset;
int tid = self_tid();
char *str = "I WROTE TO THIS FILE\n";
@@ -21,41 +23,42 @@ int fileio2(void)
perror("OPEN");
return -1;
}
printf("Created newfile2.txt\n");
printf("%d: Created newfile2.txt\n", tid);
printf("%s: write.\n", __TASKNAME__);
printf("%d: write.\n", tid);
if ((int)(cnt = write(fd, str, strlen(str))) < 0) {
perror("WRITE");
return -1;
}
printf("%s: close.\n", __TASKNAME__);
printf("%d: close.\n", tid);
if ((err = close(fd)) < 0) {
printf("Close failed.\n");
perror("CLOSE");
return -1;
}
printf("%s: re-open.\n", __TASKNAME__);
printf("%d: re-open.\n", tid);
if ((fd = open("/home/bahadir/newfile2.txt", O_RDWR, S_IRWXU)) < 0) {
perror("OPEN");
return -1;
}
printf("%s: lseek.\n", __TASKNAME__);
printf("%d: lseek.\n", tid);
if ((int)(offset = lseek(fd, 0, SEEK_SET)) < 0) {
perror("LSEEK");
return -1;
}
printf("%s: read.\n", __TASKNAME__);
printf("%d: read.\n", tid);
if ((int)(cnt = read(fd, buf, strlen(str))) < 0) {
perror("READ");
return -1;
}
printf("Read: %d bytes from file.\n", cnt);
printf("%d: Read: %d bytes from file.\n", tid, cnt);
if (cnt) {
printf("Read string: %s\n", buf);
printf("%d: Read string: %s\n", tid, buf);
}
printf("%d: close.\n", tid);
if ((err = close(fd)) < 0) {
perror("CLOSE");
return -1;
@@ -71,6 +74,7 @@ int fileio(void)
int err;
char buf[128];
off_t offset;
int tid = self_tid();
char *str = "I WROTE TO THIS FILE\n";
@@ -78,30 +82,31 @@ int fileio(void)
perror("OPEN");
return -1;
}
printf("Created newfile.txt\n");
printf("%d: Created newfile.txt\n", tid);
printf("%s: write.\n", __TASKNAME__);
printf("%d: write.\n", tid);
if ((int)(cnt = write(fd, str, strlen(str))) < 0) {
perror("WRITE");
return -1;
}
printf("%s: lseek.\n", __TASKNAME__);
printf("%d: lseek.\n", tid);
if ((int)(offset = lseek(fd, 0, SEEK_SET)) < 0) {
perror("LSEEK");
return -1;
}
printf("%s: read.\n", __TASKNAME__);
printf("%d: read.\n", tid);
if ((int)(cnt = read(fd, buf, strlen(str))) < 0) {
perror("READ");
return -1;
}
printf("Read: %d bytes from file.\n", cnt);
printf("%d: Read: %d bytes from file.\n", tid, cnt);
if (cnt) {
printf("Read string: %s\n", buf);
printf("%d: Read string: %s\n", tid, buf);
}
printf("%d: close.\n", tid);
if ((err = close(fd)) < 0) {
perror("CLOSE");
return -1;