Commit Graph

73 Commits

Author SHA1 Message Date
joerg d3095eb543 Explicitly cast enum type. 2012-11-23 14:27:14 +00:00
pooka e6d33ac952 s/EJUSTRETURN/RUMP_EJUSTRETURN/ 2012-11-18 19:04:22 +00:00
pooka 005755d8e9 Finally remove the "temporary" __VTYPE_DEFINED stuff I added >5 years ago. 2012-11-18 18:39:23 +00:00
manu d256e38414 Fix regression that has been introduced when the lookup/reclaim race
condition was addressed in libpuffs by counting lookups.

The fix assumes that cookies map to struct puffs_cookie, which has not
been documented as a requirement for filesystems using libpuffs. As an
example, we got burnt by this assumption in libp2k (kern/46734), and
we fixed bit by actually mapping libp2k cookies to struct puffs_node.

It is unlikely, but there may be third party filesystems that use cookies
unmapped to struct puffs_node, and they were left broken for now.

- we introduce a puffs_init() flag PUFFS_FLAG_PNCOOKIE that let filesystems
inform libpuffs that they map cookies to struct puffs_node. Is that flag
is used, the lookup/reclaim race condition fix is enabled. We enable the
flag for libp2k.

- filesystems that use puffs_pn_new() obviouslty use struct puffs_node
and gain PUFFS_FLAG_PNCOOKIE automatically even if they did not specify
it in puffs_init(). This include all our PUFFS filesystem in-tree except
libp2k.

- for filesystems not willing to use struct puffs_node, we introduce a
reclaim2 vnop, which is reclaim with an additionnal lookup count argument.
This vnop let the filesystem implement the lookup/reclaim race fix on
its own.
2012-08-16 09:25:43 +00:00
manu 519089c8d9 libpuffs and libp2k both use the cookie to different structure, which now
leads to struct p2k_node corruption now that libpuffs used pn_nlookup field
in struct puffs_node to avoid race conditions.

Attempt to fix that by adding a struct puffs_node at the beginning of struct
p2k_node. This seems to fix kern/46734
2012-08-12 02:51:18 +00:00
manu be95d60797 Add a flag to VOP_LISTEXTATTR(9) so that the vnode interface can tell the
filesystem in which format extended attribute shall be listed.

There are currently two formats:
- NUL-terminated strings, used for listxattr(2), this is the default.
- one byte length-pprefixed, non NUL-terminated strings, used for
  extattr_list_file(2), which is obtanined by setting the
  EXTATTR_LIST_PREFIXLEN flag to VOP_LISTEXTATTR(9)

