Commit Graph

957 Commits

Author SHA1 Message Date
ad 928a6b2096 PR kern/38135 vfs_busy/vfs_trybusy confusion
The previous fix worked, but it opened a window where mounts could have
disappeared from mountlist while the caller was traversing it using
vfs_trybusy(). Fix that.
2008-04-30 12:49:16 +00:00
ad e3610f1886 kern/38135 vfs_busy/vfs_trybusy confusion
The symptom was that sometimes file systems would occasionally not appear
in output from 'df' or 'mount' if the system was busy. Resolution:

- Make mount locks work somewhat like vm_map locks.
- vfs_trybusy() now only fails if the mount is gone, or if someone is
  unmounting the file system. Simple contention on mnt_lock doesn't
  cause it to fail.
- vfs_busy() will wait even if the file system is being unmounted.
2008-04-29 23:51:04 +00:00
ad baa3395f8f PR kern/38057 ffs makes assuptions about devvp file system
PR kern/33406 softdeps get stuck in endless loop

Introduce VFS_FSYNC() and call it when syncing a block device, if it
has a mounted file system.
2008-04-29 18:18:08 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad 6d70f903e6 Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
  be sent from a hardware interrupt handler. Signal activity must be
  deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
  and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
2008-04-24 15:35:27 +00:00
ad a9ca7a3734 Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
2008-03-21 21:54:58 +00:00
rmind c6186face4 Welcome to 4.99.55:
- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call.  It will
  indicate which event (POLL_IN, POLL_OUT, etc) happen.  If unknown,
  zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
2008-03-01 14:16:49 +00:00
matt 9a1bbaab37 Convert to ansi definitions from old-style definitons. 2008-02-27 19:59:48 +00:00
matt 8014191a2e Convert to ansi definitions from old-style definitons. 2008-02-27 19:43:36 +00:00
ad 1a710239b8 A port of FreeBSD's updated unionfs. This is a work in progress. In
particular, unionfs_lookup() needs a lot of attention.
2008-02-18 16:44:22 +00:00
dholland 81117ea33b Restore a fragment of a comment that apparently got lost in a merge slipup
in 1998.
2008-02-09 17:49:39 +00:00
jmmv 5a8838cb59 u_int is not a C99 standard type, so spell it out completely as
unsigned int.
2008-02-06 11:23:53 +00:00
jmmv 565f731b68 Drop trailing whitespace. 2008-02-06 11:22:12 +00:00
ad 648f07789f Do genfs_node_init() earlier. PR kern/36162. 2008-02-05 15:18:36 +00:00
ad 1eba00507a Limit kva usage to 8TB and the number of inodes to 2G. Should fix
PR kern/37951.
2008-02-05 15:02:45 +00:00
ad 22c6a20ebd Lock v_knlist with the vnode interlock. PR kern/37881. 2008-02-05 14:19:52 +00:00
ad d7b9a25622 Remove debugging code that's no longer needed. 2008-01-31 13:13:20 +00:00
tnn d1e420ee23 - Needs sys/atomic.h for atomic_inc_uint()
- Quench compiler warning about signed/unsigned mismatch when building LKM
2008-01-31 08:23:04 +00:00
ad 2290e4283f Expunge references to lockmgr. 2008-01-30 14:16:42 +00:00
ad 9ef95126d8 Replace crufty use of lockmgr. 2008-01-30 14:08:00 +00:00
ad e556d15453 Make it compile. I'll leave it to pooka to figure out what is the correct
thing here because I don't understand what this code is doing.
2008-01-30 11:57:24 +00:00
ad 25153c3ec9 PR kern/37706 (forced unmount of file systems is unsafe):
- Do reference counting for 'struct mount'. Each vnode associated with a
  mount takes a reference, and in turn the mount takes a reference to the
  vfsops.
- Now that mounts are reference counted, replace the overcomplicated mount
  locking inherited from 4.4BSD with a recursable rwlock.
