Commit Graph

66 Commits

Author SHA1 Message Date
Axel Dörfler 9a63d90397 Added kernel private VFS functions vfs_entry_ref_to_vnode() and vfs_vnode_to_node_ref().
Minor cleanup of vfs.h.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14314 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 09:26:27 +00:00
Axel Dörfler 681779f1c8 Our close-on-exec flag handling was broken: it's supposed to be specified per slot, not
per file descriptor (a descriptor can be shared among several slots). There is now a
second table in the io_context structure that contains that information in a bitmap.
There are now two new (private) functions to control the close-on-exec flag, fd_close_on_exec(),
and fd_set_close_on_exec().
F_DUPFD, dup(), and dup2() are supposed to clear the close-on-exec flag on the duplicated
slot - this fixes bug #57 (no output after a redirect of a shell builtin).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14313 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-10-06 09:02:59 +00:00
Axel Dörfler 7964c56d67 Added vfs_get_cwd() call to get the mount_id and vnode_id of the current
working directory (instead of the full path).
Cleanup of some remaining "int" status variables (where it should have
been a "status_t").


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13924 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-09 16:25:01 +00:00
Axel Dörfler eab435cd59 vfs_get_vnode_cache() now only allocates a new cache if requested: this
prevents the system to allocate caches for files that don't use or have
a file cache (ie. only those can be mmap()ed!).
Therefore, cache_prefetch() no longer crashes when trying to prefetch
files without a file cache.
read_into_cache() no longer does anything if the requested size is 0.
Fixed a bug in cache_prefetch_vnode(): if the cache couldn't be retrieved,
it put the vnode, but didn't own it (the caller does).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13904 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-05 11:52:22 +00:00
Axel Dörfler b72cf2601f Renamed vfs_vnode_acquire_ref() to vnode_acquire_vnode().
Removed vfs_vnode_release_ref(), as vfs_put_vnode() already does the same thing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13867 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 14:32:23 +00:00
Axel Dörfler b7d8ef5a0d The term vnode_ptr is not used anywhere else; renamed vfs_put_vnode_ptr() to vfs_put_vnode().
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13865 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-08-01 14:17:41 +00:00
Axel Dörfler 219dacab3c Changed our read link syscall and FS interface call to make it easily possible to be POSIX compliant.
Also changed readlink() to be POSIX compliant with those changes.
"ls -l" does now resolve links properly again (the new coreutils version outlined the problems).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12263 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-04-06 16:07:10 +00:00
Axel Dörfler 74b043d98d Removed execute property that was set accidently (since CVS days).
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11896 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-18 01:50:45 +00:00
Axel Dörfler 9391dd214d Fixed broken handling of the new file_descriptor::open_count across
team boundaries; if you didn't actually call close() from within the
application, the close-hook of the file system was never called.
Also, you could close files of other teams (ie. invoke close on a
shared file descriptor).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@11892 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-03-18 01:24:11 +00:00
Axel Dörfler d12de9209a Added some more convenience VFS calls (vfs_stat_vnode(), and vfs_get_vnode_name()).
Removed *_create() and *_create_entry_ref() syscalls - they are now handled by
*_open() and *_open_entry_ref() calls which get another parameter for the permissions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11204 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-02-02 06:20:00 +00:00
Ingo Weinhold 244f03dc1c * Moved the autolocking code for recursive lockers to <util/AutoLock.h>.
* Added resolve_mount_point_to_volume_root() version for external use
  (by the node monitor).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11159 a95241bf-73f2-0310-859d-f6bbb57e9c96
2005-01-30 16:11:46 +00:00
Axel Dörfler d786bd1324 Renamed vfs_get_vnode() to vfs_lookup_vnode() as it doesn't grab a ref to the node.
Added new vfs_get_vnode() that actually grabs such a ref.
vfs_get_vnode_cache() now fills a vm_cache_ref instead of a void pointer.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10430 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-13 22:07:27 +00:00
Axel Dörfler dfb71e0444 Added a query length parameter to _kern_open_query() - it's much easier to
do these things in userland.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10397 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-12-12 20:33:58 +00:00
Axel Dörfler 4c8e8f2f19 Added "flags" parameter to unmount.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10288 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-29 22:42:01 +00:00
Axel Dörfler 06db250916 vfs_mount_boot_file_system() now also gets the kernel_args.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9964 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-15 20:00:49 +00:00
Axel Dörfler 424f90aff9 Added prototypes for readv/writev() syscalls.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9766 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-03 14:55:44 +00:00
Axel Dörfler eef5d24c90 Changed the last argument of _kern_mount() to be a string rather than a void pointer.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9691 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-11-01 00:25:25 +00:00
Ingo Weinhold 7fb2963ae4 * Added vfs_normalize_path() service call.
* Added resolve_mount_point_to_volume_root() which does what
  resolve_volume_root_to_mount_point() did. IOW the latter one didn't
  do what it advertised.
* Fixed dir_vnode_to_path(). Basically broken due to the broken
  resolve_volume_root_to_mount_point(), but also compared potentially
  unrelated vnode IDs (belonging to different volumes).
* Fixed get_dir_path_and_leaf(). It didn't deal correctly with paths
  ending in '/' (including the root dir).
* fs_mount() does now accept a NULL fsName, getting the FS name from
  the DDM in this case.
* fs_mount() now also supports mounting file images; it lets the DDM
  create a file device for them.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9629 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-28 22:31:43 +00:00
