Commit Graph

1671 Commits

Author SHA1 Message Date
Jeff Roberson
5c5e51fd9a - cache_lookup() now locks the new vnode for us to prevent some races.
Remove redundant code.

Sponsored by:	Isilon Systems, Inc.
2005-03-29 13:00:37 +00:00
Jeff Roberson
654f669c9a - Correct the dprintf format int the _lookup routine.
Spotted by:	pjd
2005-03-28 14:26:01 +00:00
Jeff Roberson
e4fefa9bd5 - Garbage collect an unused variable. 2005-03-28 13:45:09 +00:00
Jeff Roberson
b2255473fb - Don't panic if we can't lock a child in lookup, return an error instead.
- Only unlock the directory if this is a DOTDOT lookup.  Previously this
   code could have deadlocked if there was a DOTDOT lookup with LOCKPARENT
   set and another thread was locking the other way up the tree.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 13:39:16 +00:00
Jeff Roberson
e32addd40d - Remove unnecessary LOCKPARENT manipulation.
Sponsored by:	Isilon Systems, Inc.
2005-03-28 13:29:15 +00:00
Jeff Roberson
ce5846dc19 - nwfs_lookup() is no longer responsible for unlocking the dvp, this is
handled in vfs_lookup.c.  This code was missing PDIRUNLOCK use prior
   to the removal of PDIRUNLOCK in rev 1.73 of vfs_lookup.c.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:46:33 +00:00
Jeff Roberson
7539637508 - hpfs_lookup() is no longer responsible for unlocking the dvp, this is
handled in vfs_lookup.c.  This code was missing PDIRUNLOCK use prior
   to the removal of PDIRUNLOCK in rev 1.73 of vfs_lookup.c.

Sponsored by:   Isilon Systems, Inc.
2005-03-28 09:40:59 +00:00
Jeff Roberson
eddcb03d02 - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.
Sponsored by:   Isilon Systems, Inc.
2005-03-28 09:34:36 +00:00
Jeff Roberson
27ad03cb5d - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.
- In the ISDOTDOT case we have to unlock the dvp before locking the child,
   if this fails we must relock dvp before returning an error.  This was
   missing before.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:31:57 +00:00
Jeff Roberson
f6576f194e - We no longer have to bother with PDIRUNLOCK, lookup() handles it for us.
- Network filesystems are written with a special idiom that checks the
   cache first, and may even unlock dvp before discovering that a network
   round-trip is required to resolve the name.  I believe dvp is prevented
   from being recycled even in the forced unmount case by the shared lock
   on the mount point.  If not, this code should grow checks for VI_DOOMED
   after it relocks dvp or it will access NULL v_data fields.

Sponsored by:	Isilon Systems, Inc.
2005-03-28 09:29:58 +00:00
Jeff Roberson
7d2832e654 - Pass LK_EXCLUSIVE as the lock type to vget in vfs_hash_insert(). 2005-03-25 10:51:55 +00:00
Jeff Roberson
a176ceb322 - Update vfs_root implementations to match the new prototype. None of
these filesystems will support shared locks until they are explicitly
   modified to do so.  Careful review must be done to ensure that this
   is safe for each individual filesystem.

Sponsored by:   Isilon Systems, Inc.
2005-03-24 07:39:03 +00:00
Jeff Roberson
d9b2d9f7a2 - Update vfs_root implementations to match the new prototype. None of
these filesystems will support shared locks until they are explicitly
   modified to do so.  Careful review must be done to ensure that this
   is safe for each individual filesystem.

Sponsored by:	Isilon Systems, Inc.
2005-03-24 07:36:16 +00:00
Poul-Henning Kamp
7f661c6ba1 Use subr_unit 2005-03-19 08:22:36 +00:00
Poul-Henning Kamp
c049546e16 Also remember to set the fsid here. 2005-03-17 15:15:29 +00:00
Poul-Henning Kamp
e3b803b148 Forgot to replace code to set fsid in vop_getattr. 2005-03-17 14:43:40 +00:00
Poul-Henning Kamp
800b42bde0 Prepare for the final onslaught on devices:
Move uid/gid/mode from cdev to cdevsw.

