Commit Graph

778 Commits

Author SHA1 Message Date
pooka
f2031ea28b Part 2/n of extensive changes to request transport to/from userspace:
Rip the transport code completely out of puffs and generalize it
into an independent module which will be used for multiple purposes
in the future.  This module is called the Pass-to-Userspace
Transporter (known as "putter" among friends).

This is very much work-in-progress and one dependency with puffs
remains: the request framing format.

The device name is still /dev/puffs, but that will change soon.

Users of puffs need the following in their kernel configs now:
pseudo-device   putter
2007-11-10 21:45:04 +00:00
ad
65b374fb48 Back out the tmpfs changes; there appears to be a bug lurking. 2007-11-10 03:36:16 +00:00
ad
d18c6ca4de Merge from vmlocking:
- pool_cache changes.
- Debugger/procfs locking fixes.
- Other minor changes.
2007-11-07 00:23:13 +00:00
ad
dc73f9929a Merge from vmlocking. 2007-11-06 19:50:55 +00:00
pooka
67eb7aa96c Make some comments match current reality. No functional change. 2007-11-04 17:32:34 +00:00
reinoud
ed2d3954ca Fix panic when the VAT couldn't be found. It would refer an stale
udf_node->vnode.
2007-10-31 15:42:13 +00:00
pooka
f977a9f9b5 Read/write can reuse message memory if operating uncached. This
will change evetually, but for now just appease a KASSERT by
resetting the message header to 0 after each loop.
2007-10-26 16:54:50 +00:00
pooka
69cae5d94a Reference mountpoint when fetching operations and release waiters
in unmount.
2007-10-25 15:22:25 +00:00
dyoung
28f88dda1b Borrow a clue from the vmlocking branch, and consolidate all of
the vput(9)ing in tmpfs_rmdir() in one place.  No functional change
intended.
2007-10-23 19:49:01 +00:00
dyoung
b0281cfdf3 Fix typo: I'm pretty sure that in tmpfs_done(), both of the malloc(9)
types are supposed to be detached, not attached.
2007-10-23 19:45:29 +00:00
dyoung
f6f0161f95 Put _tmpfs_ in the name of the pools instead of _pool_. Obviously
they're pools; it's not so obvious that they come from tmpfs. :-)
2007-10-23 19:43:54 +00:00
pooka
17cfaf2828 The kernel (genfs, uvm) can't deal with strategy returning an error
when vclean()ing.  Pending an adventure to the genfs/vm labyrinth
to fix this properly, compensate here by not allowing unstrategic
(no pun) return values.  They are always due to the userspace server
crashing anyway, so it's no big deal if we lie about the final
resting place of the pages.
2007-10-23 18:27:10 +00:00
pooka
0fbd24007f * release pathname buffer in link
* some variable massage
2007-10-21 19:43:52 +00:00
pooka
be98071c8c Always provide caller information from the kernel based on curlwp.
(but don't deprecate the old puffs_cid interface just yet)
2007-10-21 14:28:05 +00:00
pooka
cf6e3aa4f9 When doing a read operation, don't copy the whole kernel buffer to
userspace, since it doesn't contain any information yet.  I should
still rework this more so this is just a quickie to get the read/write
style interface more up to speed with the ioctl version.
2007-10-19 14:38:45 +00:00
pooka
95419baf2f comment polish 2007-10-19 13:04:06 +00:00
pooka
b372e0c23c Fix wrong argument order which just happened to work by luck. 2007-10-18 17:07:30 +00:00
pooka
1ff56db239 g/c garbage 2007-10-11 23:46:08 +00:00
pooka
c0a5a05f36 Handle suspend and flush requests from the file server. 2007-10-11 23:04:21 +00:00
pooka
d0216e150a in case of version mismatch, print the numbers 2007-10-11 22:06:05 +00:00
pooka
33c91738e5 Part 1/n of some pretty extensive changes to how the kernel module
interacts with the userspace file server:

  * since the kernel-user communication is not purely request-response
    anymore (hasn't been since 2006), try to rename some "request" to
    "message".  more similar mangling will take place in the future.

  * completely rework how messages are allocated.  previously most of
    them were borrowed from the stack (originally *all* of them),
    but now always allocate dynamically.  this makes the structure
    of the code much cleaner.  also makes it possible to fix a
    locking order violation.  it enables plenty of future enhancements.

  * start generalizing the transport interface to be independent of puffs

  * move transport interface to read/write instead of ioctl.  the
    old one had legacy design problems, and besides, ioctl's suck.
    implement a very generic version for now; this will be
    worked on later hopefully some day reaching "highly optimized".

  * implement libpuffs support behind existing library request
    interfaces.  this will change eventually (I hate those interfaces)
2007-10-11 19:41:13 +00:00
pooka
bbaa4c8c80 Cache vnode member variables necessary for operations after the
userspace call, namely our private mount structure, in the activation
record.  This avoids problems in situations where the userspace
file server happens to die during our upcall and the vnode is
forcibly reclaimed before we roll back to the current stack frame.
2007-10-11 12:31:45 +00:00
ad
7dad9f7391 Merge from vmlocking:
- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
2007-10-10 20:42:20 +00:00
pooka
ad16af9917 g/c more unused stuff 2007-10-09 20:57:06 +00:00
pooka
4a4ec123bd g/c vntouser_req(), it's not used anymore 2007-10-09 15:49:34 +00:00
ad
9f56dfa520 Merge brelse() changes from the vmlocking branch. 2007-10-08 18:02:53 +00:00
ad
59904ecbd2 Merge from vmlocking: fix dodgy use of VOP_ISLOCKED(). 2007-10-08 17:01:43 +00:00
pooka
a6bfd0bd84 g/c the "sizeop" code previous used for ioctl/fcntl. It was already
commented out and has bitrotted beyond all recognition, so it needs
complete rethinking.
2007-10-04 21:20:47 +00:00
pooka
c562677131 If kernel resource allocation fails after the file server has
committed something, issue an abort.  The abort is done through
the regular op channel, e.g. failed mkdir leads to regular rmdir,
inactive and reclaim.  No internal interface is planned currently
for the one file system out of a million which would implement it
to benefit from the one case in a billion where kernel resource
allocation actually does fail and out of that one case in a trillion
where internal vs. external would make a difference.
2007-10-02 01:17:17 +00:00
pooka
47cf5226f9 * better error checking: validate error values received from userland
to be vaild errno values
* include string describing error in PUFFS_ERR
* get rid of union in puffs_req, it's nothing but trouble
* pass pmp to async i/o callbacks
2007-10-01 21:09:07 +00:00
pooka
c82fd73eb8 kill trailing whitespace 2007-09-29 20:17:36 +00:00
pooka
c4ad0e4da1 Release vnode being created in error branch instead of leaving it
locked.  Ideally the function should be rewritten to do things in
a different order, but this tries to keep changes minimal aiming
for a possible netbsd-4 pullup.

fixes PR kern/37034
2007-09-28 19:48:42 +00:00
pooka
db8a762626 comments & other minor maintenance 2007-09-27 23:25:10 +00:00
pooka
28636f63b4 Split routines handling nodes from puffs_subr to puffs_node.
No functional change.
2007-09-27 23:21:07 +00:00
pooka
1bbaeda6c3 nuke trailing , from enum. spotted by xtraeme 2007-09-27 23:10:42 +00:00
pooka
25d66b7667 Revert previous, it makes no sense whatsoever. 2007-09-27 23:03:25 +00:00
pooka
7f0d130f47 Undo state created in cookie2vnode if an error is returned. 2007-09-27 21:49:56 +00:00
pooka
7f467f6fac Differentiate between cookie2vnode returning an error and
return to caller, address unknown: no such cookie, no such node.
Make the callers use this info to either create a new vnode or bail.
2007-09-27 21:44:12 +00:00
pooka
aa533e99dd Add error notifications, which are used to deliver errors from the
kernel to the file server for silly things the file server did,
e.g. attempting to create a file with size VSIZENOTSET.  The file
server can handle these as it chooses, but the default action is
for it to throw its hands in the air and sing "goodbye, cruel world,
it's over, walk on by".
2007-09-27 21:14:49 +00:00
pooka
c342f5d6d4 Don't forget to insert the root node on the hash list.
... I should remember to test also if unmounting a file system works
before I commit stuff.
2007-09-27 18:06:41 +00:00
pooka
01895f64a7 Fix a race in how new cookies are checked. Previously the checking
was done separate of inserting the cookie into the lookup structure
and without any form of interlock.  This could lead to the same
cookie pointing to two different nodes.  Remedy the race by creating
a separate "checked and ready to be inserted" cookie list which
serves as an interlock without having to hold a fs-global creation
lock.
2007-09-27 14:35:14 +00:00
pooka
4d93faced9 add a few comments and g/c dead code 2007-09-24 19:15:42 +00:00
rumble
74c326b877 Simplify ptyfs_readdir at pooka's suggestion.
No functional change intended.
2007-09-24 01:00:02 +00:00
rumble
0ae0a486c7 Avoid stack allocation of large dirent structures in foo_readdir(). 2007-09-24 00:42:12 +00:00
rmind
49c0fadea3 smbfs_mount: Fix a possible dereference, and simplify the error case.
From CID: 4556

Tested by <dan>.
2007-09-21 01:33:04 +00:00
rumble
f25f34f4c0 Don't explicitly set vp->v_size and then call uvm_vnp_setsize(). This is
not only unnecessary, but trips a kernel assertion introduced in r1.85 of
uvm/uvm_vnode.c.
2007-09-08 19:19:37 +00:00
rumble
0b6fb31125 In efs_readdir don't foolishly allocate and free dirents for each entry
before copying them out, rather just use a single one. Further, follow
the example of tmpfs and others by simply allocating on the stack.

This should have the side-effect of silencing false Coverity reports like
CID 4559 and 4554.
2007-09-08 18:17:59 +00:00
rumble
df9eaeb9e0 CID 4553:
In efs_lookup, when checking whether a CREATE or RENAME operation would
succeed, be sure to pass the appropriate vnode pointer to VOP_ACCESS.
2007-09-08 16:21:27 +00:00
pooka
d7dbef6aec move static KASSERT from mount to init 2007-09-05 22:34:17 +00:00
pooka
89e48410c4 * don't allow the file server to specify a node size to be VSIZENOTSET
* KASSERT that VNOVAL == VSIZENOTSET
2007-09-04 00:11:38 +00:00