Commit Graph

809 Commits

Author SHA1 Message Date
reinoud a661982b31 Use uvm_vnp_setwritesize() on file extending to instruct UVM to NOT read-in
the newly added space first. This significantly speeds up write speed for
msdosfs and making it at par with ffs wich already had this patched.

Speed increase measured on my IDE disc from 2Mb/sec to 32 Mb/sec
2007-12-28 17:46:48 +00:00
perry b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
perry 9b2b412c19 __FUNCTION__ -> __func__ 2007-12-15 00:39:14 +00:00
lukem 9a633d3a1a use __KERNEL_RCSID() instead of __RCSID() 2007-12-11 12:05:27 +00:00
lukem ceed9c722c use __KERNEL_RCSID() 2007-12-11 11:52:26 +00:00
pooka 319ddafdc5 Now that "l" is gone both as an argument to operations and from
componentname, remove all vestiges of puffs_cid.
2007-12-08 19:57:02 +00:00
pooka db06a930e6 Remove cn_lwp from struct componentname. curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
2007-12-08 19:29:36 +00:00
ad 1bea664342 Merge ihash locking changes from the vmlocking branch. 2007-12-08 14:48:33 +00:00
ad 6a3b582fe3 Merge locking changes + fixes from the vmlocking branch. 2007-12-08 14:41:11 +00:00
pooka 4e38160d4d Do not "return 1" from kqfilter for errors. That value is passed
directly to the userland caller and results in a mysterious EPERM.
Instead, return EINVAL or something else sensible depending on the
case.
2007-12-05 17:19:46 +00:00
pooka 7d5d7f4ff9 Send a response message for flush operations from the kernel instead
of abusing the return value of write(2).
2007-12-05 12:11:56 +00:00
pooka c024a3a48f Add a bit to differentiate if a message is a request or a response. 2007-12-04 19:43:42 +00:00
pooka 1ff78520d8 Destroy genfs_node in reclaim. And init it earlier in vget so that we
don't try to destroy an uninited lock should vget fail.
2007-11-30 11:23:10 +00:00
reinoud 1783f9c4fa Pullup fixes from UDF RW support project. This commit fixes the
mmc_discinfo conceptional bug and also vastly improves VAT searching.
2007-11-27 18:10:42 +00:00
pooka 6a3d9a187d Remove "puffs_cid" from the puffs interface following l-removal
from the kernel vfs interfaces.  puffs_cc_getcaller(pcc) can be
used now should the same information be desired.
2007-11-27 11:31:17 +00:00
pooka 61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
pooka 1b346350d5 In case the userspace wait is interrupted, don't use ERESTART as
the return value, rather use EINTR.

reported by Reinoud
2007-11-26 12:57:26 +00:00
pooka 6cccb0c686 * Use vfs_stdextattrctl instead of a homegrown version. Also fixes
a bug: the homegrown version neglected to unlock vp
* don't reimplement eopnotsupp()
* init genfs_node earlier vget, protects against error paths in vget
  from attempting to destroy a non-inited node
2007-11-25 16:26:42 +00:00
pooka e490f118e2 Fix a race condition: in case two source paths hardlinked to the
same file were renamed simultaneously, there was a window where
directory entry cached in the vnode during lookup would be replaced
before calling rename.  This lead to one directory entry getting
renamed twice and the other one getting zero renames.  Do a relookup
in rename to make sure we have the correct directory entry.

Thanks go to Greg Oster for reporting the problem, helping with
debugging and thoroughly testing the patch.
2007-11-23 17:16:22 +00:00
pooka 5dec3ab667 Don't KASSERT that the pool allocator returns a page - it might be
called with NOWAIT.

XXX: this is just a quick fix to stop the diagnostic panic.  I
think ENOSPC should be treated elsewhere depending on how much
memory tmpfs claims.
2007-11-22 21:08:10 +00:00
pooka bc7c4b36bc use BUF_ISREAD/WRITE instead of homegrown variants 2007-11-21 16:30:40 +00:00
pooka 7c0ef2ee17 Retire M_PUFFS, use kmem(9) instead. 2007-11-20 11:51:01 +00:00
pooka 61b1e9a615 Make puffs_updatenode() take a puffs_node instead of a vnode. This
way we don't need to worry if a vnode has been reclaimed from under
us.
2007-11-17 21:55:29 +00:00
pooka 63e9f065b3 Start playing around with vnode locks. For now, do the very easy
thing and release locks before the userspace wait for operations
which release the lock before exit from the method in any case.
However, releasing the lock after inserting the request on the
operation queue gives us proper ordering possibilities in userspace
(at least if that bit were implemented, but I don't think there
any file system in userspace that depends on kernel locking and
probably there never should be one).

inspired by a conversation with Nacho Navarro
2007-11-17 21:30:48 +00:00
pooka ac5e27103d Implement a biodone callback for async writes similar to reads and
use that when possible.
2007-11-17 18:09:04 +00:00
pooka 803c088ce0 fix some debug prints 2007-11-17 18:03:15 +00:00
pooka 622412c6c3 Restructure the messaging interface a bit more: make all interfacing
with the file server happen through puffs_msg_enqueue() and
puffs_msg_wait() instead of having a billion different routines.
Build the existing system upon these two.  Most importantly though,
decouple insertation into the op queue from the actual wait.  This
is useful for a number of reasons coming soon to a cvs repo near you.
2007-11-16 20:32:17 +00:00
pooka 4a0a4d4f30 Fix a problem noticed by Reinoud: the fs would try to release an
unlocked vnode when trying to rename a directory.  The fix was to
shuffle some bits around and #pray.

The rename routine actually needs a very very major wide-angle whopping:
 * it takes locks out-of-order
 * it deals with references from SAVESTART lookups in interesting ways
 * I doubt there is any guarantee for correct operation if there
   are multiple concurrent accesses
 * the error branches might just as well call panic() directly
2007-11-14 19:16:29 +00:00
pooka ca28ea4509 Bounds-check responses from userspace. 2007-11-12 17:42:13 +00:00
pooka 9ac65ee1fe * split the putter header into a kernel version and a userland version
+ install latter to /usr/include/dev/putter
* remove last dependencies to puffs from putter, it's completely
  independent now
2007-11-12 16:39:32 +00:00
pooka 70981e62b1 Move putter code from directly under dev/ to dev/putter/
no functional change
2007-11-12 14:30:55 +00:00
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