Add kind field to use for devd(8) later.

Bump both D_VERSION and __FreeBSD_version
2005-03-17 12:07:00 +00:00
Jeff Roberson
ba73105324 - Lock the clearing of v_data so it is safe to inspect it with the
interlock.

Sponsored by:	Isilon Systems, Inc.
2005-03-17 12:00:05 +00:00
Poul-Henning Kamp
51f5ce0c8c Add two arguments to the vfs_hash() KPI so that filesystems which do
not have unique hashes (NFS) can also use it.
2005-03-16 11:20:51 +00:00
Poul-Henning Kamp
9ed94841d9 Remove unused file 2005-03-16 11:10:38 +00:00
Poul-Henning Kamp
fd475cc19d Remove inode fields previously used for private inode hash tables. 2005-03-16 08:09:52 +00:00
Poul-Henning Kamp
beddd41467 XXX: unnecessary pointer in inode. 2005-03-16 07:21:38 +00:00
Poul-Henning Kamp
7e1dd21ccf Don't store the disk cdev in all inodes. 2005-03-16 07:17:39 +00:00
Poul-Henning Kamp
e0251bbbe7 Don't hold a reference to the disk vnode for each inode.
Eliminate cdev and vnode pointer to the disk from the inodes,
the mount holds everything we need.
2005-03-15 21:09:52 +00:00
Poul-Henning Kamp
3b97f388d8 Eliminate cdev pointer in inodes, they're not used or needed.
The cdev could have been pulled out of the mountpoint cheaper back
when it was used anyway.
2005-03-15 20:57:25 +00:00
Poul-Henning Kamp
de68347b1b Don't hold a reference on the disk vnode for each inode. 2005-03-15 20:50:58 +00:00
Poul-Henning Kamp
45c26fa2b6 Improve the vfs_hash() API: vput() the unneeded vnode centrally to
avoid replicating the vput in all the filesystems.
2005-03-15 20:00:03 +00:00
Jeff Roberson
bc855512c8 - Assume that all lower filesystems now support proper locking. Assert
that they set v->v_vnlock.  This is true for all filesystems in the
   tree.
 - Remove all uses of LK_THISLAYER.  If the lower layer is locked, the
   null layer is locked.  We only use vget() to get a reference now.
   null essentially does no locking.  This fixes LOOKUP_SHARED with
   nullfs.
 - Remove the special LK_DRAIN considerations, I do not believe this is
   needed now as LK_DRAIN doesn't destroy the lower vnode's lock, and
   it's hardly used anymore.
 - Add one well commented hack to prevent the lowervp from going away
   while we're in it's VOP_LOCK routine.  This can only happen if we're
   forcibly unmounted while some callers are waiting in the lock.  In
   this case the lowervp could be recycled after we drop our last ref
   in null_reclaim().  Prevent this with a vhold().
2005-03-15 13:49:33 +00:00
Poul-Henning Kamp
7649bbb0b0 Disable two users of findcdev. They do the wrong thing now and will
need to be fixed.  In both cases the API should be reengineered to do
something (more) sensible.
2005-03-15 12:39:30 +00:00
Jeff Roberson
9feb7408f8 - We have to transfer lockers after reseting our vnlock pointer.
Sponsored by:	Isilon Systems, Inc.
2005-03-15 11:28:45 +00:00
Poul-Henning Kamp
46d7d4a332 Don't export major,minor, instead export tty name. 2005-03-15 11:05:11 +00:00
Poul-Henning Kamp
6bc6a87cc9 Print devtoname() instead of minor(). 2005-03-15 10:01:31 +00:00
Poul-Henning Kamp
40d04a26a0 Fix typo: pointers are not boolean in style(9). 2005-03-15 10:01:14 +00:00
Poul-Henning Kamp
e82ef95c11 Simplify the vfs_hash calling convention. 2005-03-15 08:07:07 +00:00
Dag-Erling Smørgrav
0e3b5c73b2 Hook pfs_lookup() up to vfs_cachedlookup_desc instead of vfs_lookup_desc,
as suggested by Matt's comment.  Also fix some style and paranoia issues.