2008-01-30 11:46:59 +00:00
ad 3490efcc63 Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.
2008-01-30 09:50:19 +00:00
pooka 81de436273 init genfs_node before potential vput() 2008-01-29 18:22:24 +00:00
pooka 13d9236c46 Nuke #ifdef __OtherOS__ clutter to make maintaining slightly easier. 2008-01-29 18:21:10 +00:00
pooka feea4545b8 For code clarity typedef void *puffs_cookie_t.
No functional change.
2008-01-28 21:06:36 +00:00
dholland 717e1785a5 Fix some race conditions in rename.
Introduce a per-FS rename lock and new vfsops to manipulate it.
Get this lock while renaming. Also add another relookup() in do_sys_rename,
which is a hack to kludge around some of the worst deficiencies of
ufs_rename.
reviewed-by: pooka (and an earlier rev by ad)
posted on tech-kern with no objections.
2008-01-28 14:31:15 +00:00
ad b9839de884 Replace use of lockmgr(). 2008-01-27 21:58:39 +00:00
ad 29426ebab2 - Fix several problems with the inode hash.
- Replace use of lockmgr().
2008-01-26 14:25:38 +00:00
ad e49174fa0c - Fix probelms with inode hash: make MPSAFE, don't allocate with held locks.
- Replace use of lockmgr().
2008-01-25 20:49:15 +00:00
ad de81194d0c - Make new vnode construction MPSAFE.
- Replace use of lockmgr().
2008-01-25 20:29:28 +00:00
ad 1997a1e1f4 Remove VOP_LEASE. Discussed on tech-kern. 2008-01-25 14:32:11 +00:00
ad 703069c0e9 specfs changes for PR kern/37717 (raidclose() is no longer called on
shutdown). There are still problems with device access and a PR will be
filed.

- Kill checkalias(). Allow multiple vnodes to reference a single device.

- Don't play dangerous tricks with block vnodes to ensure that only one
  vnode can describe a block device. Instead, prohibit concurrent opens of
  block devices. As a bonus remove the unreliable code that prevents
  multiple file system mounts on the same device. It's no longer needed.

- Track opens by vnode and by device. Issue cdev_close() when the last open
  goes away, instead of abusing vnode::v_usecount to tell if the device is
  open.
2008-01-24 17:32:52 +00:00
pooka 661097a9a5 Remove bogus KASSERT: we can't make any assumptions about a dirent's
node in unmount since it might have been freed already.

fixes PR kern/37667.  per discussion with ad & simonb.
2008-01-17 18:22:52 +00:00
ad 42c90ece4c Fix dodgy tests of v_usecount. 2008-01-17 10:39:14 +00:00
ad 6d827ae10e Correct previous. 2008-01-17 10:28:24 +00:00
ad 33b917a83d smbfs_reclaim: fix a broken assertion. 2008-01-17 10:25:01 +00:00
ad bf01c1fd6b union_putpages: fix a locking botch. 2008-01-16 10:10:18 +00:00
christos d4fda54fa5 PR/37696: Paul Ripke: add large read / readahead support (Introduce run-length
detection to msdosfs_bmap(), from FreeBSD)
2008-01-05 18:42:14 +00:00
ad 0664a0459b Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
2008-01-04 21:17:40 +00:00
pooka 933a1a1af1 Politely refuse to mount a file system which says its FAT size is
zero - our implementation can't handle it (how sensible handling
a case like that would be is a whole other debate).

fixes panic reported by Jukka Salmi on current-users
2008-01-04 14:58:16 +00:00
pooka 89943d2ace fix vmlocking2 fallout: fstrans_mount/unmount 2008-01-03 18:09:35 +00:00
pooka 34fa5dc385 struct vop_foo_args comment police: a_l has ceased to be 2008-01-03 02:18:20 +00:00
pooka d53e261066 valloc -> vnalloc, vfree -> vnfree
Avoids collision with userland valloc(3).