Ingo Weinhold 1d5b7e0b23 _user_mount() now has a flags parameter, too.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9544 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 21:45:04 +00:00
Axel Dörfler 7b5e243a4d Added prototype for the new vfs_get_fs_node_from_path() function. It's
currently only used in devfs for the publication of partitions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9533 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-27 15:22:00 +00:00
Axel Dörfler 76dede71c7 Added exec() support function vfs_exec_io_context().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9241 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-07 14:46:32 +00:00
Axel Dörfler 6acb672431 New syscall for fcntl().
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9200 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-05 13:28:48 +00:00
Axel Dörfler 57549ff41e Removed vfs_types.h - it's no longer needed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9143 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-10-01 01:31:15 +00:00
François Revol 4a02ef9f55 notify_select_event moved to headers/os/drivers/Drivers.h where it belong
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9138 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-30 23:47:40 +00:00
Axel Dörfler cfd8ea7832 Added a "cookie" parameter to the vfs_read|write|has_page[s]().
Also added a prototype for the fs_get_file_map() fs call.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8867 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-06 21:52:28 +00:00
Axel Dörfler 1b4746c270 Changed the VM store and VFS functions a bit to better match the corresponding driver hooks.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8844 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-04 17:18:36 +00:00
Axel Dörfler 8b3bd22a1d Added vfs_get_vnode() prototype.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8826 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-03 16:00:22 +00:00
Axel Dörfler 36ce5c0164 Changed the way the vnode cache is set - it's now cleaner and can no longer
allocate a cache twice.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8815 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-09-03 14:07:00 +00:00
Ingo Weinhold 9955b99a86 Several VFS related syscalls have been changed, added or removed.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8701 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-08-28 20:38:39 +00:00
Axel Dörfler c28c059292 Added all syscalls needed for the next_dev() call.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8346 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-07-07 16:07:25 +00:00
Axel Dörfler 63e846d50d Added a syscall to get a path for a directory node_ref.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8278 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-07-02 18:46:36 +00:00
Axel Dörfler 645e138890 Moved vfs/fd _kern_*() calls to syscalls.h.
Removed some includes from syscalls.h where possible, minor style changes.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8256 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-07-02 01:51:56 +00:00
Axel Dörfler 734893f6d2 Renamed all VFS syscalls to the new style.
Improved returned types.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7963 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-15 15:18:04 +00:00
Axel Dörfler 2defe47a24 Removed no longer used system call.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7814 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-07 21:12:30 +00:00
Axel Dörfler aad3f70c86 Moved the public fs functions to fs_interface.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7800 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-07 14:21:51 +00:00
Axel Dörfler 5ac1540121 Changed the "stat" related syscalls to have an additional parameter that specified
the size of the stat structure to allow extensions of that structure.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7493 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-10 14:31:16 +00:00
Axel Dörfler cdbef38048 Changed some return codes to status_t where appropriate.
Renamed vfs_bootstrap_all_filesystems() to vfs_bootstrap_file_systems().
Renamed vfs_register_filesystem() to vfs_register_file_system().
Added new call vfs_mount_boot_file_system().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7421 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-05-06 01:20:41 +00:00
Axel Dörfler 7d5be143e8 We have status_t.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@6692 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-02-23 04:30:46 +00:00
Axel Dörfler c7a03dadea list.h is now in util/.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4594 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-09 02:31:25 +00:00
Axel Dörfler 5306fba3a1 Added the new vfs_get_module_path() call.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4558 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-08 04:01:07 +00:00
Axel Dörfler 318ea28beb Added internal syscalls (_user/_kern) for fs_read_info() and fs_write_info().
Not yet accessible from the outside.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4493 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-09-04 04:18:48 +00:00
Axel Dörfler 564cba312e Some header work: removed unnecessary dependencies to stage2.h, fixed
some broken C++ export definitions, added missing licenses etc.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3152 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-05-03 16:03:26 +00:00
Axel Dörfler 896aefa8ec Added a new call vfs_new_vnode(), replaced "int" return type to status_t
for the VFS vnode functions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2785 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-02-21 13:44:53 +00:00
Axel Dörfler f9bdcca59c Added kernel private node_monitor.h header.
Moved definition of "struct io_context" from fd.h to vfs.h.
Introduced new fs/ directory; some cleanups to come.
Added node monitor syscalls.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2479 a95241bf-73f2-0310-859d-f6bbb57e9c96
2003-01-18 14:04:22 +00:00
Axel Dörfler 5ef7716d48 Added a missing const to the (sys|user)_select() call.
Broke binary compatibility for the notify_select_event(), since it obviously
hasn't been used on R5 at all.
The new API/implementation is much nicer to use.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1830 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-11-03 03:14:05 +00:00
Axel Dörfler a2cbc788e0 Adds support for select(), and poll() in the kernel - both are realized
using the current BeOS device API.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1745 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-29 03:49:57 +00:00
Axel Dörfler 146a3000ee Added syscalls for the index functions.
Corrected the prototype for fs_rewind_index_dir() (don't copy and paste...)
Also checked in the syscall definitions for the signal stuff to save Angelo
some work.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1562 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-17 18:52:04 +00:00
Axel Dörfler 8e5ca65bc9 Added a new write_stat() call to the file descriptor operations.
Renamed sys_read_stat() to sys_read_path_stat() - sys_read_stat() is now
the fd operation.
Removed the sys_write_attr_stat() call because it is no longer needed.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1554 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-17 03:04:19 +00:00
Axel Dörfler 11fe0cb8de Added prototypes for the sys_/user_ attribute calls.
Changed the file_descriptor structure (more status_t, name removed).
Changed "extern inline" to "static inline" in thread.h/arch_thread.h as those
also work with -O0 -g.
Added prototypes for [arch_cpu_]user_strlcpy().


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1454 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-10-08 03:19:57 +00:00
Axel Dörfler 3c6bf0c8c1 Renamed "calls" to "ops".
Removed unused prototype.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1179 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-25 16:36:38 +00:00