The entire function could benefit from review by a VFS guru.

MFC after:	6 weeks
2005-03-14 16:24:50 +00:00
Dag-Erling Smørgrav
bc593ccd83 Fix two long-standing bugs in pfs_readdir():
Since we used an sbuf of size resid to accumulate dirents, we would end
up returning one byte short when we had enough dirents to fill or exceed
the size of the sbuf (the last byte being lost to bogus NUL termination)
causing the next call to return EINVAL due to an unaligned offset.  This
went undetected for a long time because I did most of my testing in
single-user mode, where there are rarely enough processes to fill the
4096-byte buffer ls(1) uses.  The most common symptom of this bug is that
tab completion of /proc or /compat/linux/proc does not work properly when
many processes are running.

Also, a check near the top would return EINVAL if resid was smaller than
PFS_DELEN, even if it was 0, which is frequently the case and perfectly
allowable.  Change the test so that it returns 0 if resid is 0.

MFC after:	2 weeks
2005-03-14 16:21:32 +00:00
Dag-Erling Smørgrav
cb5abc7d2d If PSEUDOFS_TRACE is defined, create a sysctl knob to enable / disable
pseudofs call tracing.
2005-03-14 16:06:47 +00:00
Dag-Erling Smørgrav
de52d21a02 fbsdidize. 2005-03-14 15:54:11 +00:00
Poul-Henning Kamp
2f00593534 Use vfs_hash instead of home-rolled. 2005-03-14 14:41:37 +00:00
Poul-Henning Kamp
dfb9f846e9 Use vfs_hash instead of home-rolled. 2005-03-14 13:22:41 +00:00
Poul-Henning Kamp
4e94fafc4f Use vfs_hash instead of home-rolled.
Correct locking around g_vfs_close()
2005-03-14 12:29:39 +00:00
Poul-Henning Kamp
a30fc63b19 Use vfs_hash instead of home-rolling. 2005-03-14 12:24:35 +00:00
Jeff Roberson
c1e7e9ba9b - VOP_INACTIVE should no longer drop the vnode lock.
Sponsored by:   Isilon Systems, Inc.
2005-03-13 12:18:47 +00:00
Jeff Roberson
8da0046596 - The VI_DOOMED flag now signals the end of a vnode's relationship with
the filesystem.  Check that rather than VI_XLOCK.
 - VOP_INACTIVE should no longer drop the vnode lock.
 - The vnode lock is required around calls to vrecycle() and vgone().

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:18:25 +00:00
Jeff Roberson
c0f681c21d - The VI_DOOMED flag now signals the end of a vnode's relationship with
the filesystem.  Check that rather than VI_XLOCK.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:14:56 +00:00
Jeff Roberson
172ffe319a - The c_lock in the coda node does not offer any features over the standard
vnode lock.  Remove the c_lock and use the vn lock in its place.
 - Keep the coda lock functions so that the debugging information is
   preserved, but call directly to the vop_std*lock routines for the real
   functionality.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:09:34 +00:00
Jeff Roberson
3100b70037 - Deadfs may now use the standard vop lock, get rid of dead_lock().
- We no longer have to take the XLOCK state into consideration in any
   routines.

Sponsored by:	Isilon Systems, Inc.
2005-03-13 12:06:20 +00:00
David E. O'Brien
bdc172ab8f Used unsigned version.
Submitted by:	jmallett
2005-03-12 06:06:04 +00:00
David E. O'Brien
fb2eece6d2 Fix kernel build on 64-bit machines. 2005-03-12 03:50:39 +00:00
Nate Lawson
d81812be67 Correct a last-minute thinko. Instead of copying the nul with the string,
nul-terminate the dp->d_name directly and only copy the string.
2005-03-11 23:35:23 +00:00