no functional change
ad ok
2008-01-03 01:26:28 +00:00
pooka 4f32bae2c1 More type-punning workarounds. Curiously the kernel compilation
flags cause gcc to not complain.
2008-01-02 22:37:19 +00:00
pooka b8121d8a80 silence gcc about break type-punning 2008-01-02 22:33:10 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
pooka a5ee2954b8 namespace a bit: vfsops -> puffs_vfsop_x() and vops -> puffs_vnop_x() 2007-12-30 23:04:12 +00:00
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
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
pooka 05eae67bb1 Add a third type of fh option, passthrough, where the kernel does
not attempt to handle struct fid at all and passes it as such to
userspace.
2007-08-23 14:36:46 +00:00
pooka e6d6dce9bf Mimic namei structure changes for puffs. bump both kernel & lib version. 2007-08-22 17:54:30 +00:00
pooka 1b189c72ab In the new world order (a.k.a. the human-understandable world order)
VOP_LOOKUP ignores LOCKPARENT completely, so make this ignore it also.

XXX: tested only with rump, but I can't really see how this worked
at all before
2007-08-17 17:44:43 +00:00
pooka 25a346d4fb Nuke PUFFSLOOKUP_FOO and move to NAMEI_FOO 2007-08-15 14:19:19 +00:00
pooka d1cd2c26a2 * don't call VOP_ACCESS in lookup, that's the file system's problem
* be more careful with r/o fs to catch EEXIST in lookup CREATE
* some comment polish
2007-08-13 09:48:55 +00:00
pooka 4c3f2a2acf enforce MNT_RDONLY 2007-08-12 19:44:15 +00:00
pooka 493dccb979 sprinkle #ifdef _KERNEL 2007-08-08 09:21:34 +00:00
rumble 1e80c150c7 Fix a parenthesis bug that would nearly always make the superblock magic
check evaluate to true.
2007-08-06 23:25:27 +00:00
pooka 31d16d310e Make VFS_SYNC always succeed instead of always fail.
Fixes non-forced unmount.
2007-08-06 21:10:24 +00:00
pooka 0ed76b1676 When resizing a node, first drop extra pages and zero tail, and only
then set the new size.  Otherwise zerolen will always be, well, 0.
2007-08-06 16:08:55 +00:00
pooka 9dc896c9de Set mnt_fs_bshift and mnt_dev_bshift to reasonable dummy-values. 2007-08-03 13:00:19 +00:00
pooka e226ccdf0c add comment to flag a slight problem 2007-08-01 14:20:45 +00:00
pooka 8d1f899239 * nuke the nameidata parameter from VFS_MOUNT(). Nobody on tech-kern
knew what it was supposed to be used for and wrstuden gave a go-ahead
* while rototilling, convert file systems which went easily to
  use VFS_PROTOS() instead of manually prototyping the methods
2007-07-31 21:14:15 +00:00
pooka 573c189296 properly setup ubcflags 2007-07-30 14:49:01 +00:00
pooka eaf29fa688 Move PUFFS_TYPEPREFIX to puffs_msgif.h since it's used in a macro there. 2007-07-30 09:04:58 +00:00
rumble 3ea6a6534e Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.
2007-07-29 21:17:41 +00:00
rumble 1c42082598 Only set *ap->a_cookies when we're returning success. Also, do not hard-
code 16, but rather use _DIRENT_MINSIZE as the divisor when determining
the number of cookies to allocate.

Noticed by pooka@.
2007-07-29 20:58:10 +00:00
rumble 8f9941b474 Support NFS cookies and the eofflag in efs_readdir. Also, be sure to
update uio->uio_offset as not doing so would cause large directory reads
to misbehave.

EFS is now properly NFS-exportable.
2007-07-29 20:15:20 +00:00
ad a0d1fd8d0c It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 13:31:07 +00:00
pooka b7321c1a86 apply ketchup to vop_mmap_args comment 2007-07-29 13:12:42 +00:00
ad 66fefd117b It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
2007-07-29 12:15:35 +00:00