- Jul 15, 2013
-
-
Christoph Hellwig authored
-
- Jul 08, 2013
-
-
Nadav Har'El authored
We can't include osv/poll.h from osv/file.h. It's not needed there, and causes a mess now that I added a use of BSD's "struct mtx" to poll.h (because it turns out we have code using <osv/file.h> and using the name "mtx" for something else). After removing the unneeded include of <osv/poll.h> from osv/file.h, we need to add include <sys/poll.h> to a few additional source files (note include of sys/poll.h, not osv/poll.h).
-
- Jul 02, 2013
-
-
Christoph Hellwig authored
-
Christoph Hellwig authored
readdir_r doesn't want errno set at all, and readdir does by itself already.
-
- Jun 26, 2013
-
-
Christoph Hellwig authored
-
Christoph Hellwig authored
-
- Jun 19, 2013
-
-
Nadav Har'El authored
lseek() crashes when used on pipes, sockets, and now also fd 0, 1 or 2 (the console), because they don't have an underlying vnode. No reason to assert() in this case, should just return ESPIPE (like Linux does for pipes, sockets and ttys). Similarly, fsync, readdir and friends, fchdir and fstatfs shouldn't crash if given a fd without a vnode, and rather should return the expected error.
-
Nadav Har'El authored
We had a bug where a read() on the console (fd 0) would block writes to the console (fd 1 or 2). This was most noticable when background threads in the CLI tried to write output, and were blocked until the next keypress because the blocking read() would lock the writes out. The bug happens because we opened the console using open("/dev/console") and dup()'ed the resulting fd, but this results, in the current code, in every read and write to these file descriptors to pass through vfs_read()/ vfs_write(), which lock a single vnode lock for all three file descriptors - leading to write on fd 1 blocking while read is ongoing on fd 0. This patch doesn't fix this vnode lock issue, which remains - and should be fixed when the devfs or vfs layers are rewritten. Instead, this patch adds a *second API* for opening a console which doesn't go through the vnode or devfs layers: A new console::open() function returns a file descriptor which implements the correct file operations, and is not associated with any vnode. The new implementation works well with write() while read() is ongoing. Note that poll() support was missing from the old implementation (it seems it can't be done with the vnode abstraction?) and is still missing in the new implementation, although now shouldn't be hard to add (need to implement the poll fileops, and to use poll_wake() in the line-discipline function console_poll).
-
Nadav Har'El authored
Sorry, missing unsupported_poll broke compilation after the previous patch
-
- Jun 18, 2013
-
-
Avi Kivity authored
Eclipse recognizes .mk as a makefile, make it easier for new users to use eclipse.
-
Christoph Hellwig authored
-
- Jun 12, 2013
-
-
Glauber Costa authored
We could benefit from the console being ready a bit earlier. The only dependency that I see to it are the interrupts that need to be working. So as soon as we initialize the ioapic, we should be able to initialize the console. This is not the end of story: we still need an even earlier console to debug the driver initialization functions, and I was inclined to just leave console_init where it is, for now. But additionally, I felt that loader is really a more appropriate place for that than vfs_init... So I propose we switch. In the mean time, it might help debug things that happen between ioapic init and the old vfs_init (mem initialization, smp bring up, etc) Signed-off-by:
Glauber Costa <glommer@cloudius-systems.com>
-
- Jun 05, 2013
-
-
Avi Kivity authored
In order to optimize the fast path of tracepoints, we need to patch the call sites to skip calling the slow path code completely. In turn, that requires that each call site be unique -- a separate function. In the current implementations, tracepoints with the same signature map to the same type. It would have been great to use the name as a discriminant (tracepoint<"sched_queue", thread*> trace_sched_queue(...);), but C++ does not support string literals as template arguments. We could do const char* trace_sched_queue_name = "sched_queue"; tracepoint<trace_sched_queue_name, thread*> trace_sched_queue(...); but that doubles the code for declaring a tracepoint. Add a unique ID instead (and code to verify it is unique).
-
- May 31, 2013
-
-
Guy Zana authored
-
- May 30, 2013
-
-
Nadav Har'El authored
Previous commit broke the build, because I forgot to commit a file.
-
Nadav Har'El authored
Previously, we re-implemented "unsupported" file operations (e.g., chmod for a pipe on which fchmod makes no sense) several times - there was an implementation only for chmod in kern_descrip.c, used in sys_socket.c, and af_local.cc had its own. As we add more file descriptor type (e.g., create_epoll()) we'll have even more copies of these silly functions, so let's do it once in fs/unsupported.c - with the fs/unsupported.h header file. This also gives us a central place to document (and argue) whether an unimplemented ioctl() should return ENOTTY or EBADF (I think the former).
-
- May 24, 2013
-
-
Christoph Hellwig authored
-
Christoph Hellwig authored
-
Christoph Hellwig authored
-
Christoph Hellwig authored
-
Christoph Hellwig authored
-
Christoph Hellwig authored
-
Christoph Hellwig authored
-
Christoph Hellwig authored
-
- May 23, 2013
-
-
Nadav Har'El authored
Avi recently added extern "C" to pwrite64 (after the header change apparently removed this declaration from the header file). Also do this to pread64 - otherwise the "derby" benchmark (from SPECjvm2008) cannot run.
-
- May 22, 2013
-
-
Avi Kivity authored
As part of the include change fallout, we no longer have a declaration for pwrite64(), so need to mark it as extern "C".
-
- May 18, 2013
-
-
Avi Kivity authored
<sys/stat.h> is needed by something, add it.
-
Avi Kivity authored
musl only provides one location.
-
Avi Kivity authored
These aren't defined by musl, so we need to make sure the compiler sees them as C functions.
-
Avi Kivity authored
musl doesn't define it, provide local defines instead.
-
- May 16, 2013
-
-
Nadav Har'El authored
Two SPECjvm2008 benchmarks (compiler.compiler and compiler.sunflow) hang (and rarely crash) when the filesystem is accessed concurrently from multiple threads. The synthetic test tst-vfs.c, committed earlier, demonstrates the same bug with a trivial test where 10 threads concurrently call the stat() system call on the same file. This patch fixes this bug. In the existing VFS code, a vnode's reference count is protected not by the node's own mutex, but rather by the global vnode lock. In one case, the reference count was modified (and worse, non-atomically) from outside the lock. Taking the lock a bit earlier fixed both the benchmarks and the synthetic test.
-
- May 12, 2013
-
-
Nadav Har'El authored
-
Nadav Har'El authored
more refined implementation as a TODO. Also alias pwrite64 and pread64 to pwrite and pread, respectively. These functions are used in the SPECjvm2008 "derby" benchmark, which fails without them.
-
- May 07, 2013
-
-
Avi Kivity authored
The fdesc keeps a file descriptor safe from leaks, automatically closing it unless the release() method is called (usually when the user is ready to commit state).
-
Avi Kivity authored
This falloc_noinstall() works like the C version, except it either returns a fileref (which automatically maintains reference counts) or throws an exception (which means error handling can be consolidated).
-
- May 02, 2013
-
-
Avi Kivity authored
-
Avi Kivity authored
When a file incorrectly is used as a directory ("/bin/sh/foo"), namei() detects this and fails, but returns 0 as the error code. Later on open() uses an uninitialized vnode and segaults. Fix by returning ENOENT. Fixes fontconfig segfault when it randomly tries to open files as Mac fonts with resource/data forks.
-
Avi Kivity authored
-
Avi Kivity authored
We have a class file, and a wrapping struct file, and they conflict. Rename 'class file'. Long term it should disappear.
-
Avi Kivity authored
This allows inserting tracepoints.
-