This approach avoid the need for converting the list back and forth, except
in libperfuse, since FUSE uses NUL-terminated strings, and the kernel may
have requested EXTATTR_LIST_PREFIXLEN.
2011-07-04 08:07:29 +00:00
pooka dc8b381a32 update copyright 2011-03-21 16:41:27 +00:00
pooka 357983cc1c Make P2K_WIZARDUID require a valid integer instead of defaulting to root. 2011-01-07 16:02:32 +00:00
pooka 0d0a5842f8 Document how to get debug info for the mount. 2011-01-07 15:50:40 +00:00
pooka 27daa694a2 In case of a P2K_DEBUG mount, dump mount point contents when the
process receives SIGINFO.  Additionally, dump vnode status if the
process gets SIGUSR1 (can be quite quite verbose, therefore not
displayed with SIGINFO).
2011-01-07 15:47:14 +00:00
pooka d32ef440df in case unmount fails (it never should), do a full mountpoint dump 2011-01-07 15:30:09 +00:00
pooka cc30c34a93 Remove the componentname-saving code since it was addressing
SAVENAME/HASBUF/SAVESTART and they don't exist anymore (and the
removed code didn't compile on nb5).
2011-01-07 11:15:30 +00:00
pooka 4063bc515b Fix file handles. Problem reported & fix tested by kefren. 2011-01-07 10:18:06 +00:00
pooka 3daddc031c rump_lwproc_newproc -> rump_lwproc_rfork 2011-01-02 13:01:45 +00:00
dholland b845056678 Add an INRELOOKUP namei flag. Sigh. (We don't need more namei flags.)
However, because of a protocol deficiency puffs relies on being able
to keep track of VOP_LOOKUP calls by inspecting their contents, and
this at least allows it to use something vaguely principled instead of
making wild guesses based on whether SAVESTART is set.

Update libp2k to use INRELOOKUP instead of SAVESTART.
2011-01-02 05:04:58 +00:00
pooka 9670fcaf80 Remove dead code from previous revision. 2010-11-30 15:42:11 +00:00
dholland 297e393f26 SAVENAME and HASBUF namei flags have been removed; update accordingly.
(pooka@ says not to worry about compat.)
2010-11-30 10:49:22 +00:00
pooka 404fa78c67 update comment 2010-11-26 11:12:06 +00:00
pooka d33a80444e Simplify now that ukfs deals with being called from a thread which
already has a rump lwp context.
2010-09-07 17:22:53 +00:00
pooka 607d9b612a Migrate from rump private interfaces to syscalls. 2010-09-07 17:16:18 +00:00
pooka cd52561abe update to new rump proc/lwp interfaces 2010-09-01 19:40:34 +00:00
hannken 1423e65b26 Clean up vnode lock operations pass 2:
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
2010-06-24 12:58:48 +00:00
pooka 388dad1711 no need to typecast in pathconf anymore 2010-06-07 11:23:07 +00:00
pooka 1cfb9937ae Pass VOP_PATHCONF to backend file server. inspired by njoly. 2010-06-06 22:46:17 +00:00
pooka 0eb828b571 bump major of libs NEEDING libpuffs 2010-05-21 10:53:41 +00:00
pooka 55a238165a support extended attributes 2010-05-21 10:52:17 +00:00
jruoho 3fe9db0422 Use standard section headers.
Xref vfs(9), which could be slightly more elaborate.
2010-05-20 05:43:54 +00:00
pooka 9a9b93d40a Initialize "hasdebug" default deterministically. 2010-05-20 00:13:02 +00:00
pooka d16346a23e If P2K_DEBUG is given, also dump rump kernel event counters when
file system is unmounted.
2010-05-01 14:44:48 +00:00
pooka 30df4c9f8c If vfstype is MOUNT_RUMPFS, assume we don't actually want to mount
a file system, but attach to the root in the fs namespace of a rump
kernel.
2010-04-29 22:34:21 +00:00
pooka 2734e549f0 Some _t purification. no functional change. 2010-04-14 14:15:48 +00:00
pooka 3454464e10 Technically we're supposed to use flags from the RUMP_NAMEI namespace
instead of NAMEI directly.  Probably doesn't matter in practise,
since the chances of this running on non-NetBSD are low.  But make
it correct anyway.
2009-12-23 01:15:11 +00:00
pooka 81eb543b62 Use NAMEI_INRENAME to improve the situation with detecting on when
to save componentname instead of looking at SAVESTART.  Not perfect,
but better.  Also, try to be more forgiving of kernel bugs.
2009-12-23 01:11:39 +00:00
pooka 13777d56f1 Don't VOP_PUTPAGES(PGO_FREE) in inactive for tmpfs, since we now
(after some changes to rump) actually free those pages, leaving
the tmpfs vnode feeling quite empty.
(the purpose of the flush is to avoid double caching between the
rump kernel and puffs vfs layer)
2009-12-16 17:20:19 +00:00
pooka a1c4673949 Adapt ukfs users to the new ukfs_part interface. 2009-12-03 14:27:16 +00:00
wiz ca692c48bd Fix typo and uppercase UID. 2009-11-21 22:32:52 +00:00
pooka a9552d686b Update for recent interface additions. 2009-11-21 12:28:51 +00:00
pooka cf93a6e109 nuke leading whitespace 2009-11-21 12:16:19 +00:00
pooka 18382772a4 document P2K_WIZARDUID 2009-11-21 11:40:52 +00:00
pooka 251fbb35dc Report actual group array size instead of 0 (which always gives back 0 grousp). 2009-11-20 14:24:58 +00:00
pooka 96ae77ca39 Add "wizardmode", which allows to specify the uid which is used to
access the file system instead of using the caller uid.  This is
useful for example when modifying the root fs image for an OS
installation without wanting to dance around as root on the host.

idspispopd
2009-11-20 14:11:38 +00:00
pooka a37ccec12c Default "recycle" to false in inactive. File system drivers do
not always set it.
2009-10-19 17:34:07 +00:00
pooka 38a8ac9c61 Split init routines a bit more to allow for p2k init without having
to pass any real configuration data.  This benefits things like
rump_smbfs which need to init rump before running the userspace
mount routines (because they make rump system calls) but cannot
run p2k_setup() at that stage because it requires data provided by
the userspace mount routines.  And p2k_setup() in turn forks (to
detach), so it cannot be run after rump has been inited and threads
have been created.
2009-10-18 19:36:41 +00:00
pooka dd0a0505f1 Implement abortop. 2009-10-17 23:20:15 +00:00
pooka 2ce66cd910 use newstyle rump lwp interfaces 2009-10-15 16:41:08 +00:00
pooka bf3992af18 Adjust names of external rump control interfaces to match the
new rump_pub namespace.
2009-10-14 18:22:50 +00:00
pooka e0ace4590b Expand rump curlwp macro. 2009-10-13 20:06:38 +00:00
pooka 476b5ba667 Expose a separate mount and run interface for those servers which
want to perform actions after mounting.
2009-10-09 16:37:30 +00:00
pooka a06931db70 puffs might call getattr after we decided to recycle node. protect. 2009-10-07 20:56:29 +00:00
pooka 0605ce2bd4 Provide p2k_run_diskfs(), which acts like p2k_run_fs(), but taps
into ukfs_mount_disk() instead of ukfs_mount()
2009-10-07 20:55:25 +00:00