Commit Graph

47 Commits

Author SHA1 Message Date
dholland d4eb05390d Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.
2010-11-30 10:29:57 +00:00
hannken e698a5d246 Using cache_revlookup() leads to vnode races as it returns an unreferenced
vnode that may disappear before the caller has a chance to reference it.

Reference the vnode while the name cache is locked.

No objections on tech-kern.
2010-07-21 09:01:35 +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 c3183f3251 The VATTR_NULL/VREF/VHOLD/HOLDRELE() macros lost their will to live
years ago when the kernel was modified to not alter ABI based on
DIAGNOSTIC, and now just call the respective function interfaces
(in lowercase).  Plenty of mix'n match upper/lowercase has creeped
into the tree since then.  Nuke the macros and convert all callsites
to lowercase.

no functional change
2010-01-08 11:35:07 +00:00
yamt cea19a4d14 malloc -> kmem_alloc. 2009-01-17 07:02:35 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
dsl 7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +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
christos 33cb8be1db - add an elf aux vector entry for implementing $ORIGIN.
- the code to convert from a vnode to a path is commented out now until
  a better solution is implemented. Only absolute paths work for now
  (which is most of the cases).

requested by core
2007-12-03 02:06:57 +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
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
ad 451aacda90 Merge file descriptor locking, cwdi locking and cross-call changes
from the vmlocking branch.
2007-10-08 15:12:05 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
chs c398ae9734 a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
   these now always return the parent vnode locked.  namei() works as before.
   lookup() and various other paths no longer acquire vnode locks in the
   wrong order via vrele().  fixes PR 32535.
   as a nice side effect, path lookup is also up to 25% faster.
 - the above allows us to get rid of PDIRUNLOCK.
 - also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
 - remove an assumption in layer_node_find() that all file systems implement
   a recursive VOP_LOCK() (unionfs doesn't).
 - require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
   fill in eopnotsupp() for file systems that don't support being exported
   and remove the checks for NULL.  (layerfs calls these without checking.)
 - in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
   adjust which vnode is locked.  fixes PR 33374.
 - apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().
2006-12-09 16:11:50 +00:00
christos 1b7ad03044 Defer the vnode test for directory until after the cache lookup. This makes
getcwd work with plain files too, if we allow plain files in the vnode->name
cache.
2006-10-25 18:55:49 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
elad 215bd95ba4 integrate kauth. 2006-05-14 21:15:11 +00:00
yamt ec5a93183a merge yamt-uio_vmspace branch.
- use vmspace rather than proc or lwp where appropriate.
  the latter is more natural to specify an address space.
  (and less likely to be abused for random purposes.)
- fix a swdmover race.
2006-03-01 12:38:10 +00:00
christos 95e1ffb156 merge ktrace-lwp. 2005-12-11 12:16:03 +00:00
christos 50f8955b6e 64 bit inode changes. 2005-08-19 02:04:03 +00:00
thorpej b1a8db7e02 Use ANSI function decls. 2005-06-05 23:47:48 +00:00
skrll f7155e40f6 There's no need to pass a proc value when using UIO_SYSSPACE with
vn_rdwr(9) and uiomove(9).

OK'd by Jason Thorpe
2004-09-17 14:11:20 +00:00
junyoung a222c81884 Nuke __P(). 2004-03-23 13:22:03 +00:00
enami 456851e71a Some whitespace fix. 2004-02-17 01:45:34 +00:00
enami d59c88c291 The vnode capability id is gone. 2004-02-17 01:35:33 +00:00
enami 6a268a570b Rewind the `bp' advanced backward by cache_revlookup() if getcwd_getcache()
finally returns cache miss.

# Slightly modified from posted version so that it is cleanly patchable
# at least on 1.6 branch.
2004-02-17 01:29:39 +00:00
yamt cc104d0635 eliminate v_id. 2003-07-30 12:10:57 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
thorpej a06b275edc Undo part of the ktrace/lwp changes. In particular:
* Remove the "lwp *" argument that was added to vget().  Turns out
  that nothing actually used it!
* Remove the "lwp *" arguments that were added to VFS_ROOT(), VFS_VGET(),
  and VFS_FHTOVP(); all they did was pass it to vget() (which, as noted
  above, didn't use it).
* Remove all of the "lwp *" arguments to internal functions that were added
  just to appease the above.
2003-06-29 18:43:21 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
christos c0d7b8d87a move declaration of getcwd_common and constant to the header file. 2003-04-16 20:00:03 +00:00
thorpej e0d8d366df Merge the nathanw_sa branch. 2003-01-18 10:06:22 +00:00
lukem adc783d537 add RCSIDs 2001-11-12 15:25:01 +00:00
fvdl 89b5cfa9c5 Jump out of the scandir loop if VOP_READDIR returns an error, avoiding
running around in circles.
2000-12-15 11:52:14 +00:00
augustss 264f1d27c6 Get rid of register declarations. 2000-03-30 09:27:11 +00:00
eeh 3bd42b03a7 Make getcwd_common() available to COMPAT_NETBSD32 code as well. 1999-12-30 16:01:34 +00:00
jdolecek f7f3de79e0 g/c redundant vn_isunder() prototype (it.s in <sys/vnode.h>)
minor KNF changes
1999-12-15 08:36:44 +00:00
sommerfeld c4fe7934c5 Fix kern/7944: getcwd permission checking was overly restrictive.
(Don't require start directory to have read permission).
1999-07-11 09:27:23 +00:00
sommerfeld 140b1ee075 Housecleaning time:
Fix and document naming convention for vnode variables (always use
lvp/lvpp and uvp/uvpp instead of a hash of cvp, vpp, dvpp, pvp, pvpp).

Delete old stale #if 0'ed code at the end.

Change error path code in getcwd_getcache() slightly (merge common
cleanup code; shouldn't affect behavior any).
1999-07-04 20:16:57 +00:00
sommerfeld c45e268d01 Fix PR7373 for real: Rearrange locking to avoid need for LOCKPARENT in lookup 1999-06-21 05:11:09 +00:00
sommerfeld 1425b5931b Fix PR7761: clip overly large length rather than failing 1999-06-19 18:01:26 +00:00
thorpej 16936c9565 Break cdir/rdir/cmask info out of struct filedesc, and put it in a new
substructure, `cwdinfo'.  Implement optional sharing of this substructure.

This is required for clone(2).
1999-04-30 18:42:58 +00:00
is af3d525792 Fix adosfs's locking panic 1999-04-26 20:33:18 +00:00
sommerfe c97bb0650d Fix compile warning (not seen with egcs, but...) 1999-04-05 03:33:31 +00:00
sommerfe ef07055d58 Disallow tracing of processes unless tracer's root directory is at or
above tracee's root directory.
1999-03-25 04:45:56 +00:00
nathanw e8b935d003 Garbage collect a non-useful variable in getcwd_scandir(). 1999-03-25 02:32:18 +00:00
sommerfe 095cd96cd5 Change namei cache to record vnode->(parent,name) entries (for directories).
Add kernel implementation of getcwd() which uses this cache, falling
back to reading the filesystem on a cache miss.
Along for the ride: add new VOP_FSYNC flag FSYNC_RECLAIM indicating
that a reclaim is being done, so only a "shallow" fsync is needed.
1999-03-22 17:01:55 +00:00