- Oct 10, 2013
-
-
Avi Kivity authored
head=254 is legal, and the check also assumes that heads=255, which is not a given. Remove the check and trust the LBA. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Partitions table entries with cyl=0 or head=0 are legal, avoid false positives. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
open()'s prototype is traditionally open(const char*, int, ...) since the third mode_t parameter is optional, and only needed if O_CREAT is specified. Change the definition to conform. This allows the LFS64() macro to be used to define open64() with a similar prototype. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
Make vget() accept a const char*, and adjust various other functions that it calls in the same way. This makes it easier to convert vfs_mount.c to C++. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
We store the flags in a different format than fcntl() expects; perform the needed conversions. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
Avi Kivity authored
The vfs converts the read/write flags from 0/1/2 (read-only/write-only/rw) to bit fields which are more easily testable. But in doing so it corrupts the other flags. Fix FFLAGS and OFLAGS to preserve those other flags. The test for a file that is not readable or writable is dropped, since it is impossible to fail. Signed-off-by:
Avi Kivity <avi@cloudius-systems.com>
-
- Sep 27, 2013
-
-
Or Cohen authored
task_conv was wrongly converting "/.." and produced a path with unexpected characters after / Consequently, repeated calls (Java) to 'new File("/..").exists()' returned ambigous results, not to mention other properties like isDirectory. This confused the shell's completion mechanism (and me). In more detail, in this (/..) situation 'len' was more than 2 (in line 105) which caused 'tgt' to be pointing before the begining of 'full', from that point whatever stopped the backward search for '/' (lines 109-112) was unexpected. I guess this might occur with other combinations. This sets 'len' to be 1 when starting an absolute path conversion, to match the behavior where relative path conversion sets 'len = strlen(cwd)'. Signed-off-by:
Or Cohen <orc@fewbytes.com>
-
- Sep 26, 2013
-
-
Pekka Enberg authored
We can safely use the same function exit points for both successful and error cases. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Call the dentry that refers to the newpath parent directory "newdirdp" to make the code more explicit. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Filesystems are expected to wire up ->vop_link so it can never be NULL. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Raphael S. Carvalho authored
Make vn_stat() return inode number and link count in st_ino and st_nlink, respectively. Signed-off-by:
Raphael S. Carvalho <raphael.scarv@gmail.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Raphael S. Carvalho authored
This patch adds the link() system call. The system call uses the filesystem specific VOP_LINK vnode operation to do the actual work. ZFS is currently the only available file system that supports hard links and the other filesystems return EPERM. Signed-off-by:
Raphael S. Carvalho <raphael.scarv@gmail.com> Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Raphael S. Carvalho authored
Wire up the VOP_LINK vnode operation for ramfs in preparation for sys_link(). Signed-off-by:
Raphael S. Carvalho <raphael.scarv@gmail.com> [ penberg: split to separate commit ] Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Raphael S. Carvalho authored
Wire up the VOP_LINK vnode operation for devfs in preparation for sys_link(). Signed-off-by:
Raphael S. Carvalho <raphael.scarv@gmail.com> [ penberg: split to separate commit ] Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
Use ->rn_namelen as the destination buffer size for strlcpy(). Spotted by Coverity. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
Pekka Enberg authored
The ramfs_remove_node() will free vp->v_data so we cannot look it up in ramfs_remove(). Spotted by Coverity. Signed-off-by:
Pekka Enberg <penberg@cloudius-systems.com>
-
- Sep 15, 2013
-
-
Nadav Har'El authored
Added Cloudius copyright statement to source files in fs/ which are our own code (and not from Prex or FreeBSD). Also added our copyright statement in addition to the original one when I thought we made non-trivial changes to the original.
-
- Sep 05, 2013
-
-
Glauber Costa authored
-
Glauber Costa authored
This code, living in device.c for maximum generality, will read the partition table from any disk that calls it. Ideally, each new device would have its own private data. But that would mean having to callback to the driver to set each of the partitions up. Therefore, I found it easier to convention that all partitions in the same drive have the same private data. This makes some sense if we consider that the hypervisors are usually agnostic about partitions, and all of the addressing and communications go through a single entry point, which is the disk.
-
Glauber Costa authored
To support multiple partitions to a disk, I found it easier to add a post-processing offset calculation to the bio just before calling the strategy. The reason is, we have many (really many) entry points for bio preparation (pre-strategy) and only two entry points for the strategy itself (the drivers). Since multiplex_strategy is a good thing to be used even for virtio (although I am not converting it now), since it allows for arbitrary sized requests, we could very well reduce it to just one. At this moment, the offset is always 0 and everything works as before.
-
Glauber Costa authored
-
- Aug 28, 2013
-
-
Glauber Costa authored
I ended up forgetting to remove some kprintfs from device.c that were inserted during Xen's blkfront development
-
- Aug 26, 2013
-
-
Nadav Har'El authored
Do to __xstat* what commit 018c672e did to __fxstat* - they had the same problem.
-
Nadav Har'El authored
In Linux, _STAT_VER is 1 on 64-bit (and 3 on 32-bit), but glibc never verifies the argument to __fxstat64. JNR - a library used by JRuby - wrongly (I believe) passes ver==0 to __fxstat64 (see jnr-posix/..../LinuxPosix.java). On Linux this wrong argument is ignored but in our implementation, fails the check. So this patch removes this check from our code as well, to let JNR and therefore JRuby which uses it, use stat without failing.
-
- Aug 20, 2013
-
-
Avi Kivity authored
Currently the umask is ignore (it's pointless since we have no users). Needed by JRuby.
-
- Aug 19, 2013
-
-
Avi Kivity authored
If dup3() is called with oldfd pointing to an existing file, it will close the file for us. 37988879 converted fd operations to RCU, which caused this close to be deferred until after the RCU grace period (43df74e7 fixed this, but only for close(), not for dup3). The asynchronous operation of dup3() should be fine, except that it triggers a bug in sys_rename(): if the reference count of the vnode for either the source or destination is elevated, rename fails with EBUSY. This is due to the coupling between vnodes and pathnames and can be fixed with the move to separate dentries. The whole sequence looks like 0xffffc000de90c010 3 1376912988.418660 vfs_lseek 95 0x0 0 0xffffc000de90c010 3 1376912988.418661 vfs_lseek_ret 0x0 0xffffc000de90c010 3 1376912988.418689 vfs_dup3 93 95 0x0 0xffffc000de90c010 3 1376912988.418696 vfs_dup3_ret 95 0xffffc000de90c010 3 1376912988.418711 vfs_close 95 0xffffc000de90c010 3 1376912988.418711 vfs_close_ret ... 0xffffc000de90c010 3 1376912988.420573 vfs_close 95 0xffffc000de90c010 3 1376912988.420580 vfs_close_ret 0xffffc000de90c010 3 1376912988.420738 vfs_rename "/usr/var/lib/cassandra/data/system/local/system-local-tmp-ic-1-Index.db" "/usr/var/lib/cassandra/data/system/l ocal/system-local-ic-1-Index.db" 0xffffc000de90c010 3 1376912988.422302 vfs_pwritev_ret 0x56 0xffffc000de90c010 3 1376912988.422302 vfs_rename_err 16 fd 95 (as it was before dup3) is still open at the time of the rename. Fix by not deferring the fdrop() in fdset(); 43df74e7 already made fdrop() safe to use directly. Fixes failures with Cassandra.
-
Avi Kivity authored
-
- Aug 16, 2013
-
-
Christoph Hellwig authored
v_path will go away once the vnode cache uses numeric indices for hardlink support.
-
Christoph Hellwig authored
We'll need this for any pathname related actions.
-
Christoph Hellwig authored
Create a new dentry structure for pathname components, following the Linux VFS model. The vnodes are left-as is for now but are always fronted by dentries for pathname lookups. In a second step they will be moved to use non-pathname indices. [penberg: fix open(O_CREAT|O_EXCL) breakage ]
-
Christoph Hellwig authored
-
Christoph Hellwig authored
We'll pass the file to the open method soon, so make sure it's fully constructed.
-
Christoph Hellwig authored
These aren't used in the build and will bitrot badly once changing the VFS significantly.
-
- Aug 13, 2013
-
-
Glauber Costa authored
This is used by subr_disk during bio flush operation
-
Glauber Costa authored
-
Glauber Costa authored
There are many other bio fields and functions that blkfront uses that are not provided by our simplified bio. I am adding them here. One of the things we need is a type definition of daddr_t. This already exists in fatfs.h, but it makes more sense to live in the lower level code. So instead of including fatfs in bio.h, I am including bio.h in fatfs and moving the daddr_t definition here.
-
Glauber Costa authored
Some block devices, such as the Xen blkfront, will have a maximum per-request size that needs to be obeyed. In order for us to do it, we'll need to be aware of this requirement in upper layers. So set up the device with it. We initialize the default structure to make sure only interested parties need to set this up.
-
Glauber Costa authored
For xen, I would like to use an already existing device instead of creating one. I still need to register it, though. I am here factoring out device_create in a allocation and a registering part so I can use the later by itself.
-
- Aug 12, 2013
-
-
Avi Kivity authored
Currently, we perform the final fdrop() in an rcu callback, which means it can have considerable latency. This in turn places restrictions on further optimizations we can do to rcu, as we need prompt close() execution. Relax this by performing the fdrop() immediately, and only deferring the final free(). To do this, we harden fget() so it now expects files with positive refcounts, and make sure that after the final fdrop() refcounts are either zero or negative. This also makes close() take effect immediately, which fixes tst-pipe.so.
-
- Aug 11, 2013
-
-
Avi Kivity authored
This patch changes fget() to no longer take gfdt_lock, using rcu instead.
-