Skip site navigation (1)Skip section navigation (2)

CVS log for src/sys/nfsserver/nfs_serv.c

[BACK] Up to [FreeBSD] / src / sys / nfsserver

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.195.2.10: download - view: text, markup, annotated - select for diffs
Thu Jan 5 18:50:37 2012 UTC (5 weeks ago) by jhb
Branches: RELENG_8
Diff to: previous 1.195.2.9: preferred, colored; branchpoint 1.195: preferred, colored; next MAIN 1.196: preferred, colored
Changes since revision 1.195.2.9: +69 -60 lines
SVN rev 229618 on 2012-01-05 18:50:37Z by jhb

MFC 228185:
Enhance the sequential access heuristic used to perform readahead in the
NFS server and reuse it for writes as well to allow writes to the backing
store to be clustered.

Revision 1.210.2.2: download - view: text, markup, annotated - select for diffs
Thu Jan 5 18:50:12 2012 UTC (5 weeks ago) by jhb
Branches: RELENG_9
Diff to: previous 1.210.2.1: preferred, colored; branchpoint 1.210: preferred, colored; next MAIN 1.211: preferred, colored
Changes since revision 1.210.2.1: +69 -60 lines
SVN rev 229617 on 2012-01-05 18:50:12Z by jhb

MFC 228185:
Enhance the sequential access heuristic used to perform readahead in the
NFS server and reuse it for writes as well to allow writes to the backing
store to be clustered.

Revision 1.212: download - view: text, markup, annotated - select for diffs
Thu Dec 15 02:26:53 2011 UTC (8 weeks ago) by delphij
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.211: preferred, colored
Changes since revision 1.211: +6 -1 lines
SVN rev 228520 on 2011-12-15 02:26:53Z by delphij

Honor NFSv3 commit call (RFC 1813, Section 3.3.21) where when count is 0,
the full length from offset is being flushed.  Note that for now VOP_FSYNC
does not support offset and length parameters so we still do the same full
VOP_FSYNC.  This issue was reported at FreeNAS support site as FreeNAS
ticket #1096.

Submitted by:	"ceckerle" <ce.freenas eckerle net>
Prodded by:	gcooper
Reviewed by:	rmacklem
MFC after:	2 weeks

Revision 1.211: download - view: text, markup, annotated - select for diffs
Thu Dec 1 18:46:28 2011 UTC (2 months, 1 week ago) by jhb
Branches: MAIN
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +69 -60 lines
SVN rev 228185 on 2011-12-01 18:46:28Z by jhb

Enhance the sequential access heuristic used to perform readahead in the
NFS server and reuse it for writes as well to allow writes to the backing
store to be clustered.
- Use a prime number for the size of the heuristic table (1017 is not
  prime).
- Move the logic to locate a heuristic entry from the table and compute
  the sequential count out of VOP_READ() and into a separate routine.
- Use the logic from sequential_heuristic() in vfs_vnops.c to update the
  seqcount when a sequential access is performed rather than just
  increasing seqcount by 1.  This lets the clustering count ramp up
  faster.
- Allow for some reordering of RPCs and if it is detected leave the current
  seqcount as-is rather than dropping back to a seqcount of 1.  Also,
  when out of order access is encountered, cut seqcount in half rather than
  dropping it all the way back to 1 to further aid with reordering.
- Fix the new NFS server to properly update the next offset after a
  successful VOP_READ() so that the readahead actually works.

Some of these changes came from an earlier patch by Bjorn Gronwall that was
forwarded to me by bde@.

Discussed with:	bde, rmacklem, fs@
Submitted by:	Bjorn Gronwall (1, 4)
MFC after:	2 weeks

Revision 1.210.2.1.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 11 04:20:22 2011 UTC (2 months, 4 weeks ago) by kensmith
Branches: RELENG_9_0
CVS tags: RELENG_9_0_0_RELEASE
Diff to: previous 1.210.2.1: preferred, colored; next MAIN 1.210.2.2: preferred, colored
Changes since revision 1.210.2.1: +0 -0 lines
SVN rev 227445 on 2011-11-11 04:20:22Z by kensmith

Copy stable/9 to releng/9.0 as part of the FreeBSD 9.0-RELEASE release
cycle.

Approved by:	re (implicit)

Revision 1.210.2.1: download - view: text, markup, annotated - select for diffs
Fri Sep 23 00:51:37 2011 UTC (4 months, 2 weeks ago) by kensmith
Branches: RELENG_9
CVS tags: RELENG_9_0_BP
Branch point for: RELENG_9_0
Diff to: previous 1.210: preferred, colored
Changes since revision 1.210: +0 -0 lines
SVN rev 225736 on 2011-09-23 00:51:37Z by kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by:	re (implicit)

Revision 1.210: download - view: text, markup, annotated - select for diffs
Sat Sep 3 00:28:53 2011 UTC (5 months, 1 week ago) by rmacklem
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.209: preferred, colored
Changes since revision 1.209: +1 -0 lines
SVN rev 225356 on 2011-09-03 00:28:53Z by rmacklem

Fix the NFS servers so that they can do a Lookup of "..",
which requires that ni_strictrelative be set to 0, post-r224810.

Tested by:	swills (earlier version), geo dot liaskos at gmail.com
Approved by:	re (kib)

Revision 1.209: download - view: text, markup, annotated - select for diffs
Fri Feb 25 10:11:01 2011 UTC (11 months, 2 weeks ago) by netchild
Branches: MAIN
Diff to: previous 1.208: preferred, colored
Changes since revision 1.208: +2 -0 lines
SVN rev 219028 on 2011-02-25 10:11:01Z by netchild

Add some FEATURE macros for various features (AUDIT/CAM/IPC/KTR/MAC/NFS/NTP/
PMC/SYSV/...).

No FreeBSD version bump, the userland application to query the features will
be committed last and can serve as an indication of the availablility if
needed.

Sponsored by:   Google Summer of Code 2010
Submitted by:   kibab
Reviewed by:    arch@ (parts by rwatson, trasz, jhb)
X-MFC after:    to be determined in last commit with code from this project

Revision 1.208: download - view: text, markup, annotated - select for diffs
Sat Feb 5 21:21:27 2011 UTC (12 months ago) by alc
Branches: MAIN
Diff to: previous 1.207: preferred, colored
Changes since revision 1.207: +2 -1 lines
SVN rev 218345 on 2011-02-05 21:21:27Z by alc

Unless "cnt" exceeds MAX_COMMIT_COUNT, nfsrv_commit() and nfsvno_fsync() are
incorrectly calling vm_object_page_clean().  They are passing the length of
the range rather than the ending offset of the range.

Perform the OFF_TO_IDX() conversion in vm_object_page_clean() rather than the
callers.

Reviewed by:	kib
MFC after:	3 weeks

Revision 1.195.2.9: download - view: text, markup, annotated - select for diffs
Thu Dec 30 09:45:26 2010 UTC (13 months, 1 week ago) by pjd
Branches: RELENG_8
Diff to: previous 1.195.2.8: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.8: +41 -39 lines
SVN rev 216815 on 2010-12-30 09:45:26Z by pjd

MFC r216565,r216631,r216632,r216633,r216774:

r216565:

Reduce lock scope a little.

r216631:

On error, unbusy file system and jump to the end, so we won't try to unlock
NULL *vpp.

Reviewed by:	kib

r216632:

- Move pubflag and lockflag handling from nfsrv_fhtovp() to nfs_namei() -
  this is the only place that is different from all the other nfsrv_fhtovp()
  consumers.
  This simplifies nfsrv_fhtovp() a bit and also eliminates one
  vn_lock/VOP_UNLOCK() cycle in case of NFSv3.
- Implement NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() that tells it to leave
  mount point busy.

Reviewed by:	kib

r216633:

Use newly added NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() to keep mount point
busy. This fixes a race where we can pass invalid mount point to VFS_VGET()
via vp->v_mount when exported file system was forcibly unmounted between
nfsrv_fhtovp() and VFS_VGET().

Reviewed by:	kib

r216774:

ZFS might not return monotonically increasing directory offset cookies,
so turn off UFS-specific hack that assumes so in ZFS case.
Before the change we can miss returning some directory entries to a
NFS client.

I believe that the hack should be moved to ufs_readdir(), but until we find
somebody who will do it, turn it off for ZFS in NFS server code.

Submitted by:	rmacklem
Discussed with:	rmacklem, mckusick

Revision 1.207: download - view: text, markup, annotated - select for diffs
Tue Dec 28 21:12:15 2010 UTC (13 months, 1 week ago) by pjd
Branches: MAIN
Diff to: previous 1.206: preferred, colored
Changes since revision 1.206: +10 -3 lines
SVN rev 216774 on 2010-12-28 21:12:15Z by pjd

ZFS might not return monotonically increasing directory offset cookies,
so turn off UFS-specific hack that assumes so in ZFS case.
Before the change we can miss returning some directory entries to a
NFS client.

I believe that the hack should be moved to ufs_readdir(), but until we find
somebody who will do it, turn it off for ZFS in NFS server code.

Submitted by:	rmacklem
Discussed with:	rmacklem, mckusick
MFC after:	3 days

Revision 1.195.2.7.2.2: download - view: text, markup, annotated - select for diffs
Sun Dec 26 15:13:28 2010 UTC (13 months, 2 weeks ago) by kib
Branches: RELENG_8_2
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.195.2.7.2.1: preferred, colored; branchpoint 1.195.2.7: preferred, colored; next MAIN 1.195.2.8: preferred, colored
Changes since revision 1.195.2.7.2.1: +11 -2 lines
SVN rev 216712 on 2010-12-26 15:13:28Z by kib

MFC r216454:
VOP_ISLOCKED() should not be used to determine if the vnode is locked.
Explicitely track the locked status of the vnode.

Approved by:	re (bz)

Revision 1.195.2.8: download - view: text, markup, annotated - select for diffs
Sun Dec 26 13:14:36 2010 UTC (13 months, 2 weeks ago) by kib
Branches: RELENG_8
Diff to: previous 1.195.2.7: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.7: +11 -2 lines
SVN rev 216704 on 2010-12-26 13:14:36Z by kib

MFC r216454:
VOP_ISLOCKED() should not be used to determine if the vnode is locked.
Explicitely track the locked status of the vnode.

Approved by:	re (bz)

Revision 1.206: download - view: text, markup, annotated - select for diffs
Tue Dec 21 23:15:40 2010 UTC (13 months, 2 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.205: preferred, colored
Changes since revision 1.205: +15 -10 lines
SVN rev 216633 on 2010-12-21 23:15:40Z by pjd

Use newly added NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() to keep mount point
busy. This fixes a race where we can pass invalid mount point to VFS_VGET()
via vp->v_mount when exported file system was forcibly unmounted between
nfsrv_fhtovp() and VFS_VGET().

Reviewed by:	kib
MFC after:	5 days

Revision 1.205: download - view: text, markup, annotated - select for diffs
Tue Dec 21 23:12:45 2010 UTC (13 months, 2 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.204: preferred, colored
Changes since revision 1.204: +15 -25 lines
SVN rev 216632 on 2010-12-21 23:12:45Z by pjd

- Move pubflag and lockflag handling from nfsrv_fhtovp() to nfs_namei() -
  this is the only place that is different from all the other nfsrv_fhtovp()
  consumers.
  This simplifies nfsrv_fhtovp() a bit and also eliminates one
  vn_lock/VOP_UNLOCK() cycle in case of NFSv3.
- Implement NFSRV_FLAG_BUSY flag for nfsrv_fhtovp() that tells it to leave
  mount point busy.

Reviewed by:	kib
MFC after:	5 days

Revision 1.174.2.10.4.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:10:29 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_7_4
CVS tags: RELENG_7_4_0_RELEASE
Diff to: previous 1.174.2.10: preferred, colored; next MAIN 1.175: preferred, colored
Changes since revision 1.174.2.10: +0 -0 lines
SVN rev 216618 on 2010-12-21 17:10:29Z by kensmith

Copy stable/7 to releng/7.4 in preparation for FreeBSD-7.4 release.

Approved by:	re (implicit)

Revision 1.195.2.7.2.1: download - view: text, markup, annotated - select for diffs
Tue Dec 21 17:09:25 2010 UTC (13 months, 2 weeks ago) by kensmith
Branches: RELENG_8_2
Diff to: previous 1.195.2.7: preferred, colored
Changes since revision 1.195.2.7: +0 -0 lines
SVN rev 216617 on 2010-12-21 17:09:25Z by kensmith

Copy stable/8 to releng/8.2 in preparation for FreeBSD-8.2 release.

Approved by:	re (implicit)

Revision 1.204: download - view: text, markup, annotated - select for diffs
Sun Dec 19 18:06:20 2010 UTC (13 months, 3 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.203: preferred, colored
Changes since revision 1.203: +2 -2 lines
SVN rev 216565 on 2010-12-19 18:06:20Z by pjd

Reduce lock scope a little.

Revision 1.203: download - view: text, markup, annotated - select for diffs
Wed Dec 15 12:46:53 2010 UTC (13 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.202: preferred, colored
Changes since revision 1.202: +11 -2 lines
SVN rev 216454 on 2010-12-15 12:46:53Z by kib

VOP_ISLOCKED() should not be used to determine if the vnode is locked.
Explicitely track the locked status of the vnode.

Reviewed by:	pjd
Tested by:	avg
MFC after:	1 week

Revision 1.195.2.7: download - view: text, markup, annotated - select for diffs
Mon Nov 8 10:18:01 2010 UTC (15 months ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.195.2.6: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.6: +1 -1 lines
SVN rev 214976 on 2010-11-08 10:18:01Z by kib

MFC r214851:
Fix a bug in r214049. The nvp == vp case shall be handled specially
only for !usevget case. If VFS_VGET is working, the vnode shared lock
is obtained recursively and vput() shall be done, not vunref().

Revision 1.202: download - view: text, markup, annotated - select for diffs
Fri Nov 5 21:13:16 2010 UTC (15 months ago) by kib
Branches: MAIN
Diff to: previous 1.201: preferred, colored
Changes since revision 1.201: +1 -1 lines
SVN rev 214851 on 2010-11-05 21:13:16Z by kib

Fix a bug in r214049. The nvp == vp case shall be handled specially
only for !usevget case. If VFS_VGET is working, the vnode shared lock
is obtained recursively and vput() shall be done, not vunref().

Submitted by:	rmacklem
Tested by:	Josh Carroll <josh.carroll gmail com>
MFC after:	3 days

Revision 1.195.2.6: download - view: text, markup, annotated - select for diffs
Wed Nov 3 08:34:00 2010 UTC (15 months, 1 week ago) by kib
Branches: RELENG_8
Diff to: previous 1.195.2.5: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.5: +13 -12 lines
SVN rev 214727 on 2010-11-03 08:34:00Z by kib

MFC r214049:
When readdirplus() is handled on the exported filesystem that does
not support VFS_VGET, like msdosfs, do not call VOP_LOOKUP() for
dotdot on the root directory. Our filesystems expect that VFS handles
dotdot lookups on root on its own.

Revision 1.195.2.5: download - view: text, markup, annotated - select for diffs
Tue Nov 2 22:30:19 2010 UTC (15 months, 1 week ago) by pjd
Branches: RELENG_8
Diff to: previous 1.195.2.4: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.4: +48 -40 lines
SVN rev 214693 on 2010-11-02 22:30:19Z by pjd

MFC r211854:

- When VFS_VGET() is not supported, switch to VOP_LOOKUP().
- We are fine by only share-locking the vnode.
- Remove assertion that doesn't hold for ZFS where we cross mount points
  boundaries by going into .zfs/snapshot/<name>/.

Reviewed by:	rmacklem
Reminded by:	kib

Revision 1.201: download - view: text, markup, annotated - select for diffs
Tue Oct 19 08:55:31 2010 UTC (15 months, 3 weeks ago) by kib
Branches: MAIN
Diff to: previous 1.200: preferred, colored
Changes since revision 1.200: +13 -12 lines
SVN rev 214049 on 2010-10-19 08:55:31Z by kib

When readdirplus() is handled on the exported filesystem that does
not support VFS_VGET, like msdosfs, do not call VOP_LOOKUP() for
dotdot on the root directory. Our filesystems expect that VFS handles
dotdot lookups on root on its own.

Reported and tested by:	kevlo
MFC after:   2 weeks

Revision 1.200: download - view: text, markup, annotated - select for diffs
Thu Aug 26 23:41:40 2010 UTC (17 months, 2 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.199: preferred, colored
Changes since revision 1.199: +48 -40 lines
SVN rev 211854 on 2010-08-26 23:41:40Z by pjd

- When VFS_VGET() is not supported, switch to VOP_LOOKUP().
- We are fine by only share-locking the vnode.
- Remove assertion that doesn't hold for ZFS where we cross mount points
  boundaries by going into .zfs/snapshot/<name>/.

Reviewed by:	rmacklem
MFC after:	1 month

Revision 1.195.2.4.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 4 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.195.2.4: preferred, colored; next MAIN 1.195.2.5: preferred, colored
Changes since revision 1.195.2.4: +0 -0 lines
SVN rev 209145 on 2010-06-14 02:09:06Z by kensmith

Copy stable/8 to releng/8.1 in preparation for 8.1-RC1.

Approved by:	re (implicit)

Revision 1.174.2.10.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (2 years ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.174.2.10: preferred, colored; next MAIN 1.175: preferred, colored
Changes since revision 1.174.2.10: +0 -0 lines
SVN rev 203736 on 2010-02-10 00:26:20Z by kensmith

Copy stable/7 to releng/7.3 as part of the 7.3-RELEASE process.

Approved by:	re (implicit)

Revision 1.156.2.9: download - view: text, markup, annotated - select for diffs
Fri Dec 18 19:50:47 2009 UTC (2 years, 1 month ago) by jhb
Branches: RELENG_6
Diff to: previous 1.156.2.8: preferred, colored; branchpoint 1.156: preferred, colored; next MAIN 1.157: preferred, colored
Changes since revision 1.156.2.8: +3 -4 lines
SVN rev 200682 on 2009-12-18 19:50:47Z by jhb

MFC 200084:
Properly return an error reply if an NFS remove or link operation fails.
Previously the failing operation would allocate an mbuf and construct an
error reply, but because the function did not return 0, the NFS server
assumed it had failed to generate a reply and would leak the reply mbuf as
well as not sending the reply to the NFS client.

Revision 1.174.2.10: download - view: text, markup, annotated - select for diffs
Fri Dec 18 19:50:21 2009 UTC (2 years, 1 month ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_4_BP, RELENG_7_3_BP
Branch point for: RELENG_7_4, RELENG_7_3
Diff to: previous 1.174.2.9: preferred, colored; branchpoint 1.174: preferred, colored; next MAIN 1.175: preferred, colored
Changes since revision 1.174.2.9: +3 -4 lines
SVN rev 200681 on 2009-12-18 19:50:21Z by jhb

MFC 200084:
Properly return an error reply if an NFS remove or link operation fails.
Previously the failing operation would allocate an mbuf and construct an
error reply, but because the function did not return 0, the NFS server
assumed it had failed to generate a reply and would leak the reply mbuf as
well as not sending the reply to the NFS client.

Revision 1.195.2.4: download - view: text, markup, annotated - select for diffs
Fri Dec 18 19:43:44 2009 UTC (2 years, 1 month ago) by jhb
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.195.2.3: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.3: +3 -4 lines
SVN rev 200680 on 2009-12-18 19:43:44Z by jhb

MFC 200084:
Properly return an error reply if an NFS remove or link operation fails.
Previously the failing operation would allocate an mbuf and construct an
error reply, but because the function did not return 0, the NFS server
assumed it had failed to generate a reply and would leak the reply mbuf as
well as not sending the reply to the NFS client.

Revision 1.174.2.9: download - view: text, markup, annotated - select for diffs
Mon Dec 7 13:38:10 2009 UTC (2 years, 2 months ago) by jh
Branches: RELENG_7
Diff to: previous 1.174.2.8: preferred, colored; branchpoint 1.174: preferred, colored
Changes since revision 1.174.2.8: +1 -1 lines
SVN rev 200212 on 2009-12-07 13:38:10Z by jh

MFC r197525:

Ensure that tv_sec is between INT32_MIN and INT32_MAX, so ZFS won't object.
This completes the fix from r185586.

Approved by:	trasz (mentor)

Revision 1.199: download - view: text, markup, annotated - select for diffs
Thu Dec 3 20:59:28 2009 UTC (2 years, 2 months ago) by jhb
Branches: MAIN
Diff to: previous 1.198: preferred, colored
Changes since revision 1.198: +3 -4 lines
SVN rev 200084 on 2009-12-03 20:59:28Z by jhb

Properly return an error reply if an NFS remove or link operation fails.
Previously the failing operation would allocate an mbuf and construct an
error reply, but because the function did not return 0, the NFS server
assumed it had failed to generate a reply and would leak the reply mbuf as
well as not sending the reply to the NFS client.

PR:		kern/140853
Submitted by:	Ted Faber  faber at isi edu (remove)
Reviewed by:	rmacklem (remove)
MFC after:	1 week

Revision 1.195.2.3.2.1: download - view: text, markup, annotated - select for diffs
Sun Oct 25 01:10:29 2009 UTC (2 years, 3 months ago) by kensmith
Branches: RELENG_8_0
CVS tags: RELENG_8_0_0_RELEASE
Diff to: previous 1.195.2.3: preferred, colored; next MAIN 1.195.2.4: preferred, colored
Changes since revision 1.195.2.3: +0 -0 lines
SVN rev 198460 on 2009-10-25 01:10:29Z by kensmith

Copy stable/8 to releng/8.0 as part of 8.0-RELEASE release procedure.

Approved by:	re (implicit)

Revision 1.195.2.3: download - view: text, markup, annotated - select for diffs
Tue Sep 29 10:53:06 2009 UTC (2 years, 4 months ago) by pjd
Branches: RELENG_8
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.195.2.2: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.2: +1 -1 lines
SVN rev 197613 on 2009-09-29 10:53:06Z by pjd

MFC r197287, r197289, r197351, r197426, r197458, r197459, r197497, r197498,
r197512, r197513, r197514, r197515, r197525:

r197287:

Purge namecache for the file system being rolled back, so it doesn't point at
invalid vnodes after the rollback resulting in EIO errors when trying to access
files which are in the namecache.

Reported by:	des

r197289:

Purge file system namecache when receiving incremental stream and rolling back
to it.

r197351:

Purge namecache in the same place OpenSolaris does.

r197426:

Restore BSD behaviour - when creating new directory entry use parent directory
gid to set group ownership and not process gid.

This was overlooked during v6 -> v13 switch.

PR:	kern/139076
Reported by:	Sean Winn <sean@gothic.net.au>

r197458:

Close race in zfs_zget(). We have to increase usecount first and then
check for VI_DOOMED flag. Before this change vnode could be reclaimed
between checking for the flag and increasing usecount.

r197459:

Before calling vflush(FORCECLOSE) mark file system as unmounted so the
following vnops will fail. This is very important, because without this change
vnode could be reclaimed at any point, even if we increased usecount. The only
way to ensure that vnode won't be reclaimed was to lock it, which would be very
hard to do in ZFS without changing a lot of code. With this change simply
increasing usecount is enough to be sure vnode won't be reclaimed from under
us. To be precise it can still be reclaimed but we won't be able to see it,
because every try to enter ZFS through VFS will result in EIO.

The only function that cannot return EIO, because it is needed for vflush() is
zfs_root(). Introduce ZFS_ENTER_NOERROR() macro that only locks
z_teardown_lock and never returns EIO.

r197497:

Switch to fletcher4 as the default checksum algorithm. Fletcher2 was proven to
be a bit weak and OpenSolaris also switched to fletcher4.

r197498:	head/cddl/contrib/opensolaris

Fletcher4 is not the default checksum algorithm.

r197512:

- Don't depend on value returned by gfs_*_inactive(), it doesn't work
  well with forced unmounts when GFS vnodes are referenced.
- Make other preparations to GFS for forced unmounts.

PR:	kern/139062
Reported by:	trasz

r197513:

Use traverse() function to find and return mount point's vnode instead of
covered vnode when snapshot is already mounted.

r197514:

On lookup error VFS expects *vpp to be set to NULL, be sure to do that.

r197515:

Handle cases where virtual (GFS) vnodes are referenced when doing forced
unmount. In that case we cannot depend on the proper order of invalidating
vnodes, so we have to free resources when we have a chance.

PR:	kern/139062
Reported by:	trasz

r197525:

Ensure that tv_sec is between INT32_MIN and INT32_MAX, so ZFS won't object.
This completes the fix from r185586.

PR:	kern/139059
Reported by:	Daniel Braniss <danny@cs.huji.ac.il>
Submitted by:	Jaakko Heinonen <jh@saunalahti.fi>
Tested by:	Daniel Braniss <danny@cs.huji.ac.il>

Approved by:	re (kib)

Revision 1.198: download - view: text, markup, annotated - select for diffs
Sat Sep 26 18:23:16 2009 UTC (2 years, 4 months ago) by pjd
Branches: MAIN
Diff to: previous 1.197: preferred, colored
Changes since revision 1.197: +1 -1 lines
SVN rev 197525 on 2009-09-26 18:23:16Z by pjd

Ensure that tv_sec is between INT32_MIN and INT32_MAX, so ZFS won't object.
This completes the fix from r185586.

PR:		kern/139059
Reported by:	Daniel Braniss <danny@cs.huji.ac.il>
Submitted by:	Jaakko Heinonen <jh@saunalahti.fi>
Tested by:	Daniel Braniss <danny@cs.huji.ac.il>
MFC after:	3 days

Revision 1.195.2.2: download - view: text, markup, annotated - select for diffs
Tue Sep 15 11:20:23 2009 UTC (2 years, 4 months ago) by pjd
Branches: RELENG_8
Diff to: previous 1.195.2.1: preferred, colored; branchpoint 1.195: preferred, colored
Changes since revision 1.195.2.1: +2 -2 lines
SVN rev 197216 on 2009-09-15 11:20:23Z by pjd

MFC r197039, r197040:

Fix usecount leak in mknod(2) on file system exported over NFS.

While I'm here, correct typo in comment.

Reviewed by:	kan, kib
Approved by:	re (bz)

Revision 1.197: download - view: text, markup, annotated - select for diffs
Wed Sep 9 13:23:26 2009 UTC (2 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.196: preferred, colored
Changes since revision 1.196: +1 -1 lines
SVN rev 197040 on 2009-09-09 13:23:26Z by pjd

Correct typo after manual patching.

Noticed by:	b. f.

Revision 1.196: download - view: text, markup, annotated - select for diffs
Wed Sep 9 12:56:05 2009 UTC (2 years, 5 months ago) by pjd
Branches: MAIN
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +2 -2 lines
SVN rev 197039 on 2009-09-09 12:56:05Z by pjd

Fix usecount leak in mknod(2) on file system exported over NFS.

While I'm here, correct typo in comment.

Reviewed by:	kan, kib
MFC after:	3 days

Revision 1.195.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 3 08:13:06 2009 UTC (2 years, 6 months ago) by kensmith
Branches: RELENG_8
Diff to: previous 1.195: preferred, colored
Changes since revision 1.195: +0 -0 lines
SVN rev 196045 on 2009-08-03 08:13:06Z by kensmith

Copy head to stable/8 as part of 8.0 Release cycle.

Approved by:	re (Implicit)

Revision 1.174.2.8: download - view: text, markup, annotated - select for diffs
Wed Jul 1 12:44:23 2009 UTC (2 years, 7 months ago) by avg
Branches: RELENG_7
Diff to: previous 1.174.2.7: preferred, colored; branchpoint 1.174: preferred, colored
Changes since revision 1.174.2.7: +8 -7 lines
SVN rev 195236 on 2009-07-01 12:44:23Z by avg

MFC 185586 (kan): Change nfsserver slightly so that it does not trip
over the timestamp validation code on ZFS.

This should fix O_CREAT|O_EXCL open on NFS where a server is 64-bit
with v13 ZFS code.

PR:		kern/135412
Pointed out by:	Jaakko Heinonen <jh@saunalahti.fi>
Tested by:	Jaakko Heinonen, Danny Braniss <danny@cs.huji.ac.il>

Revision 1.195: download - view: text, markup, annotated - select for diffs
Tue Jun 30 19:03:27 2009 UTC (2 years, 7 months ago) by dfr
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.194: preferred, colored
Changes since revision 1.194: +0 -424 lines
SVN rev 195202 on 2009-06-30 19:03:27Z by dfr

Remove the old kernel RPC implementation and the NFS_LEGACYRPC option.

Approved by: re

Revision 1.194: download - view: text, markup, annotated - select for diffs
Mon May 11 15:33:26 2009 UTC (2 years, 9 months ago) by attilio
Branches: MAIN
Diff to: previous 1.193: preferred, colored
Changes since revision 1.193: +2 -2 lines
SVN rev 191990 on 2009-05-11 15:33:26Z by attilio

Remove the thread argument from the FSD (File-System Dependent) parts of
the VFS.  Now all the VFS_* functions and relating parts don't want the
context as long as it always refers to curthread.

In some points, in particular when dealing with VOPs and functions living
in the same namespace (eg. vflush) which still need to be converted,
pass curthread explicitly in order to retain the old behaviour.
Such loose ends will be fixed ASAP.

While here fix a bug: now, UFS_EXTATTR can be compiled alone without the
UFS_EXTATTR_AUTOSTART option.

VFS KPI is heavilly changed by this commit so thirdy parts modules needs
to be recompiled.  Bump __FreeBSD_version in order to signal such
situation.

Revision 1.174.2.7.2.1: download - view: text, markup, annotated - select for diffs
Wed Apr 15 03:14:26 2009 UTC (2 years, 9 months ago) by kensmith
Branches: RELENG_7_2
CVS tags: RELENG_7_2_0_RELEASE
Diff to: previous 1.174.2.7: preferred, colored; next MAIN 1.174.2.8: preferred, colored
Changes since revision 1.174.2.7: +0 -0 lines
SVN rev 191087 on 2009-04-15 03:14:26Z by kensmith

Create releng/7.2 from stable/7 in preparation for 7.2-RELEASE.

Approved by:	re (implicit)

Revision 1.174.2.7: download - view: text, markup, annotated - select for diffs
Wed Mar 18 21:51:02 2009 UTC (2 years, 10 months ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_2_BP
Branch point for: RELENG_7_2
Diff to: previous 1.174.2.6: preferred, colored; branchpoint 1.174: preferred, colored
Changes since revision 1.174.2.6: +2 -2 lines
SVN rev 189991 on 2009-03-18 21:51:02Z by jhb

MFC: Use shared vnode locks when invoking VOP_READDIR().

Revision 1.193: download - view: text, markup, annotated - select for diffs
Fri Feb 13 18:18:14 2009 UTC (2 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.192: preferred, colored
Changes since revision 1.192: +2 -2 lines
SVN rev 188588 on 2009-02-13 18:18:14Z by jhb

Use shared vnode locks when invoking VOP_READDIR().

MFC after:	1 month

Revision 1.174.2.5.2.2: download - view: text, markup, annotated - select for diffs
Fri Dec 19 04:02:16 2008 UTC (3 years, 1 month ago) by kensmith
Branches: RELENG_7_1
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.174.2.5.2.1: preferred, colored; branchpoint 1.174.2.5: preferred, colored; next MAIN 1.174.2.6: preferred, colored
Changes since revision 1.174.2.5.2.1: +6 -3 lines
SVN rev 186310 on 2008-12-19 04:02:16Z by kensmith

MFC r186165:
> Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition
> to failing with that error.
>
> PR:           125149
> Submitted by: Jaakko Heinonen (jh <at> saunalahti <dot> fi)
> Reviewed by:  mohans, kan

Approved by:    re (kib)

Revision 1.174.2.6: download - view: text, markup, annotated - select for diffs
Fri Dec 19 03:59:20 2008 UTC (3 years, 1 month ago) by kensmith
Branches: RELENG_7
Diff to: previous 1.174.2.5: preferred, colored; branchpoint 1.174: preferred, colored
Changes since revision 1.174.2.5: +6 -3 lines
SVN rev 186309 on 2008-12-19 03:59:20Z by kensmith

MFC r186165:
> Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition
> to failing with that error.
>
> PR:           125149
> Submitted by: Jaakko Heinonen (jh <at> saunalahti <dot> fi)
> Reviewed by:  mohans, kan

Approved by:	re (kib)

Revision 1.192: download - view: text, markup, annotated - select for diffs
Tue Dec 16 04:34:09 2008 UTC (3 years, 1 month ago) by kensmith
Branches: MAIN
Diff to: previous 1.191: preferred, colored
Changes since revision 1.191: +6 -3 lines
SVN rev 186165 on 2008-12-16 04:34:09Z by kensmith

Handle VFS_VGET() failing with an error other than EOPNOTSUPP in addition
to failing with that error.

PR:		125149
Submitted by:	Jaakko Heinonen (jh <at> saunalahti <dot> fi)
Reviewed by:	mohans, kan
MFC after:	3 days

Revision 1.191: download - view: text, markup, annotated - select for diffs
Wed Dec 3 17:54:09 2008 UTC (3 years, 2 months ago) by kan
Branches: MAIN
Diff to: previous 1.190: preferred, colored
Changes since revision 1.190: +8 -7 lines
SVN rev 185586 on 2008-12-03 17:54:09Z by kan

Change nfsserver slightly so that it does not trip over the timestamp
validation code on ZFS.

Problem: when opening file with O_CREAT|O_EXCL NFS has to jump through
extra hoops to ensure O_EXCL semantics. Namely, client supplies of 8
bytes (NFSX_V3CREATEVERF) bytes of verification data to uniquely
identify this create request. Server then creates a new file with access
mode 0, copies received 8 bytes into va_atime member of struct vattr and
attempt to set the atime on file using VOP_SETATTR. If that succeeds, it
fetches file attributes with VOP_GETATTR and verifies that atime
timestamps match.  If timestamps do not match, NFS server concludes it
has probbaly lost the race to another process creating the file with the
same name and bails with EEXIST.

This scheme works OK when exported FS is FFS, but if underlying
filesystem is ZFS _and_ server is running 64bit kernel, it breaks down
due to sanity checking in zfs_setattr function, which refuses to accept
any timestamps which have tv_sec that cannot be represented as 32bit
int. Since struct timespec fields are 64 bit integers on 64bit platforms
and server just copies NFSX_V3CREATEVERF bytes info va_atime, all eight
bytes supplied by client end up in va_atime.tv_sec, forcing it out of
valid 32bit range.

The solution this change implements is simple: it treats
NFSX_V3CREATEVERF as two 32bit integers and unpacks them separately into
va_atime.tv_sec and va_atime.tv_nsec respectively, thus guaranteeing
that tv_sec remains in 32 bit range and ZFS remains happy.

Reviewed by: kib

Revision 1.174.2.5.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 25 02:59:29 2008 UTC (3 years, 2 months ago) by kensmith
Branches: RELENG_7_1
Diff to: previous 1.174.2.5: preferred, colored
Changes since revision 1.174.2.5: +0 -0 lines
SVN rev 185281 on 2008-11-25 02:59:29Z by kensmith

Create releng/7.1 in preparation for moving into RC phase of 7.1 release
cycle.

Approved by:	re (implicit)

Revision 1.190: download - view: text, markup, annotated - select for diffs
Mon Nov 3 10:38:00 2008 UTC (3 years, 3 months ago) by dfr
Branches: MAIN
Diff to: previous 1.189: preferred, colored
Changes since revision 1.189: +39 -28 lines
SVN rev 184588 on 2008-11-03 10:38:00Z by dfr

Implement support for RPCSEC_GSS authentication to both the NFS client
and server. This replaces the RPC implementation of the NFS client and
server with the newer RPC implementation originally developed
(actually ported from the userland sunrpc code) to support the NFS
Lock Manager.  I have tested this code extensively and I believe it is
stable and that performance is at least equal to the legacy RPC
implementation.

The NFS code currently contains support for both the new RPC
implementation and the older legacy implementation inherited from the
original NFS codebase. The default is to use the new implementation -
add the NFS_LEGACYRPC option to fall back to the old code. When I
merge this support back to RELENG_7, I will probably change this so
that users have to 'opt in' to get the new code.

To use RPCSEC_GSS on either client or server, you must build a kernel
which includes the KGSSAPI option and the crypto device. On the
userland side, you must build at least a new libc, mountd, mount_nfs
and gssd. You must install new versions of /etc/rc.d/gssd and
/etc/rc.d/nfsd and add 'gssd_enable=YES' to /etc/rc.conf.

As long as gssd is running, you should be able to mount an NFS
filesystem from a server that requires RPCSEC_GSS authentication. The
mount itself can happen without any kerberos credentials but all
access to the filesystem will be denied unless the accessing user has
a valid ticket file in the standard place (/tmp/krb5cc_<uid>). There
is currently no support for situations where the ticket file is in a
different place, such as when the user logged in via SSH and has
delegated credentials from that login. This restriction is also
present in Solaris and Linux. In theory, we could improve this in
future, possibly using Brooks Davis' implementation of variant
symlinks.

Supporting RPCSEC_GSS on a server is nearly as simple. You must create
service creds for the server in the form 'nfs/<fqdn>@<REALM>' and
install them in /etc/krb5.keytab. The standard heimdal utility ktutil
makes this fairly easy. After the service creds have been created, you
can add a '-sec=krb5' option to /etc/exports and restart both mountd
and nfsd.

The only other difference an administrator should notice is that nfsd
doesn't fork to create service threads any more. In normal operation,
there will be two nfsd processes, one in userland waiting for TCP
connections and one in the kernel handling requests. The latter
process will create as many kthreads as required - these should be
visible via 'top -H'. The code has some support for varying the number
of service threads according to load but initially at least, nfsd uses
a fixed number of threads according to the value supplied to its '-n'
option.

Sponsored by:	Isilon Systems
MFC after:	1 month

Revision 1.189: download - view: text, markup, annotated - select for diffs
Sun Nov 2 17:00:23 2008 UTC (3 years, 3 months ago) by trhodes
Branches: MAIN
Diff to: previous 1.188: preferred, colored
Changes since revision 1.188: +4 -2 lines
SVN rev 184561 on 2008-11-02 17:00:23Z by trhodes

Document a few sysctls in the NFS client and server code.
Minor style(9) where applicable.

Approved by:	alfred (slightly older version)

Revision 1.188: download - view: text, markup, annotated - select for diffs
Tue Oct 28 13:44:11 2008 UTC (3 years, 3 months ago) by trasz
Branches: MAIN
Diff to: previous 1.187: preferred, colored
Changes since revision 1.187: +6 -5 lines
SVN rev 184413 on 2008-10-28 13:44:11Z by trasz

Introduce accmode_t.  This is required for NFSv4 ACLs - it will be neccessary
to add more V* constants, and the variables changed by this patch were often
being assigned to mode_t variables, which is 16 bit.

Approved by:	rwatson (mentor)

Revision 1.187: download - view: text, markup, annotated - select for diffs
Thu Oct 23 15:53:51 2008 UTC (3 years, 3 months ago) by des
Branches: MAIN
Diff to: previous 1.186: preferred, colored
Changes since revision 1.186: +19 -19 lines
SVN rev 184205 on 2008-10-23 15:53:51Z by des

Retire the MALLOC and FREE macros.  They are an abomination unto style(9).

MFC after:	3 months

Revision 1.174.2.5: download - view: text, markup, annotated - select for diffs
Tue Oct 21 14:11:00 2008 UTC (3 years, 3 months ago) by rwatson
Branches: RELENG_7
CVS tags: RELENG_7_1_BP
Branch point for: RELENG_7_1
Diff to: previous 1.174.2.4: preferred, colored; branchpoint 1.174: preferred, colored
Changes since revision 1.174.2.4: +2 -2 lines
SVN rev 184126 on 2008-10-21 14:11:00Z by rwatson

Merge r183809 from head to stable/7:

  Turn XXX's for unlocked writes of NFS server statistics to simple notes,
  as we consider it a feature to exchange performance for consistency.

Approved by:	re (kib)

Revision 1.186: download - view: text, markup, annotated - select for diffs
Sun Oct 12 20:06:59 2008 UTC (3 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.185: preferred, colored
Changes since revision 1.185: +2 -2 lines
SVN rev 183809 on 2008-10-12 20:06:59Z by rwatson

Turn XXX's for unlocked writes of NFS server statistics to simple notes,
as we consider it a feature to exchange performance for consistency.

MFC after:	3 days

Revision 1.156.2.8.4.1: download - view: text, markup, annotated - select for diffs
Thu Oct 2 02:57:24 2008 UTC (3 years, 4 months ago) by kensmith
Branches: RELENG_6_4
CVS tags: RELENG_6_4_0_RELEASE
Diff to: previous 1.156.2.8: preferred, colored; next MAIN 1.156.2.9: preferred, colored
Changes since revision 1.156.2.8: +0 -0 lines
SVN rev 183531 on 2008-10-02 02:57:24Z by kensmith

Create releng/6.4 from stable/6 in preparation for 6.4-RC1.

Approved by:	re (implicit)

Revision 1.185: download - view: text, markup, annotated - select for diffs
Wed Sep 17 15:49:44 2008 UTC (3 years, 4 months ago) by attilio
Branches: MAIN
Diff to: previous 1.184: preferred, colored
Changes since revision 1.184: +4 -2 lines
SVN rev 183113 on 2008-09-17 15:49:44Z by attilio

Remove the suser(9) interface from the kernel. It has been replaced from
years by the priv_check(9) interface and just very few places are left.
Note that compatibility stub with older FreeBSD version
(all above the 8 limit though) are left in order to reduce diffs against
old versions. It is responsibility of the maintainers for any module, if
they think it is the case, to axe out such cases.

This patch breaks KPI so __FreeBSD_version will be bumped into a later
commit.

This patch needs to be credited 50-50 with rwatson@ as he found time to
explain me how the priv_check() works in detail and to review patches.

Tested by:      Giovanni Trematerra <giovanni dot trematerra at gmail dot com>
Reviewed by:    rwatson

Revision 1.184: download - view: text, markup, annotated - select for diffs
Tue Sep 16 21:57:39 2008 UTC (3 years, 4 months ago) by attilio
Branches: MAIN
Diff to: previous 1.183: preferred, colored
Changes since revision 1.183: +55 -58 lines
SVN rev 183103 on 2008-09-16 21:57:39Z by attilio

Decontext-alize the nfsserver module.
Now, only some few places still require thread passing (mostly the ones which
access to VOP_* functions) and will be fixed once the primitive also will be.

Tested by:	Giovanni Trematerra <giovanni dot trematerra at gmail dot com>

Revision 1.183: download - view: text, markup, annotated - select for diffs
Thu Aug 28 15:23:18 2008 UTC (3 years, 5 months ago) by attilio
Branches: MAIN
Diff to: previous 1.182: preferred, colored
Changes since revision 1.182: +47 -49 lines
SVN rev 182371 on 2008-08-28 15:23:18Z by attilio

Decontextualize the couplet VOP_GETATTR / VOP_SETATTR as the passed thread
was always curthread and totally unuseful.

Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com>

Revision 1.174.2.4: download - view: text, markup, annotated - select for diffs
Fri May 30 12:27:19 2008 UTC (3 years, 8 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.174.2.3: preferred, colored; branchpoint 1.174: preferred, colored
Changes since revision 1.174.2.3: +2 -6 lines
MFC rev. 1.182
Change the fix in the rev. 1.178 to use nfsrv_lockedpair_nd().

Revision 1.174.2.3: download - view: text, markup, annotated - select for diffs
Fri May 30 12:25:29 2008 UTC (3 years, 8 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.174.2.2: preferred, colored; branchpoint 1.174: preferred, colored
Changes since revision 1.174.2.2: +3 -0 lines
MFC rev. 1.181:
Initialize vfslocked prior to calling nfsm_srvmtofh where it was forgotten.

Revision 1.182: download - view: text, markup, annotated - select for diffs
Wed May 28 16:23:17 2008 UTC (3 years, 8 months ago) by kib
Branches: MAIN
Diff to: previous 1.181: preferred, colored
Changes since revision 1.181: +2 -6 lines
Change the fix in the rev. 1.179 to use nfsrv_lockedpair_nd().

Tested by:	pho
MFC after:	3 days

Revision 1.181: download - view: text, markup, annotated - select for diffs
Wed May 28 16:21:32 2008 UTC (3 years, 8 months ago) by kib
Branches: MAIN
Diff to: previous 1.180: preferred, colored
Changes since revision 1.180: +3 -0 lines
Initialize vfslocked prior to calling nfsm_srvmtofh where it was forgotten.

Reported by:	Andrew Edwards <aedwards sandvine com>
Tested by:	pho
MFC after:	3 days

Revision 1.180: download - view: text, markup, annotated - select for diffs
Tue Mar 25 09:39:01 2008 UTC (3 years, 10 months ago) by ru
Branches: MAIN
Diff to: previous 1.179: preferred, colored
Changes since revision 1.179: +4 -4 lines
Replaced the misleading uses of a historical artefact M_TRYWAIT with M_WAIT.
Removed dead code that assumed that M_TRYWAIT can return NULL; it's not true
since the advent of MBUMA.

Reviewed by:	arch

There are ongoing disputes as to whether we want to switch to directly using
UMA flags M_WAITOK/M_NOWAIT for mbuf(9) allocation.

Revision 1.179: download - view: text, markup, annotated - select for diffs
Sat Mar 22 09:15:15 2008 UTC (3 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.178: preferred, colored
Changes since revision 1.178: +7 -8 lines
 - Complete part of the unfinished bufobj work by consistently using
   BO_LOCK/UNLOCK/MTX when manipulating the bufobj.
 - Create a new lock in the bufobj to lock bufobj fields independently.
   This leaves the vnode interlock as an 'identity' lock while the bufobj
   is an io lock.  The bufobj lock is ordered before the vnode interlock
   and also before the mnt ilock.
 - Exploit this new lock order to simplify softdep_check_suspend().
 - A few sync related functions are marked with a new XXX to note that
   we may not properly interlock against a non-zero bv_cnt when
   attempting to sync all vnodes on a mountlist.  I do not believe this
   race is important.  If I'm wrong this will make these locations easier
   to find.

Reviewed by:	kib (earlier diff)
Tested by:	kris, pho (earlier diff)

Revision 1.174.2.2: download - view: text, markup, annotated - select for diffs
Sun Mar 9 13:55:51 2008 UTC (3 years, 11 months ago) by kib
Branches: RELENG_7
Diff to: previous 1.174.2.1: preferred, colored; branchpoint 1.174: preferred, colored
Changes since revision 1.174.2.1: +6 -2 lines
MFC rev. 1.178:
Fix the Giant leak in the nfsrv_remove().

Revision 1.178: download - view: text, markup, annotated - select for diffs
Tue Mar 4 11:05:03 2008 UTC (3 years, 11 months ago) by kib
Branches: MAIN
Diff to: previous 1.177: preferred, colored
Changes since revision 1.177: +6 -2 lines
Fix the Giant leak in the nfsrv_remove().

Reported by:	pluknet <pluknet gmail com>
MFC after:	1 week

Revision 1.177: download - view: text, markup, annotated - select for diffs
Sun Jan 13 14:44:12 2008 UTC (4 years ago) by attilio
Branches: MAIN
Diff to: previous 1.176: preferred, colored
Changes since revision 1.176: +16 -16 lines
VOP_LOCK1() (and so VOP_LOCK()) and VOP_UNLOCK() are only used in
conjuction with 'thread' argument passing which is always curthread.
Remove the unuseful extra-argument and pass explicitly curthread to lower
layer functions, when necessary.

KPI results broken by this change, which should affect several ports, so
version bumping and manpage update will be further committed.

Tested by: kris, pho, Diego Sardina <siarodx at gmail dot com>

Revision 1.176: download - view: text, markup, annotated - select for diffs
Thu Jan 10 01:10:55 2008 UTC (4 years, 1 month ago) by attilio
Branches: MAIN
Diff to: previous 1.175: preferred, colored
Changes since revision 1.175: +13 -13 lines
vn_lock() is currently only used with the 'curthread' passed as argument.
Remove this argument and pass curthread directly to underlying
VOP_LOCK1() VFS method. This modify makes the code cleaner and in
particular remove an annoying dependence helping next lockmgr() cleanup.
KPI results, obviously, changed.

Manpage and FreeBSD_version will be updated through further commits.

As a side note, would be valuable to say that next commits will address
a similar cleanup about VFS methods, in particular vop_lock1 and
vop_unlock.

Tested by:	Diego Sardina <siarodx at gmail dot com>,
		Andrea Di Pasquale <whyx dot it at gmail dot com>

Revision 1.156.2.8: download - view: text, markup, annotated - select for diffs
Fri Oct 26 22:06:54 2007 UTC (4 years, 3 months ago) by jhb
Branches: RELENG_6
CVS tags: RELENG_6_4_BP, RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3
Branch point for: RELENG_6_4
Diff to: previous 1.156.2.7: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.7: +1 -1 lines
MFC: Add a -z flag to nfsstat which zeros the NFS statistics after
displaying them.

Revision 1.174.2.1: download - view: text, markup, annotated - select for diffs
Fri Oct 26 21:46:31 2007 UTC (4 years, 3 months ago) by jhb
Branches: RELENG_7
CVS tags: RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +1 -1 lines
MFC: Add a -z flag to nfsstat which zeros the NFS statistics after
displaying them.

Approved by:	re (kensmith)

Revision 1.175: download - view: text, markup, annotated - select for diffs
Thu Oct 18 16:38:07 2007 UTC (4 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.174: preferred, colored
Changes since revision 1.174: +1 -1 lines
Add a -z flag to nfsstat which zeros the NFS statistics after displaying
them.

MFC after:	1 week
Requested by:	ps
Submitted by:	ps (6 years ago)

Revision 1.174: download - view: text, markup, annotated - select for diffs
Wed Jun 13 22:42:43 2007 UTC (4 years, 7 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_7_BP
Branch point for: RELENG_7
Diff to: previous 1.173: preferred, colored
Changes since revision 1.173: +1 -0 lines
Include priv.h to pick up suser(9) definitions, missed in an earlier
commit.

Warnings spotted by:	kris

Revision 1.173: download - view: text, markup, annotated - select for diffs
Sun Jun 10 04:42:20 2007 UTC (4 years, 8 months ago) by mjacob
Branches: MAIN
Diff to: previous 1.172: preferred, colored
Changes since revision 1.172: +1 -1 lines
Init timespec to zero fo quiesce warnings.

Revision 1.172: download - view: text, markup, annotated - select for diffs
Mon Mar 26 15:14:58 2007 UTC (4 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.171: preferred, colored
Changes since revision 1.171: +1 -0 lines
Initialize vfslocked to 0 before nfsm_srvmtofh() so that the variable is
not used uninitialized in 'nfsmout' if nfsm_srvmtofh() gets an internal
error.

CID:		1766
Found by:	Coverity Prevent (tm)

Revision 1.171: download - view: text, markup, annotated - select for diffs
Sat Mar 17 18:18:08 2007 UTC (4 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.170: preferred, colored
Changes since revision 1.170: +187 -554 lines
 - Turn all explicit giant acquires into conditional VFS_LOCK_GIANTs.
   Only ops which used namei still remained.
 - Implement a scheme for reducing the overhead of tracking which vops
   require giant by constantly reducing the number of recursive giant
   acquires to one, leaving us with only one vfslocked variable.
 - Remove all NFSD lock acquisition and release from the individual nfs
   ops.  Careful examination has shown that they are not required.  This
   greatly simplifies the code.

Sponsored by:	Isilon Systems, Inc.
Discussed with:	rwatson
Tested by:	kkenn
Approved by:	re

Revision 1.170: download - view: text, markup, annotated - select for diffs
Thu Feb 15 22:08:35 2007 UTC (4 years, 11 months ago) by pjd
Branches: MAIN
Diff to: previous 1.169: preferred, colored
Changes since revision 1.169: +6 -6 lines
Move vnode-to-file-handle translation from vfs_vptofh to vop_vptofh method.
This way we may support multiple structures in v_data vnode field within
one file system without using black magic.

Vnode-to-file-handle should be VOP in the first place, but was made VFS
operation to keep interface as compatible as possible with SUN's VFS.
BTW. Now Solaris also implements vnode-to-file-handle as VOP operation.

VFS_VPTOFH() was left for API backward compatibility, but is marked for
removal before 8.0-RELEASE.

Approved by:	mckusick
Discussed with:	many (on IRC)
Tested with:	ufs, msdosfs, cd9660, nullfs and zfs

Revision 1.156.2.2.2.1: download - view: text, markup, annotated - select for diffs
Wed Feb 14 22:30:33 2007 UTC (4 years, 11 months ago) by cperciva
Branches: RELENG_6_1
Diff to: previous 1.156.2.2: preferred, colored; next MAIN 1.156.2.3: preferred, colored
Changes since revision 1.156.2.2: +24 -6 lines
Correct problems with locking, namei leakage, and symlink
creation in the NFS subsystem.

Approved by:	so (cperciva)
Submitted by:	re (hrs)
Errata:		FreeBSD-EN-07:01.nfs

Revision 1.156.4.1: download - view: text, markup, annotated - select for diffs
Wed Feb 14 22:29:57 2007 UTC (4 years, 11 months ago) by cperciva
Branches: RELENG_6_0
Diff to: previous 1.156: preferred, colored; next MAIN 1.157: preferred, colored
Changes since revision 1.156: +80 -68 lines
Correct problems with locking, namei leakage, and symlink
creation in the NFS subsystem.

Approved by:	so (cperciva)
Submitted by:	re (hrs)
Errata:		FreeBSD-EN-07:01.nfs

Revision 1.169: download - view: text, markup, annotated - select for diffs
Tue Feb 13 03:27:45 2007 UTC (4 years, 11 months ago) by mpp
Branches: MAIN
Diff to: previous 1.168: preferred, colored
Changes since revision 1.168: +9 -3 lines
Get the vfs giant lock before calling nfs_access.

Reviewed by:	mohan

Revision 1.156.2.6.2.1: download - view: text, markup, annotated - select for diffs
Sat Dec 2 09:02:30 2006 UTC (5 years, 2 months ago) by pjd
Branches: RELENG_6_2
CVS tags: RELENG_6_2_0_RELEASE
Diff to: previous 1.156.2.6: preferred, colored; next MAIN 1.156.2.7: preferred, colored
Changes since revision 1.156.2.6: +6 -5 lines
MFC:	sys/nfsserver/nfs_serv.c	1.167

Protect nfsm_srvpathsiz() call with the nfsd_mtx lock.

Reviewed by:	mohans
Requested by:	kib
Approved by:	re (rwatson)

Revision 1.156.2.7: download - view: text, markup, annotated - select for diffs
Sat Dec 2 09:00:09 2006 UTC (5 years, 2 months ago) by pjd
Branches: RELENG_6
Diff to: previous 1.156.2.6: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.6: +6 -5 lines
MFC:	sys/nfsserver/nfs_serv.c	1.167

Protect nfsm_srvpathsiz() call with the nfsd_mtx lock.

Reviewed by:	mohans
Requested by:	kib

Revision 1.168: download - view: text, markup, annotated - select for diffs
Fri Nov 24 11:53:16 2006 UTC (5 years, 2 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.167: preferred, colored
Changes since revision 1.167: +263 -213 lines
Push Giant a bit further off the NFS server in a number of straight
forward cases by converting from unconditional acquisition of Giant
around vnode operations to conditional acquisition:

- Remove nfsrv_access_withgiant(), and cause nfsrv_access() to now
  assert that Giant will be held if it is required for the vnode.

- Add nfsrv_fhtovp_locked(), which will drop the NFS server lock if
  required, and modify nfsrv_fhtovp() to conditionally acquire
  Giant if required.

- In the VOP's not dealing with more than one vnode at a time (i.e.,
  not involving a lookup), conditionally acquire Giant.

This removes Giant use for MPSAFE file systems for a number of quite
important RPCs, including getattr, read, write.  It leaves
unconditional Giant acquisitions in vnode operations that interact
with the name space or more than one vnode at a time as these
require further work.

Tested by:	kris
Reviewed by:	kib

Revision 1.167: download - view: text, markup, annotated - select for diffs
Mon Nov 20 07:32:52 2006 UTC (5 years, 2 months ago) by pjd
Branches: MAIN
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +6 -5 lines
Protect nfsm_srvpathsiz() call with the nfsd_mtx lock.

Reviewed by:	mohans

Revision 1.156.2.6: download - view: text, markup, annotated - select for diffs
Fri Nov 3 09:16:48 2006 UTC (5 years, 3 months ago) by kib
Branches: RELENG_6
CVS tags: RELENG_6_2_BP
Branch point for: RELENG_6_2
Diff to: previous 1.156.2.5: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.5: +2 -2 lines
MFC rev. 1.166:
Fix leak in NAMEI zone caused by nfs server when VOP_RENAME fails.

Approved by:	re (hrs)

Revision 1.166: download - view: text, markup, annotated - select for diffs
Thu Oct 26 12:41:53 2006 UTC (5 years, 3 months ago) by kib
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +2 -2 lines
Fix leak in NAMEI zone caused by nfs server when VOP_RENAME fails.

Submitted by:	Padma Bhooma <pbhooma at panasas com>
Reviewed by:	bde
Approved by:	pjd (mentor)
MFC after:	1 week

Revision 1.156.2.5: download - view: text, markup, annotated - select for diffs
Wed Sep 27 00:37:46 2006 UTC (5 years, 4 months ago) by tegge
Branches: RELENG_6
Diff to: previous 1.156.2.4: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.4: +11 -0 lines
MFC: Release references acquired by VOP_GETWRITEMOUNT() and vfs_getvfs().

Approved by:	re (kensmith)

Revision 1.156.2.4: download - view: text, markup, annotated - select for diffs
Sat Sep 2 21:54:08 2006 UTC (5 years, 5 months ago) by csjp
Branches: RELENG_6
Diff to: previous 1.156.2.3: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.3: +24 -24 lines
MFC revision 1.79 nfs.h
MFC revision 1.161 nfs_serv.c
MFC revision 1.96 nfs_srvsock.c
MFC revision 1.105 nfs_syscalls.c

date: 2006/01/28 19:24:39;  author: csjp;  state: Exp;  lines: +1 -1
Manage the ucred for the NFS server using the crget/crfree API defined in
kern_prot.c. This API handles reference counting among many other things.
Notably, if MAC is compiled into the kernel, it will properly initialize the
MAC labels when the ucred is allocated.

This work is in preparation for a new MAC entry point which will be responsible
for properly initializing policy specific labels for the NFS server credential.
Utilization of the crfree/crget APIs reduce the complexity associated with
this label's management.

Submitted by:	green (with changes) [1]
Obtained from:	TrustedBSD Project
Discussed with:	rwatson, alfred

[1] I moved the ucred allocation outside the scope of the NFS server lock to
    prevent M_WAIKOK allocations from occurring with non-sleep-able locks held.
    Additionally, to reduce complexity, the ucred persist as long as the NFS
    server descriptor.

Revision 1.156.2.3: download - view: text, markup, annotated - select for diffs
Tue Jun 13 10:50:29 2006 UTC (5 years, 7 months ago) by kib
Branches: RELENG_6
Diff to: previous 1.156.2.2: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.2: +16 -0 lines
MFC of the temporary fix for nfsd leaking GIANT.

src/sys/nfsserver/nfs_serv.c rev. 1.165
src/sys/nfsserver/nfs_srvsubs.c rev. 1.141

Approved by:	pjd (mentor)

Revision 1.165: download - view: text, markup, annotated - select for diffs
Mon Jun 5 14:48:02 2006 UTC (5 years, 8 months ago) by kib
Branches: MAIN
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +16 -0 lines
Temporary workaround to prevent leak of Giant from nfsd when calling
lookup().

Reviewed by:	tegge
Tested by:	"Arno J. Klaassen" <arno at heho snv jussieu fr>, "Rong-en Fan" <grafan at gmail com>, Dmitriy Kirhlarov <dimma at higis ru>, Dmitry Pryanishnikov <dmitry at atlantis dp ua>
MFC after:	1 week
Approved by:	kan, pjd (mentors)

Revision 1.164: download - view: text, markup, annotated - select for diffs
Fri Mar 31 03:54:19 2006 UTC (5 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +11 -0 lines
 - Release the references acquired by VOP_GETWRITEMOUNT and vfs_getvfs().

Discussed with:	tegge
Tested by:	kris
Sponsored by:	Isilon Systems, Inc.

Revision 1.156.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 13 03:06:49 2006 UTC (5 years, 11 months ago) by jeff
Branches: RELENG_6
CVS tags: RELENG_6_1_BP, RELENG_6_1_0_RELEASE
Branch point for: RELENG_6_1
Diff to: previous 1.156.2.1: preferred, colored; branchpoint 1.156: preferred, colored
Changes since revision 1.156.2.1: +52 -62 lines
MFC Revs 1.163, 1.162
VFS SMP fixes, stack api, softupdates fixes.

Sponsored by:	Isilon Systems, Inc.
Approved by:	re (scottl)

Revision 1.163: download - view: text, markup, annotated - select for diffs
Sun Mar 12 04:59:04 2006 UTC (5 years, 11 months ago) by jeff
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +17 -26 lines
 - Reorder vrele calls after vput calls to prevent lock order reversals
   between leaf and directory locks.

Found by:	kris
Sponsored by:	Isilon Systems, Inc.

Revision 1.162: download - view: text, markup, annotated - select for diffs
Wed Feb 1 00:25:26 2006 UTC (6 years ago) by jeff
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +37 -38 lines
 - Reorder calls to vrele() after calls to vput() when the vrele is a
   directory.  vrele() may lock the passed vnode, which in these cases would
   give an invalid lock order of child -> parent.  These situations are
   deadlock prone although do not typically deadlock because the vrele
   is typically not releasing the last reference to the vnode.  Users of
   vrele must consider it as a call to vn_lock() and order it appropriately.

MFC After: 	1 week
Sponsored by:	Isilon Systems, Inc.
Tested by:	kkenn

Revision 1.161: download - view: text, markup, annotated - select for diffs
Sat Jan 28 19:24:39 2006 UTC (6 years ago) by csjp
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +24 -24 lines
Manage the ucred for the NFS server using the crget/crfree API defined in
kern_prot.c. This API handles reference counting among many other things.
Notably, if MAC is compiled into the kernel, it will properly initialize the
MAC labels when the ucred is allocated.

This work is in preparation for a new MAC entry point which will be responsible
for properly initializing policy specific labels for the NFS server credential.
Utilization of the crfree/crget APIs reduce the complexity associated with
this label's management.

Submitted by:	green (with changes) [1]
Obtained from:	TrustedBSD Project
Discussed with:	rwatson, alfred

[1] I moved the ucred allocation outside the scope of the NFS server lock to
    prevent M_WAIKOK allocations from occurring with non-sleep-able locks held.
    Additionally, to reduce complexity, the ucred persist as long as the NFS
    server descriptor.

Revision 1.160: download - view: text, markup, annotated - select for diffs
Mon Jan 23 21:06:22 2006 UTC (6 years ago) by trhodes
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +11 -0 lines
Revert my previous commit.

Proved I'm not that bright at times:	jhb

Revision 1.159: download - view: text, markup, annotated - select for diffs
Mon Jan 23 17:41:43 2006 UTC (6 years ago) by trhodes
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +7 -7 lines
Fix indentation.

Prodded by:	stefanf, ru, njl (in that order)

Revision 1.158: download - view: text, markup, annotated - select for diffs
Sat Jan 21 12:10:33 2006 UTC (6 years ago) by trhodes
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +7 -18 lines
Remove some dead code.

Found with:     Coverity Prevent(tm)

Revision 1.156.2.1: download - view: text, markup, annotated - select for diffs
Fri Nov 25 14:32:38 2005 UTC (6 years, 2 months ago) by glebius
Branches: RELENG_6
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +4 -0 lines
MFC 1.157:
  Keep locks consistent before goto.

  Reported by:    pho
  Reviewed by:    mohans

Revision 1.157: download - view: text, markup, annotated - select for diffs
Thu Oct 27 19:02:34 2005 UTC (6 years, 3 months ago) by glebius
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +4 -0 lines
Keep locks consistent before goto.

Reported by:	pho
Reviewed by:	mohans

Revision 1.147.2.5: download - view: text, markup, annotated - select for diffs
Fri Jun 10 08:45:58 2005 UTC (6 years, 8 months ago) by rwatson
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5
Diff to: previous 1.147.2.4: preferred, colored; branchpoint 1.147: preferred, colored; next MAIN 1.148: preferred, colored
Changes since revision 1.147.2.4: +23 -1 lines
Merge nfs.h:1.78 and nfs_serv.c:1.156 from HEAD to RELENG_5:

  NFS write gathering defers execution of NFS server write requests to wait
  to see if additional write requests will arrive that can be coalesced and
  clustered with earlier ones.  When doing so, it must determine whether
  the two requests are made by credentials with the same access writes, so
  as not to coalesce improperly.  NFSW_SAMECRED() implements a test of two
  credentials using a binary compare.

  Replace NFSW_SAMECRED() macro with nfsrv_samecred() function, which is
  aware of the contents and layout of a struct ucred, rather than a simple
  binary compare.  While the binary compare works when ucred is simply a
  zero'd and embedded 'struct ucred' in the NFS descriptor, it will work
  less well when the ucred associated with an NFS descriptor is "real", so
  has defined and populated reference count, mutex, etc.

  Obtained from:  TrustedBSD Project

Revision 1.156: download - view: text, markup, annotated - select for diffs
Sun Apr 17 16:25:36 2005 UTC (6 years, 9 months ago) by rwatson
Branches: MAIN
CVS tags: RELENG_6_BP, RELENG_6_0_BP, RELENG_6_0_0_RELEASE
Branch point for: RELENG_6_0, RELENG_6
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +23 -1 lines
NFS write gathering defers execution of NFS server write requests to wait
to see if additional write requests will arrive that can be coalesced and
clustered with earlier ones.  When doing so, it must determine whether
the two requests are made by credentials with the same access writes, so
as not to coalesce improperly.  NFSW_SAMECRED() implements a test of two
credentials using a binary compare.

Replace NFSW_SAMECRED() macro with nfsrv_samecred() function, which is
aware of the contents and layout of a struct ucred, rather than a simple
binary compare.  While the binary compare works when ucred is simply a
zero'd and embedded 'struct ucred' in the NFS descriptor, it will work
less well when the ucred associated with an NFS descriptor is "real", so
has defined and populated reference count, mutex, etc.

MFC after:	1 week
Obtained from:	TrustedBSD Project

Revision 1.147.2.4: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:26:47 2005 UTC (7 years ago) by imp
Branches: RELENG_5
CVS tags: RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.147.2.3: preferred, colored; branchpoint 1.147: preferred, colored
Changes since revision 1.147.2.3: +1 -1 lines
MFC: /*- and related license changes

Revision 1.155: download - view: text, markup, annotated - select for diffs
Mon Jan 24 22:09:13 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +0 -2 lines
Don't try to create vnode_pager objects on other filesystems vnodes,
either they did it themselves or it won't happen.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Wed Jan 19 22:53:40 2005 UTC (7 years ago) by ps
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +21 -21 lines
Now that we have a non blocking version of nfsm_dissect(), change all the
nfsm_dissect() calls (done under the NFSD lock) to nfsm_dissect_nonblock().

Submitted by:	Mohan Srinivasan

Revision 1.153: download - view: text, markup, annotated - select for diffs
Tue Jan 11 07:36:21 2005 UTC (7 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +1 -1 lines
Remove the unused credential argument from VOP_FSYNC() and VFS_SYNC().

I'm not sure why a credential was added to these in the first place, it is
not used anywhere and it doesn't make much sense:

	The credentials for syncing a file (ability to write to the
	file) should be checked at the system call level.

	Credentials for syncing one or more filesystems ("none")
	should be checked at the system call level as well.

	If the filesystem implementation needs a particular credential
	to carry out the syncing it would logically have to the
	cached mount credential, or a credential cached along with
	any delayed write data.

Discussed with:	rwatson

Revision 1.152: download - view: text, markup, annotated - select for diffs
Fri Jan 7 01:45:51 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +1 -1 lines
/* -> /*- for license, minor formatting changes

Revision 1.147.2.1.2.2: download - view: text, markup, annotated - select for diffs
Wed Jan 5 03:35:00 2005 UTC (7 years, 1 month ago) by kensmith
Branches: RELENG_5_3
Diff to: previous 1.147.2.1.2.1: preferred, colored; branchpoint 1.147.2.1: preferred, colored; next MAIN 1.147.2.2: preferred, colored
Changes since revision 1.147.2.1.2.1: +52 -38 lines
MFC of src/sys/nfsserver/nfs_serv.c rev 1.147.2.3:
  Merge nfs_serv.c:1.151 from HEAD to RELENG_5:

    date: 2004/11/11 21:30:52;  author: rwatson;  state: Exp;  lines: +52 -38
    Correct a bug in nfsrv_create() where a call to nfsrv_access() might
    be made holding the NFS server mutex.  To clean this up, introduce a
    version of the function, nfsrv_access_withgiant(), that expects the
    NFS server mutex to already have been dropped and Giant acquired.
    Wrap nfsrv_access() around this.  This permits callers to more
    efficiently check access if they're in a code block performing VFS
    operations, and can be substitited for the nfsrv_access() call that
    triggered this bug.

    PR:             73807, 73208

Approved by:	so (nectar)
Work done by:	rwatson
Errata Notice:	FreeBSD-EN-05:01.nfs

Revision 1.147.2.3: download - view: text, markup, annotated - select for diffs
Fri Nov 19 12:03:22 2004 UTC (7 years, 2 months ago) by rwatson
Branches: RELENG_5
Diff to: previous 1.147.2.2: preferred, colored; branchpoint 1.147: preferred, colored
Changes since revision 1.147.2.2: +52 -38 lines
Merge nfs_serv.c:1.151 from HEAD to RELENG_5:

  date: 2004/11/11 21:30:52;  author: rwatson;  state: Exp;  lines: +52 -38
  Correct a bug in nfsrv_create() where a call to nfsrv_access() might
  be made holding the NFS server mutex.  To clean this up, introduce a
  version of the function, nfsrv_access_withgiant(), that expects the
  NFS server mutex to already have been dropped and Giant acquired.
  Wrap nfsrv_access() around this.  This permits callers to more
  efficiently check access if they're in a code block performing VFS
  operations, and can be substitited for the nfsrv_access() call that
  triggered this bug.

  PR:             73807, 73208
  MFC after:      1 week

RELENG_5_3 candidate.

MFC after:	10 days

Revision 1.151: download - view: text, markup, annotated - select for diffs
Thu Nov 11 21:30:52 2004 UTC (7 years, 2 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +52 -38 lines
Correct a bug in nfsrv_create() where a call to nfsrv_access() might
be made holding the NFS server mutex.  To clean this up, introduce a
version of the function, nfsrv_access_withgiant(), that expects the
NFS server mutex to already have been dropped and Giant acquired.
Wrap nfsrv_access() around this.  This permits callers to more
efficiently check access if they're in a code block performing VFS
operations, and can be substitited for the nfsrv_access() call that
triggered this bug.

PR:		73807, 73208
MFC after:	1 week

Revision 1.150: download - view: text, markup, annotated - select for diffs
Fri Oct 22 08:47:20 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +1 -1 lines
Add b_bufobj to struct buf which eventually will eliminate the need for b_vp.

Initialize b_bufobj for all buffers.

Make incore() and gbincore() take a bufobj instead of a vnode.

Make inmem() local to vfs_bio.c

Change a lot of VI_[UN]LOCK(bp->b_vp) to BO_[UN]LOCK(bp->b_bufobj)
also VI_MTX() to BO_MTX(),

Make buf_vlist_add() take a bufobj instead of a vnode.

Eliminate other uses of bp->b_vp where bp->b_bufobj will do.

Various minor polishing: remove "register", turn panic into KASSERT,
use new function declarations, TAILQ_FOREACH_SAFE() etc.

Revision 1.147.2.1.2.1: download - view: text, markup, annotated - select for diffs
Thu Oct 21 09:01:02 2004 UTC (7 years, 3 months ago) by rwatson
Branches: RELENG_5_3
CVS tags: RELENG_5_3_0_RELEASE
Diff to: previous 1.147.2.1: preferred, colored
Changes since revision 1.147.2.1: +61 -13 lines
Merge nfs_serv.c:1.149 (RELENG_5 1.147.2.2) from HEAD to RELENG_5_3:

  date: 2004/10/18 11:23:11;  author: rwatson;  state: Exp;  lines: +61 -13
  Correct several instances where calls to vfs_getvfs() resulting in
  failure in the NFS server would result in a leaked instance of the NFS
  server subsystem lock.  Liberally sprinkle assertions in all target
  labels for error unwinding to assert the desired locking state.

  RELENG_5_3 candidate.

  MFC after:      3 days
  Reported by:    Wilkinson, Alex <alex dot wilkinson at dsto dot defence dot
                  gov dot au>

Approved by:	re (scottl)

Revision 1.147.2.2: download - view: text, markup, annotated - select for diffs
Wed Oct 20 10:21:16 2004 UTC (7 years, 3 months ago) by rwatson
Branches: RELENG_5
Diff to: previous 1.147.2.1: preferred, colored; branchpoint 1.147: preferred, colored
Changes since revision 1.147.2.1: +61 -13 lines
Merge nfs_server.c:1.149 from HEAD to RELENG_5:

  date: 2004/10/18 11:23:11;  author: rwatson;  state: Exp;  lines: +61 -13
  Correct several instances where calls to vfs_getvfs() resulting in
  failure in the NFS server would result in a leaked instance of the NFS
  server subsystem lock.  Liberally sprinkle assertions in all target
  labels for error unwinding to assert the desired locking state.

  RELENG_5_3 candidate.

  MFC after:      3 days
  Reported by:    Wilkinson, Alex <alex dot wilkinson at dsto dot defence
                  dot govdot au>

MFC after:	1 day
Approved by:	re (scottl)

Revision 1.149: download - view: text, markup, annotated - select for diffs
Mon Oct 18 11:23:11 2004 UTC (7 years, 3 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +61 -13 lines
Correct several instances where calls to vfs_getvfs() resulting in
failure in the NFS server would result in a leaked instance of the NFS
server subsystem lock.  Liberally sprinkle assertions in all target
labels for error unwinding to assert the desired locking state.

RELENG_5_3 candidate.

MFC after:	3 days
Reported by:	Wilkinson, Alex <alex dot wilkinson at dsto dot defence dot gov dot au>

Revision 1.147.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 30 22:02:57 2004 UTC (7 years, 5 months ago) by rwatson
Branches: RELENG_5
CVS tags: RELENG_5_3_BP
Branch point for: RELENG_5_3
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +1 -1 lines
Merge nfs_serv.c:1.148 to RELENG_5:

  date: 2004/08/25 16:52:59;  author: rwatson;  state: Exp;  lines: +1 -1
  Convert a mtx_lock(&Giant) to a mtx_unlock(&Giant) in nfsrv_link() to
  prevent leakage of Giant.  With INVARIANTS, this results in an
  assertion failure following execution of the RPC.  Without INVARIANTS,
  it could result in problems if the NFS server is killed causing nfsd
  to return to user space holding Giant.

  Feet provided by:       brueffer

Approved by:	re (scottl)

Revision 1.148: download - view: text, markup, annotated - select for diffs
Wed Aug 25 16:52:59 2004 UTC (7 years, 5 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +1 -1 lines
Convert a mtx_lock(&Giant) to a mtx_unlock(&Giant) in nfsrv_link() to
prevent leakage of Giant.  With INVARIANTS, this results in an
assertion failure following execution of the RPC.  Without INVARIANTS,
it could result in problems if the NFS server is killed causing nfsd
to return to user space holding Giant.

Feet provided by:	brueffer

Revision 1.147: download - view: text, markup, annotated - select for diffs
Thu Jun 17 17:16:52 2004 UTC (7 years, 7 months ago) by phk
Branches: MAIN
CVS tags: RELENG_5_BP
Branch point for: RELENG_5
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +1 -1 lines
Second half of the dev_t cleanup.

The big lines are:
	NODEV -> NULL
	NOUDEV -> NODEV
	udev_t -> dev_t
	udev2dev() -> findcdev()

Various minor adjustments including handling of userland access to kernel
space struct cdev etc.

Revision 1.146: download - view: text, markup, annotated - select for diffs
Mon May 31 19:08:22 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +4 -0 lines
Release NFS subsystem lock and acquire Giant when calling into
vn_start_write().

Revision 1.145: download - view: text, markup, annotated - select for diffs
Sun May 30 22:59:54 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +6 -1 lines
One more case where we want to drop the NFS server lock and acquire
Giant when entering VFS.  Discovered by code inspection; still not
hit without debug.mpsafenet=1.

Reported by:	bmilekic

Revision 1.144: download - view: text, markup, annotated - select for diffs
Sun May 30 22:41:43 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +22 -13 lines
Acquire Giant around two more cases when calling into VFS to vput()
a vnode.  Not bumped into with asserts in the main tree because we
run the NFS server with Giant by default.  Discovered by inspection.

Complete annotations of Giant acquisition/release to note that it's
only because of VFS that we acquire Giant in most places in the NFS
server.

Revision 1.143: download - view: text, markup, annotated - select for diffs
Sat May 29 15:52:39 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +1 -1 lines
Don't release Giant until after the call to vput() in nfsrv_setattr().
Unless running with debug.mpsafenet=1, this was not actually a problem.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Thu May 27 20:34:04 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +1 -1 lines
Call nfsm_clget_nolock() instead of nfsm_clget() when holding the NFS
subsystem lock to avoid tripping over an assertion regarding whether
the lock is held or not.  This is likely to be the cause of a panic
tripped over by Andrea Campi.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Mon May 24 04:06:14 2004 UTC (7 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +406 -26 lines
The socket code upcalls into the NFS server using the so_upcall
mechanism so that early processing on mbufs can be performed before
a context switch to the NFS server threads.  Because of this, if
the socket code is running without Giant, the NFS server also needs
to be able to run the upcall code without relying on the presence on
Giant.  This change modifies the NFS server to run using a "giant
code lock" covering operation of the whole subsystem.  Work is in
progress to move to data-based locking as part of the NFSv4 server
changes.

Introduce an NFS server subsystem lock, 'nfsd_mtx', and a set of
macros to operate on the lock:

  NFSD_LOCK_ASSERT()    Assert nfsd_mtx owned by current thread
  NFSD_UNLOCK_ASSERT()  Assert nfsd_mtx not owned by current thread
  NFSD_LOCK_DONTCARE()  Advisory: this function doesn't care
  NFSD_LOCK()           Lock nfsd_mtx
  NFSD_UNLOCK()         Unlock nfsd_mtx

Constify a number of global variables/structures in the NFS server
code, as they are not modified and contain constants only:

  nfsrvv2_procid       nfsrv_nfsv3_procid      nonidempotent
  nfsv2_repstat        nfsv2_type              nfsrv_nfsv3_procid
  nfsrvv2_procid       nfsrv_v2errmap          nfsv3err_null
  nfsv3err_getattr     nfsv3err_setattr        nfsv3err_lookup
  nfsv3err_access      nfsv3err_readlink       nfsv3err_read
  nfsv3err_write       nfsv3err_create         nfsv3err_mkdir
  nfsv3err_symlink     nfsv3err_mknod          nfsv3err_remove
  nfsv3err_rmdir       nfsv3err_rename         nfsv3err_link
  nfsv3err_readdir     nfsv3err_readdirplus    nfsv3err_fsstat
  nfsv3err_fsinfo      nfsv3err_pathconf       nfsv3err_commit
  nfsrv_v3errmap

There are additional structures that should be constified but due
to their being passed into general purpose functions without const
arguments, I have not yet converted.

In general, acquire nfsd_mtx when accessing any of the global NFS
structures, including struct nfssvc_sock, struct nfsd, struct
nfsrv_descript.

Release nfsd_mtx whenever calling into VFS, and acquire Giant for
calls into VFS.  Giant is not required for any part of the
operation of the NFS server with the exception of calls into VFS.
Giant will never by acquired in the upcall code path.  However, it
may operate entirely covered by Giant, or not.  If debug.mpsafenet
is set to 0, the system calls will acquire Giant across all
operations, and the upcall will assert Giant.  As such, by default,
this enables locking and allows us to test assertions, but should not
cause any substantial new amount of code to be run without Giant.
Bugs should manifest in the form of lock assertion failures for now.

This approach is similar (but not identical) to modifications to the
BSD/OS NFS server code snapshot provided by BSDi as part of their
SMPng snapshot.  The strategy is almost the same (single lock over
the NFS server), but differs in the following ways:

- Our NFS client and server code bases don't overlap, which means
  both fewer bugs and easier locking (thanks Peter!).  Also means
  NFSD_*() as opposed to NFS_*().

- We make broad use of assertions, whereas the BSD/OS code does not.

- Made slightly different choices about how to handle macros building
  packets but operating with side effects.

- We acquire Giant only when entering VFS from the NFS server daemon
  threads.

- Serious bugs in BSD/OS implementation corrected -- the snapshot we
  received was clearly a work in progress.

Based on ideas from:	BSDi SMPng Snapshot
Reviewed by:		rick@snowhite.cis.uoguelph.ca
Extensive testing by:	kris

Revision 1.140: download - view: text, markup, annotated - select for diffs
Mon Apr 12 13:02:21 2004 UTC (7 years, 10 months ago) by mux
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +14 -2 lines
Don't send the available space as is in the FSSTAT call.  Under
FreeBSD, we can have a negative available space value, but the
corresponding fields in the NFS protocol are unsigned.  So
trnucate the value to 0 if it's negative, so that the client
doesn't receive absurdly high values.

Tested by:	cognet

Revision 1.139: download - view: text, markup, annotated - select for diffs
Wed Apr 7 04:59:57 2004 UTC (7 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +0 -4 lines
Remove advertising clause from University of California Regent's
license, per letter dated July 22, 1999 and email from Peter Wemm,
Alan Cox and Robert Watson.

Approved by: core, peter, alc, rwatson

Revision 1.138: download - view: text, markup, annotated - select for diffs
Thu Mar 11 18:02:36 2004 UTC (7 years, 11 months ago) by phk
Branches: MAIN
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +1 -1 lines
Properly vector all bwrite() and BUF_WRITE() calls through the same path
and s/BUF_WRITE()/bwrite()/ since it now does the same as bwrite().

Revision 1.137: download - view: text, markup, annotated - select for diffs
Fri Oct 24 18:36:49 2003 UTC (8 years, 3 months ago) by phk
Branches: MAIN
CVS tags: RELENG_5_2_BP, RELENG_5_2_1_RELEASE, RELENG_5_2_0_RELEASE, RELENG_5_2
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +11 -81 lines
When grabbing vnodes to service NFS requests, make sure to call
vn_start_write() early to avoid snapshot deadlocks.

By:	mckusick

Revision 1.136: download - view: text, markup, annotated - select for diffs
Tue Jun 24 19:04:26 2003 UTC (8 years, 7 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +1 -1 lines
Fix a bug in nfsrv_read() that caused the replies to certain NFSv3
short read operations at the end of a file to not have the "eof"
flag set as they should. The problem is that the requested read
count was compared against the rounded-up reply data length instead
of the actual reply data length. This bug appears to have been
introduced in revision 1.78 (June 1999). It causes first-time reads
of certain file sizes (e.g 4094 bytes) to fail with EIO on a RedHat
9.0 NFSv3 client.

MFC after:	1 week

Revision 1.135: download - view: text, markup, annotated - select for diffs
Sat Jun 21 21:01:44 2003 UTC (8 years, 7 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +4 -4 lines
Increase the size of the NFS server hash table to improve performance
when serving up more than about 32 active files. For details see
section 6.3 (pg 111) of Daniel Ellard and Margo Seltzer, ``NFS
Tricks and Benchmarking Traps'' in the Proceedings of the Usenix
2003 Freenix Track, June 9-14, 2003 pg 101-114.

Obtained from:	Daniel Ellard <ellard@eecs.harvard.edu>
Sponsored by:   DARPA & NAI Labs.

Revision 1.134: download - view: text, markup, annotated - select for diffs
Sun May 25 06:17:33 2003 UTC (8 years, 8 months ago) by truckman
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +186 -112 lines
Beat vnode locking in the NFS server code into submission.  This change
is not pretty, but it fixes the code so that it no longer violates the
vnode locking rules in the VFS API and doesn't trip any of the locking
assertions enabled by the DEBUG_VFS_LOCKS kernel configuration option.
There is one report that this patch fixed a "locking against myself"
panic on an NFS server that was tripped by a diskless client.

Approved by:	re (scottl)

Revision 1.133: download - view: text, markup, annotated - select for diffs
Thu Apr 24 04:31:25 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +4 -0 lines
 - Acquire the vm_object's lock when performing vm_object_page_clean().
 - Add a parameter to vm_pageout_flush() that tells vm_pageout_flush()
   whether its caller has locked the vm_object.  (This is a temporary
   measure to bootstrap vm_object locking.)

Revision 1.132: download - view: text, markup, annotated - select for diffs
Thu Mar 13 07:05:22 2003 UTC (8 years, 11 months ago) by jeff
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +9 -6 lines
 - Lock bufs before inspecting their flags.

Revision 1.131: download - view: text, markup, annotated - select for diffs
Tue Feb 25 03:37:47 2003 UTC (8 years, 11 months ago) by jeff
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +7 -3 lines
 - Add an interlock argument to BUF_LOCK and BUF_TIMELOCK.
 - Remove the buftimelock mutex and acquire the buf's interlock to protect
   these fields instead.
 - Hold the vnode interlock while locking bufs on the clean/dirty queues.
   This reduces some cases from one BUF_LOCK with a LK_NOWAIT and another
   BUF_LOCK with a LK_TIMEFAIL to a single lock.

Reviewed by:	arch, mckusick

Revision 1.130: download - view: text, markup, annotated - select for diffs
Wed Feb 19 05:47:39 2003 UTC (8 years, 11 months ago) by imp
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +10 -10 lines
Back out M_* changes, per decision of the TRB.

Approved by: trb

Revision 1.129: download - view: text, markup, annotated - select for diffs
Tue Jan 21 08:56:10 2003 UTC (9 years ago) by alfred
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +10 -10 lines
Remove M_TRYWAIT/M_WAITOK/M_WAIT.  Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.

Revision 1.128: download - view: text, markup, annotated - select for diffs
Wed Jan 1 18:48:57 2003 UTC (9 years, 1 month ago) by schweikh
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +2 -2 lines
Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.

Revision 1.127: download - view: text, markup, annotated - select for diffs
Sat Dec 28 20:28:10 2002 UTC (9 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +3 -3 lines
Abstract-out the constants for the sequential heuristic.

No operational changes.

MFC after:	1 day

Revision 1.126: download - view: text, markup, annotated - select for diffs
Thu Dec 5 16:58:11 2002 UTC (9 years, 2 months ago) by iedowse
Branches: MAIN
CVS tags: RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +2 -2 lines
In the NFSv3 `fsinfo' procedure reply, don't claim that we support
32k read and write operations on datagram sockets when in fact we
reject requests larger than 16k. It must be the case that virtually
all clients use data sizes of 16k or less for UDP transport (FreeBSD's
client defaults to 8k and never exceeds 16k), as this bug has been
present ever since NFSv3 support was added.

Reported by:	Senthil <lihtnes78@netscape.net>
Reviewed by:	dillon
Approved by:	re
MFC-after:	1 week

Revision 1.125: download - view: text, markup, annotated - select for diffs
Thu Oct 31 22:35:03 2002 UTC (9 years, 3 months ago) by jeff
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +2 -2 lines
 - Introduce a new macro, since that's what nfs loves, called
   nfsm_srvpathsiz.  This macro plucks a length out of an rpc request and
   verifies that its size does not exceed NFS_MAXPATHLEN.  If it does
   it generates an ENAMETOOLONG response.
 - Use this macro, and the existing nfsm_srvnamsiz macro in two places
   where we deal with paths passed in by the client.

This fixes a linux interoperability bug.  Linux was sending oversized path
components which would cause us to ignore the request all together.  This
causes linux to hang indefinitly while it waits for a response.  This
could still happen in other cases where we error out with EBADRPC.

Sponsored by:	Isilon Systems, Inc.
Reviewed by:	alfred, fabbri@isilon.com, neal@isilon.com

Revision 1.124: download - view: text, markup, annotated - select for diffs
Thu Oct 3 21:50:37 2002 UTC (9 years, 4 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +2 -3 lines
Correct a problem wherein NFS servers running NFSv2 would not return
certain classes of failure responses to the client during a failed
remove operation.

Submitted by:	Ian Dowse <iedowse@maths.tcd.ie>

Revision 1.123: download - view: text, markup, annotated - select for diffs
Wed Sep 25 02:39:39 2002 UTC (9 years, 4 months ago) by jeff
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +1 -1 lines
 - Use incore() instead of gbincore() so we don't have to acquire the
   vnode interlock.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Sun Aug 4 10:29:34 2002 UTC (9 years, 6 months ago) by jeff
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +3 -3 lines
 - Replace v_flag with v_iflag and v_vflag
 - v_vflag is protected by the vnode lock and is used when synchronization
   with VOP calls is needed.
 - v_iflag is protected by interlock and is used for dealing with vnode
   management issues.  These flags include X/O LOCK, FREE, DOOMED, etc.
 - All accesses to v_iflag and v_vflag have either been locked or marked with
   mp_fixme's.
 - Many ASSERT_VOP_LOCKED calls have been added where the locking was not
   clear.
 - Many functions in vfs_subr.c were restructured to provide for stronger
   locking.

Idea stolen from:	BSD/OS

Revision 1.121: download - view: text, markup, annotated - select for diffs
Thu Jul 11 17:54:58 2002 UTC (9 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +19 -19 lines
Convert old style (type foo *)0 casts to NULLs

PR:		kern/40360
Requested by:	Hiten PAndya via direct email

Revision 1.120: download - view: text, markup, annotated - select for diffs
Wed Jul 10 17:02:31 2002 UTC (9 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +7 -1 lines
Replace the global buffer hash table with per-vnode splay trees using a
methodology similar to the vm_map_entry splay and the VM splay that Alan
Cox is working on.  Extensive testing has appeared to have shown no
increase in overhead.

Disadvantages
    Dirties more cache lines during lookups.

    Not as fast as a hash table lookup (but still N log N and optimal
    when there is locality of reference).

Advantages
    vnode->v_dirtyblkhd is now perfectly sorted, making fsync/sync/filesystem
    syncer operate more efficiently.

    I get to rip out all the old hacks (some of which were mine) that tried
    to keep the v_dirtyblkhd tailq sorted.

    The per-vnode splay tree should be easier to lock / SMPng pushdown on
    vnodes will be easier.

    This commit along with another that Alan is working on for the VM page
    global hash table will allow me to implement ranged fsync(), optimize
    server-side nfs commit rpcs, and implement partial syncs by the
    filesystem syncer (aka filesystem syncer would detect that someone is
    trying to get the vnode lock, remembers its place, and skip to the
    next vnode).

Note that the buffer cache splay is somewhat more complex then other splays
due to special handling of background bitmap writes (multiple buffers with
the same lblkno in the same vnode), and B_INVAL discontinuities between the
old hash table and the existence of the buffer on the v_cleanblkhd list.

Suggested by: alc

Revision 1.119: download - view: text, markup, annotated - select for diffs
Thu May 16 21:28:23 2002 UTC (9 years, 8 months ago) by trhodes
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +4 -4 lines
More s/file system/filesystem/g

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sun Apr 21 16:14:54 2002 UTC (9 years, 9 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +4 -0 lines
Limit to the maximum allowed reply size the amount of data that
nfsrv_readdir and nfsrv_readdirplus can return. A client request
containing an over-large `count' field could trigger the "Bad nfs
svc reply" panic in nfs_syscalls.c.

Spotted while trying to reproduce kern/37304, which turned out to
be fixed in FreeBSD a long time ago.

MFC after:	1 week

Revision 1.117: download - view: text, markup, annotated - select for diffs
Mon Apr 1 21:31:07 2002 UTC (9 years, 10 months ago) by jhb
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +2 -2 lines
Change the suser() API to take advantage of td_ucred as well as do a
general cleanup of the API.  The entire API now consists of two functions
similar to the pre-KSE API.  The suser() function takes a thread pointer
as its only argument.  The td_ucred member of this thread must be valid
so the only valid thread pointers are curthread and a few kernel threads
such as thread0.  The suser_cred() function takes a pointer to a struct
ucred as its first argument and an integer flag as its second argument.
The flag is currently only used for the PRISON_ROOT flag.

Discussed on:	smp@

Revision 1.116: download - view: text, markup, annotated - select for diffs
Sun Mar 17 01:25:45 2002 UTC (9 years, 10 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +4 -2 lines
Add a flags parameter to VFS_VGET to pass through the desired
locking flags when acquiring a vnode. The immediate purpose is
to allow polling lock requests (LK_NOWAIT) needed by soft updates
to avoid deadlock when enlisting other processes to help with
the background cleanup. For the future it will allow the use of
shared locks for read access to vnodes. This change touches a
lot of files as it affects most filesystems within the system.
It has been well tested on FFS, loopback, and CD-ROM filesystems.
only lightly on the others, so if you find a problem there, please
let me (mckusick@mckusick.com) know.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Wed Feb 27 18:32:20 2002 UTC (9 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +1 -1 lines
Simple p_ucred -> td_ucred changes to start using the per-thread ucred
reference.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Mon Jan 14 19:14:08 2002 UTC (10 years ago) by dillon
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +2 -0 lines
The vnode was not being vput()'d in the EEXIST mknod case on the nfs
server side.  This can lead to a system deadlock.

Reviewed by:    iedowse
Tested by:      Alexey G Misurenko <mag@caravan.ru>, iedowse
Bug found with help by: Alexey G Misurenko <mag@caravan.ru>
MFC at:         earliest convenience

Revision 1.113: download - view: text, markup, annotated - select for diffs
Sun Jan 13 05:36:05 2002 UTC (10 years ago) by iedowse
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +9 -3 lines
It is required by VOP_CREATE, VOP_MKNOD, VOP_SYMLINK and VOP_MKDIR
that va_mode of the supplied attributes is filled in with a valid
file mode (i.e not VNOVAL, and only ALLPERM bits set). However,
some NFS server op functions didn't guarantee this for all possible
request messages:

If a V3 client chose not include to a mode specification, we could
end up creating an ffs inode with mode 0177777, requiring a manual
fsck on the next reboot. Fix this by setting va_mode to 0 before
calling the VOP if a mode hasn't been supplied by the client.

In nfsrv_symlink(), S_IFMT bits supplied by a V2 client could end
up in the va_mode passed to VOP_SYMLINK with similar effects. We
now use the macro nfstov_mode() to correctly mask the bits.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Sat Jan 12 03:57:25 2002 UTC (10 years, 1 month ago) by iedowse
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +28 -33 lines
Fix a few NFSv2 issues that slipped in during the big cleanup. The
semantics of the nfsm_reply() macro were changed so that the caller
has to explicitly handle the V2 error case, whereas before,
nfsm_reply() did a `goto nfsmout' then. A few server ops (setattr,
readlink, create, mkdir) weren't updated to match, so errors in the
V2 case could cause protocol hangs and leaked mbufs.

Correct some comments that describe the old nfsm_reply behaviour.

[older, harmless nit] Remove the unnecessary `nfsmreply0' label in
nfsrv_create(), since for its users, the main `ereply' label does
the same thing.

Revision 1.111: download - view: text, markup, annotated - select for diffs
Tue Jan 8 19:41:06 2002 UTC (10 years, 1 month ago) by msmith
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +24 -24 lines
Rename some variables that end up shadowing their namesakes in the NFS client
code.

Reviewed by:	peter

Revision 1.110: download - view: text, markup, annotated - select for diffs
Tue Dec 18 01:22:09 2001 UTC (10 years, 1 month ago) by iedowse
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +0 -10 lines
Avoid passing the variable `tl' to functions that just use it for
temporary storage. In the old NFS code it wasn't at all clear if
the value of `tl' was used across or after macro calls, but I'm
fairly confident that the convention was to keep its use local.
Each ex-macro function now uses a local version of this variable,
so all of the double-indirection goes away.

The only exception to the `local use' rule for `tl' is nfsm_clget(),
which is left unchanged by this commit.

Reviewed by:	peter

Revision 1.109: download - view: text, markup, annotated - select for diffs
Tue Dec 4 16:53:42 2001 UTC (10 years, 2 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +2 -3 lines
When VOP_SYMLINK fails, the value of *vpp is junk, so we must NULL
out nd.ni_vp to prevent the resource cleanup code at the end of
nfsrv_symlink from trying to vrele it. This fixes a "vrele: negative
ref cnt" panic that can occur when a symlink is attempted on an NFS
filesystem with no free space. Found locally, but the symptoms
correspond to those in the PR referenced below.

PR:		kern/26878
MFC after:	3 days

Revision 1.108: download - view: text, markup, annotated - select for diffs
Thu Oct 25 19:07:56 2001 UTC (10 years, 3 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +2 -1 lines
Now that nfsm_reply() does not usually set 'error' to 0, we need
to do it explicitly in nfsrv_noop so that the reply gets sent back
to the client. This fixes the generation of a selection of RPC
error replies (RPC_PROGMISMATCH, RPC_PROGUNAVAIL, RPC_PROCUNAVAIL
etc.) that are used by some clients to detect support for optional
protocols and features.

Reviewed by:	peter
Reported by:	Thomas Quinot <quinot@inf.enst.fr>
PR:		kern/31479

Revision 1.107: download - view: text, markup, annotated - select for diffs
Fri Sep 28 04:37:08 2001 UTC (10 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +3 -3 lines
Unwind some more macros.  NFSMADV() was kinda silly since it was right
next to equivalent m_len adjustments.  Move the nfsm_subs.h macros
into groups depending on which phase they are used in, since that
affects the error recovery requirements.  Collect some of the common error
checking into a single macro as preparation for unwinding some more.
Have nfs_rephead return a value instead of secretly modifying args.
Remove some unused function arguments that were being passed around.
Clarify nfsm_reply()'s error handling (I hope).

Revision 1.106: download - view: text, markup, annotated - select for diffs
Thu Sep 27 22:40:38 2001 UTC (10 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +22 -22 lines
Make nfsm_dissect() have an obvious return value.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Thu Sep 27 02:33:36 2001 UTC (10 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +26 -24 lines
Tidy up nfsm_build usage.  This is only partially finished.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Tue Sep 18 23:32:02 2001 UTC (10 years, 4 months ago) by peter
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +341 -514 lines
Cleanup and split of nfs client and server code.
This builds on the top of several repo-copies.

Revision 1.103: download - view: text, markup, annotated - select for diffs
Wed Sep 12 08:38:00 2001 UTC (10 years, 5 months ago) by julian
Branches: MAIN
CVS tags: old_KSE_MILESTONE_2
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +147 -147 lines
KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after:    ha ha ha ha

Revision 1.102: download - view: text, markup, annotated - select for diffs
Sun Apr 29 02:45:07 2001 UTC (10 years, 9 months ago) by grog
Branches: MAIN
CVS tags: old_KSE_PRE_MILESTONE_2
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +1 -3 lines
Revert consequences of changes to mount.h, part 2.

Requested by:	bde

Revision 1.101: download - view: text, markup, annotated - select for diffs
Mon Apr 23 08:57:51 2001 UTC (10 years, 9 months ago) by grog
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +3 -1 lines
Correct #includes to work with fixed sys/mount.h.

Revision 1.100: download - view: text, markup, annotated - select for diffs
Sun Feb 18 10:43:16 2001 UTC (10 years, 11 months ago) by asmodai
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +3 -3 lines
Preceed/preceeding are not english words.  Use precede and preceding.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Fri Feb 9 13:24:06 2001 UTC (11 years ago) by iedowse
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +102 -47 lines
Fix some problems that were introduced in revision 1.97. Instead
of returning an error code to the caller, NFS server op routines
must themselves build an error reply and return 0 to the caller.

This is achieved by replacing the erroneous return statements with
code that jumps forward to the op function's reply code. We need
to be careful to ensure that the 'struct mount' pointer is NULL
though, so that the final vn_finished_write() call becomes a no-op.

Reviewed by:	mckusick, dillon

Revision 1.98: download - view: text, markup, annotated - select for diffs
Thu Dec 21 21:44:24 2000 UTC (11 years, 1 month ago) by bmilekic
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +5 -5 lines
* Rename M_WAIT mbuf subsystem flag to M_TRYWAIT.
  This is because calls with M_WAIT (now M_TRYWAIT) may not wait
  forever when nothing is available for allocation, and may end up
  returning NULL. Hopefully we now communicate more of the right thing
  to developers and make it very clear that it's necessary to check whether
  calls with M_(TRY)WAIT also resulted in a failed allocation.
  M_TRYWAIT basically means "try harder, block if necessary, but don't
  necessarily wait forever." The time spent blocking is tunable with
  the kern.ipc.mbuf_wait sysctl.
  M_WAIT is now deprecated but still defined for the next little while.

* Fix a typo in a comment in mbuf.h

* Fix some code that was actually passing the mbuf subsystem's M_WAIT to
  malloc(). Made it pass M_WAITOK instead. If we were ever to redefine the
  value of the M_WAIT flag, this could have became a big problem.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Tue Jul 11 22:07:50 2000 UTC (11 years, 7 months ago) by mckusick
Branches: MAIN
CVS tags: old_PRE_SMPNG
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +114 -2 lines
Add snapshots to the fast filesystem. Most of the changes support
the gating of system calls that cause modifications to the underlying
filesystem. The gating can be enabled by any filesystem that needs
to consistently suspend operations by adding the vop_stdgetwritemount
to their set of vnops. Once gating is enabled, the function
vfs_write_suspend stops all new write operations to a filesystem,
allows any filesystem modifying system calls already in progress
to complete, then sync's the filesystem to disk and returns. The
function vfs_write_resume allows the suspended write operations to
begin again. Gating is not added by default for all filesystems as
for SMP systems it adds two extra locks to such critical kernel
paths as the write system call. Thus, gating should only be added
as needed.

Details on the use and current status of snapshots in FFS can be
found in /sys/ufs/ffs/README.snapshot so for brevity and timelyness
is not included here. Unless and until you create a snapshot file,
these changes should have no effect on your system (famous last words).

Revision 1.96: download - view: text, markup, annotated - select for diffs
Fri May 5 09:58:39 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +2 -1 lines
Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by:    peter

Revision 1.95: download - view: text, markup, annotated - select for diffs
Sun Apr 30 18:51:59 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +1 -2 lines
Remove unneeded #include <vm/vm_zone.h>

Generated by:	src/tools/tools/kerninclude

Revision 1.94: download - view: text, markup, annotated - select for diffs
Mon Mar 20 11:28:59 2000 UTC (11 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +2 -2 lines
Rename the existing BUF_STRATEGY() to DEV_STRATEGY()

substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo)

substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo)

This patch is machine generated except for the ccd.c and buf.h parts.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Sat Dec 18 19:20:05 1999 UTC (12 years, 1 month ago) by dillon
Branches: MAIN
CVS tags: old_RELENG_4_BP, old_RELENG_4_4_BP, old_RELENG_4_4_0_RELEASE, old_RELENG_4_4, old_RELENG_4_3_BP, old_RELENG_4_3_0_RELEASE, old_RELENG_4_3, old_RELENG_4_2_0_RELEASE, old_RELENG_4_1_1_RELEASE, old_RELENG_4_1_0_RELEASE, old_RELENG_4_0_0_RELEASE, old_RELENG_4
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +2 -2 lines
    Fix compilation warning on alpha when converting pointer to integer
    to generate hash index.

Reviewed by:	 Andrew Gallatin <gallatin@cs.duke.edu>

Revision 1.72.2.8: download - view: text, markup, annotated - select for diffs
Thu Dec 16 17:03:10 1999 UTC (12 years, 1 month ago) by dillon
Branches: old_RELENG_3
CVS tags: old_RELENG_3_5_0_RELEASE, old_RELENG_3_4_0_RELEASE
Diff to: previous 1.72.2.7: preferred, colored; branchpoint 1.72: preferred, colored; next MAIN 1.73: preferred, colored
Changes since revision 1.72.2.7: +15 -7 lines
    MFC nfs_serv.c 1.92 - use snapshot of boottime instead of bottime for
    version id because boottime itself may change dynamically, especially
    if xntpd is being run.

Approved by:	jkh

Revision 1.92: download - view: text, markup, annotated - select for diffs
Thu Dec 16 17:01:32 1999 UTC (12 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +15 -7 lines
    Have NFS use a snapshot of boottime instead of boottime itself to
    generate the NFSv3 Version id.  boottime itself may change, sometimes
    once every tick if you are running xntpd, which really throws off
    clients.  Clients will tend to throw away what they believe to be
    stale data too often, and can get into long loops rewriting the same
    data over and over again because they believe the server has rebooted
    over and over again due to the changing version id.

Approved by:	jkh

Revision 1.91: download - view: text, markup, annotated - select for diffs
Wed Dec 15 23:02:18 1999 UTC (12 years, 1 month ago) by eivind
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +26 -122 lines
Introduce NDFREE (and remove VOP_ABORTOP)

Revision 1.72.2.7: download - view: text, markup, annotated - select for diffs
Wed Dec 15 05:37:11 1999 UTC (12 years, 1 month ago) by dillon
Branches: old_RELENG_3
Diff to: previous 1.72.2.6: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.6: +5 -1 lines
    MFC nfs_serv.c 1.86.  Remove too-conservative NFSERR_BAD_COOKIE returns.

Approved by:	jkh
PR:	kern/11470

Revision 1.90: download - view: text, markup, annotated - select for diffs
Mon Dec 13 17:34:45 1999 UTC (12 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +78 -2 lines
    Add a readahead heuristic to the NFS server side code.  While the server
    cannot unilaterally pass data to a client it can reduce the physical
    disk transaction overhead by reading larger blocks.  This results in
    better pipelining of requests/responses over the network and an almost
    100% increase in cpu efficiency on the server.  On a 100BaseTX network
    NFS read performance increases from 8.5 MBytes/sec to 10 MB/sec (maxed
    out), and cpu efficiency increases from 72% idle to 80% idle on the server.

Reviewed by:	Alfred Perlstein <bright@wintelcom.net>

Revision 1.72.2.6: download - view: text, markup, annotated - select for diffs
Sun Dec 12 07:16:17 1999 UTC (12 years, 2 months ago) by dillon
Branches: old_RELENG_3
Diff to: previous 1.72.2.5: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.5: +5 -5 lines
    MFC nfs_nqlease 1.47, nfs_serv.c 1.89, nfs_subs.c 1.87.  Prevent panics
    in server side abort code when dealing with malformed NFS packets.

Approved by: jkh

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sun Dec 12 07:06:38 1999 UTC (12 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +5 -5 lines
    Fix a number of server-side issues related to aborting badly formed
    NFS packets, mainly initializing structure pointers to NULL which
    are conditionally freed prior to return.

PR:		kern/15249
Submitted by:	Ian Dowse <iedowse@maths.tcd.ie>

Revision 1.88: download - view: text, markup, annotated - select for diffs
Sat Nov 13 20:58:15 1999 UTC (12 years, 2 months ago) by eivind
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +7 -16 lines
Remove WILLRELE from VOP_SYMLINK

Note: Previous commit to these files (except coda_vnops and devfs_vnops)
that claimed to remove WILLRELE from VOP_RENAME actually removed it from
VOP_MKNOD.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Fri Nov 12 03:34:26 1999 UTC (12 years, 3 months ago) by eivind
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +15 -14 lines
Remove WILLRELE from VOP_RENAME

Revision 1.86: download - view: text, markup, annotated - select for diffs
Wed Sep 29 17:14:58 1999 UTC (12 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +5 -1 lines
    Make FreeBSD less conservative in determining when to return a cookie
    error for a directory.  I have made this change after a great deal of
    review although I cannot be absolutely sure that this meets the spec.

    The issue devolves into whether changes in an underlying (UFS) directory
    can cause NFS directory blocks to be renumbered.  My read of the code
    indicates that NFS directory blocks will not be renumbered, which means
    that the cookies should still remain valid after a change is made to
    the underlying directory.  This being the case, a cookie error should
    not be returned when a change is made to the underlying directory and,
    instead, the NFS client should rely on mtime detection to invalidate and
    reload the directory.

    The use of mtime is problematic in of itself, due to insufficient
    resolution, which is why I believe the original conservative error
    handling was done.  Still, there have been dozens of bug reports by
    people needing solaris<->FreeBSD interoperability and these have to
    be accomodated.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Fri Sep 17 05:57:57 1999 UTC (12 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +73 -4 lines
    Asynchronized client-side nfs_commit.  NFS commit operations were
    previously issued synchronously even if async daemons (nfsiod's) were
    available.  The commit has been moved from the strategy code to the doio
    code in order to asynchronize it.

    Removed use of lastr in preparation for removal of vnode->v_lastr.  It
    has been replaced with seqcount, which is already supported by the system
    and, in fact, gives us a better heuristic for sequential detection then
    lastr ever did.

    Made major performance improvements to the server side commit.  The
    server previously fsync'd the entire file for each commit rpc.  The
    server now bawrite()s only those buffers related to the offset/size
    specified in the commit rpc.

    Note that we do not commit the meta-data yet.  This works still needs
    to be done.

    Note that a further optimization can be done (and has not yet been done)
    on the client: we can merge multiple potential commit rpc's into a
    single rpc with a greater file offset/size range and greatly reduce
    rpc traffic.

Reviewed by:	Alan Cox <alc@cs.rice.edu>, David Greenman <dg@root.com>

Revision 1.15.2.4: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:36:26 1999 UTC (12 years, 5 months ago) by peter
Branches: old_RELENG_2_1_0
Diff to: previous 1.15.2.3: preferred, colored; branchpoint 1.15: preferred, colored; next MAIN 1.16: preferred, colored
Changes since revision 1.15.2.3: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.34.2.6: download - view: text, markup, annotated - select for diffs
Sun Sep 5 08:19:40 1999 UTC (12 years, 5 months ago) by peter
Branches: old_RELENG_2_2
Diff to: previous 1.34.2.5: preferred, colored; branchpoint 1.34: preferred, colored; next MAIN 1.35: preferred, colored
Changes since revision 1.34.2.5: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.72.2.5: download - view: text, markup, annotated - select for diffs
Sun Aug 29 16:30:28 1999 UTC (12 years, 5 months ago) by peter
Branches: old_RELENG_3
CVS tags: old_RELENG_3_3_0_RELEASE
Diff to: previous 1.72.2.4: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.4: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.84: download - view: text, markup, annotated - select for diffs
Sat Aug 28 00:49:58 1999 UTC (12 years, 5 months ago) by peter
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +1 -1 lines
$Id$ -> $FreeBSD$

Revision 1.72.2.4: download - view: text, markup, annotated - select for diffs
Thu Jul 29 21:48:51 1999 UTC (12 years, 6 months ago) by wpaul
Branches: old_RELENG_3
Diff to: previous 1.72.2.3: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.3: +2 -2 lines
MFC: correct sanity test length calculation in nfsrv_readdirplus() so that
we don't accidentally overfill the mbuf chain when using 32K read/write
sizes. Stops "cd /nfsdir; du" from certain NFSv3 TCP clients from crashing
the system.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Thu Jul 29 21:42:57 1999 UTC (12 years, 6 months ago) by wpaul
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +2 -2 lines
Correct the sanity test length calculation in nfsrv_readdirplus(): len is
being incremented by 4 bytes too few each time through the loop, which
allows more data into the mbuf chain that we really want. In the worst
case, when we're using 32K read/write sizes with a TCP client, this causes
readdirplus replies to sometimes exceed NFS_MAXPACKET which leads to a
panic. This problem cropped up for me using an IRIX 6.5.4 NFSv3 TCP client
with 32K read/write sizes, however supposedly it can be triggered by
WinNT NFS servers too. In theory, it can probably be triggered by any
NFS v3 implementation using TCP as long as it's using the maxiumum block
size.

Reviewed by: Matthew Dillon <dillon@backplane.com>

Revision 1.72.2.3: download - view: text, markup, annotated - select for diffs
Wed Jul 28 08:24:50 1999 UTC (12 years, 6 months ago) by alc
Branches: old_RELENG_3
Diff to: previous 1.72.2.2: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.2: +2 -1 lines
MFC: [rev 1.82] Clear error in nfsrv_create when we have a valid reply
 so that that reply is actually transmitted.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Wed Jul 28 08:20:49 1999 UTC (12 years, 6 months ago) by alc
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +2 -1 lines
Clear error in nfsrv_create when we have a valid reply so that
that reply is actually transmitted.
Submitted by:	dillon

Revision 1.81: download - view: text, markup, annotated - select for diffs
Sat Jul 17 18:43:46 1999 UTC (12 years, 6 months ago) by phk
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +2 -2 lines
I have not one single time remembered the name of this function correctly
so obviously I gave it the wrong name.  s/umakedev/makeudev/g

Revision 1.72.2.2: download - view: text, markup, annotated - select for diffs
Wed Jun 30 22:05:14 1999 UTC (12 years, 7 months ago) by julian
Branches: old_RELENG_3
Diff to: previous 1.72.2.1: preferred, colored; branchpoint 1.72: preferred, colored
Changes since revision 1.72.2.1: +878 -348 lines
MFC: Bring in NFS cleanups by Matt.
These fix several case where errors were being incorrectly,
and also fix the hangs that were being reported by David Cross.

Much of the patch is "cleanups" which resulted from the attempt at isolating
the problems. They are left because the disciplin added makes the
maintainability higher.

Includes fixes from David Cross and someone else (I lost the mail).

Revision 1.80: download - view: text, markup, annotated - select for diffs
Wed Jun 30 04:29:13 1999 UTC (12 years, 7 months ago) by julian
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +2 -1 lines
Submitted by: "David E. Cross" <crossd@cs.rpi.edu>
Matt missed a line..

Revision 1.79: download - view: text, markup, annotated - select for diffs
Wed Jun 23 04:44:11 1999 UTC (12 years, 7 months ago) by julian
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +878 -349 lines
Matt's NFS fixes.
Submitted by: Matt Dillon
Reviewed by: David Cross, Julian Elischer, Mike Smith, Drew Gallatin
  3.2 version to follow when tested

Revision 1.34.2.5: download - view: text, markup, annotated - select for diffs
Mon Jun 7 00:22:23 1999 UTC (12 years, 8 months ago) by peter
Branches: old_RELENG_2_2
Diff to: previous 1.34.2.4: preferred, colored; branchpoint 1.34: preferred, colored
Changes since revision 1.34.2.4: +12 -11 lines
MFC: Don't do a negative nfs_madj() in the server when a client scans a
large directory leading to a large reply.

Revision 1.72.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 7 00:06:21 1999 UTC (12 years, 8 months ago) by peter
Branches: old_RELENG_3
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +12 -11 lines
MFC: Don't die with a negative nfs_madj() on the server when a client
scans a directory with a large number of files.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Sat Jun 5 05:34:58 1999 UTC (12 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +29 -27 lines
Various changes lifted from the OpenBSD cvs tree:

txdr_hyper and fxdr_hyper tweaks to avoid excessive CPU order knowledge.

nfs_serv.c: don't call nfsm_adj() with negative values, windows clients
could crash servers when doing a readdir of a large directory.

nfs_socket.c: Use IP_PORTRANGE to get a priviliged port without a spin
loop trying to bind().  Don't clobber a mbuf pointer or we get panics
on a NFS3ERR_JUKEBOX error from a server when reusing a freed mbuf.

nfs_subs.c: Don't loose st_blocks on NFSv2 mounts when > 2GB.

Obtained from:  OpenBSD

Revision 1.77: download - view: text, markup, annotated - select for diffs
Tue May 11 19:54:45 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +3 -3 lines
Divorce "dev_t" from the "major|minor" bitmap, which is now called
udev_t in the kernel but still called dev_t in userland.

Provide functions to manipulate both types:
        major()         umajor()
        minor()         uminor()
        makedev()       umakedev()
        dev2udev()      udev2dev()

For now they're functions, they will become in-line functions
after one of the next two steps in this process.

Return major/minor/makedev to macro-hood for userland.

Register a name in cdevsw[] for the "filedescriptor" driver.

In the kernel the udev_t appears in places where we have the
major/minor number combination, (ie: a potential device: we
may not have the driver nor the device), like in inodes, vattr,
cdevsw registration and so on, whereas the dev_t appears where
we carry around a reference to a actual device.

In the future the cdevsw and the aliased-from vnode will be hung
directly from the dev_t, along with up to two softc pointers for
the device driver and a few houskeeping bits.  This will essentially
replace the current "alias" check code (same buck, bigger bang).

A little stunt has been provided to try to catch places where the
wrong type is being used (dev_t vs udev_t), if you see something
not working, #undef DEVT_FASCIST in kern/kern_conf.c and see if
it makes a difference.  If it does, please try to track it down
(many hands make light work) or at least try to reproduce it
as simply as possible, and describe how to do that.

Without DEVT_FASCIST I belive this patch is a no-op.

Stylistic/posixoid comments about the userland view of the <sys/*.h>
files welcome now, from userland they now contain the end result.

Next planned step: make all dev_t's refer to the same devsw[] which
means convert BLK's to CHR's at the perimeter of the vnodes and
other places where they enter the game (bootdev, mknod, sysctl).

Revision 1.76: download - view: text, markup, annotated - select for diffs
Thu May 6 18:13:04 1999 UTC (12 years, 9 months ago) by peter
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +3 -2 lines
Add sufficient braces to keep egcs happy about potentially ambiguous
if/else nesting.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Wed Apr 28 11:37:54 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
CVS tags: old_PRE_VFS_BIO_NFS_PATCH, old_POST_VFS_BIO_NFS_PATCH
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +3 -3 lines
This Implements the mumbled about "Jail" feature.

This is a seriously beefed up chroot kind of thing.  The process
is jailed along the same lines as a chroot does it, but with
additional tough restrictions imposed on what the superuser can do.

For all I know, it is safe to hand over the root bit inside a
prison to the customer living in that prison, this is what
it was developed for in fact:  "real virtual servers".

Each prison has an ip number associated with it, which all IP
communications will be coerced to use and each prison has its own
hostname.

Needless to say, you need more RAM this way, but the advantage is
that each customer can run their own particular version of apache
and not stomp on the toes of their neighbors.

It generally does what one would expect, but setting up a jail
still takes a little knowledge.

A few notes:

   I have no scripts for setting up a jail, don't ask me for them.

   The IP number should be an alias on one of the interfaces.

   mount a /proc in each jail, it will make ps more useable.

   /proc/<pid>/status tells the hostname of the prison for
   jailed processes.

   Quotas are only sensible if you have a mountpoint per prison.

   There are no privisions for stopping resource-hogging.

   Some "#ifdef INET" and similar may be missing (send patches!)

If somebody wants to take it from here and develop it into
more of a "virtual machine" they should be most welcome!

Tools, comments, patches & documentation most welcome.

Have fun...

Sponsored by:   http://www.rndassociates.com/
Run for almost a year by:       http://www.servetheweb.com/

Revision 1.74: download - view: text, markup, annotated - select for diffs
Tue Apr 27 11:17:49 1999 UTC (12 years, 9 months ago) by phk
Branches: MAIN
CVS tags: old_PRE_SMP_VMSHARE, old_POST_SMP_VMSHARE
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +3 -3 lines
Suser() simplification:

1:
  s/suser/suser_xxx/

2:
  Add new function: suser(struct proc *), prototyped in <sys/proc.h>.

3:
  s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/

The remaining suser_xxx() calls will be scrutinized and dealt with
later.

There may be some unneeded #include <sys/cred.h>, but they are left
as an exercise for Bruce.

More changes to the suser() API will come along with the "jail" code.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Tue Feb 16 10:49:53 1999 UTC (12 years, 11 months ago) by dfr
Branches: MAIN
CVS tags: old_PRE_NEWBUS, old_POST_NEWBUS
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +3 -1 lines
* Change sysctl from using linker_set to construct its tree using SLISTs.
  This makes it possible to change the sysctl tree at runtime.

* Change KLD to find and register any sysctl nodes contained in the loaded
  file and to unregister them when the file is unloaded.

Reviewed by: Archie Cobbs <archie@whistle.com>,
	Peter Wemm <peter@netplex.com.au> (well they looked at it anyway)

Revision 1.72: download - view: text, markup, annotated - select for diffs
Wed Dec 9 15:12:53 1998 UTC (13 years, 2 months ago) by eivind
Branches: MAIN
CVS tags: old_RELENG_3_BP, old_RELENG_3_2_PAO_BP, old_RELENG_3_2_PAO, old_RELENG_3_2_0_RELEASE, old_RELENG_3_1_0_RELEASE
Branch point for: old_RELENG_3
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +2 -3 lines
Remove the if fixed in the last commit; bde quite correctly point out
that it can never fail.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Tue Dec 8 23:11:24 1998 UTC (13 years, 2 months ago) by eivind
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +2 -2 lines
Fix typo (; in "if (vp == NULL);").

Revision 1.70: download - view: text, markup, annotated - select for diffs
Sat Oct 31 15:39:31 1998 UTC (13 years, 3 months ago) by peter
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +2 -2 lines
vm_object_page_clean() last arg changed from TRUE to OBJPC_SYNC.  I'm not
sure that this is necessary to be a sync write here since a VOP_FSYNC()
follows and it will schedule, sort and complete the writes that the
vm_object_page_clean() started (as I think I understand things).

Revision 1.69: download - view: text, markup, annotated - select for diffs
Sun Jun 7 17:12:24 1998 UTC (13 years, 8 months ago) by dfr
Branches: MAIN
CVS tags: old_RELENG_3_0_0_RELEASE, old_PRE_NOBDEV
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +3 -3 lines
This commit fixes various 64bit portability problems required for
FreeBSD/alpha.  The most significant item is to change the command
argument to ioctl functions from int to u_long.  This change brings us
inline with various other BSD versions.  Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Sun May 31 20:08:52 1998 UTC (13 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +100 -100 lines
For the on-the-wire protocol, u_long -> u_int32_t;  long -> int32_t;
int -> int32_t; u_short -> u_int16_t.  Also, use mode_t instead of u_short
for storing modes (mode_t is a u_int16_t).

Obtained from: NetBSD

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sun May 31 19:43:34 1998 UTC (13 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +2 -2 lines
Cut-n-paste glitch

Revision 1.66: download - view: text, markup, annotated - select for diffs
Sun May 31 19:10:52 1998 UTC (13 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +7 -5 lines
Hide whiteouts from NFS, since the protocol doesn't support them.

Obtained from:  NetBSD

Revision 1.65: download - view: text, markup, annotated - select for diffs
Sun May 31 19:07:47 1998 UTC (13 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +7 -1 lines
NetBSD has a comment that Solaris 2.5 doesn't do verifiers correctly,
we have weakened this test already for Digital Unix, so it may be enough
for Solaris.  It needs to be checked again.

Obtained from: NetBSD

Revision 1.64: download - view: text, markup, annotated - select for diffs
Sun May 31 17:54:18 1998 UTC (13 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +9 -1 lines
Refuse READDIR / READDIRPLUS rpc's for non-directories

Obtained from: NetBSD

Revision 1.63: download - view: text, markup, annotated - select for diffs
Sun May 31 17:27:47 1998 UTC (13 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +51 -75 lines
NFS Jumbo commit part 1.  Cosmetic and structural changes only.  The aim
of this part of commits is to minimize unnecessary differences between
the other NFS's of similar origin.  Yes, there are gratuitous changes here
that the style folks won't like, but it makes the catch-up less difficult.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sat May 30 16:33:56 1998 UTC (13 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +12 -6 lines
When using NFSv3, use the remote server's idea of the maximum file size
rather than assuming 2^64.  It may not like files that big. :-)
On the nfs server, calculate and report the max file size as the point
that the block numbers in the cache would turn negative.
(ie: 1099511627775 bytes (1TB)).

One of the things I'm worried about however, is that directory offsets
are really cookies on a NFSv3 server and can be rather large, especially
when/if the server generates the opaque directory cookies by using a local
filesystem offset in what comes out as the upper 32 bits of the 64 bit
cookie.  (a server is free to do this, it could save byte swapping
depending on the native 64 bit byte order)

Obtained from:	NetBSD

Revision 1.34.2.4: download - view: text, markup, annotated - select for diffs
Wed May 20 11:36:37 1998 UTC (13 years, 8 months ago) by peter
Branches: old_RELENG_2_2
CVS tags: old_RELENG_2_2_8_RELEASE, old_RELENG_2_2_7_RELEASE
Diff to: previous 1.34.2.3: preferred, colored; branchpoint 1.34: preferred, colored
Changes since revision 1.34.2.3: +31 -22 lines
MFC: rev 1.61; selectively enforce file owner permissions rather than
always ignore them.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Wed May 20 09:05:48 1998 UTC (13 years, 8 months ago) by peter
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +31 -22 lines
Only ignore "owner" permissions selectively rather than always.  In some
cases we ignore it (eg: read/write) to maintain chmod-after-open semantics
but in other cases we do care, eg: creating files, access() etc.  Never
ignore errors from VOP_ACCESS() on immutable files.

This apparently comes from BSDI (from Keith Bostic) via NetBSD.

PR:		5148
Submitted by:	Yoshiro MIHIRA <sanpei@yy.cs.keio.ac.jp>

Revision 1.60: download - view: text, markup, annotated - select for diffs
Thu May 7 04:58:51 1998 UTC (13 years, 9 months ago) by msmith
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +24 -13 lines
In the words of the submitter:

---------
Make callers of namei() responsible for releasing references or locks
instead of having the underlying filesystems do it.  This eliminates
redundancy in all terminal filesystems and makes it possible for stacked
transport layers such as umapfs or nullfs to operate correctly.

Quality testing was done with testvn, and lat_fs from the lmbench suite.

Some NFS client testing courtesy of Patrik Kudo.

vop_mknod and vop_symlink still release the returned vpp.  vop_rename
still releases 4 vnode arguments before it returns.  These remaining cases
will be corrected in the next set of patches.
---------

Submitted by:	Michael Hancock <michaelh@cet.co.jp>

Revision 1.59: download - view: text, markup, annotated - select for diffs
Mon Mar 30 09:53:56 1998 UTC (13 years, 10 months ago) by phk
Branches: MAIN
CVS tags: old_PRE_DEVFS_SLICE, old_POST_DEVFS_SLICE
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +3 -3 lines
Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed
around any access to it, unless you just wanted the seconds part.

Most uses of time.tv_sec now uses the new variable time_second instead.

gettime() changed to getmicrotime(0.

Remove a couple of unneeded splfoo() protections, the new getmicrotime()
is atomic, (until Bruce sets a breakpoint in it).

A couple of places needed random data, so use read_random() instead
of mucking about with time which isn't random.

Add a new nfs_curusec() function.

Mark a couple of bogosities involving the now disappeard time variable.

Update ffs_update() to avoid the weird "== &time" checks, by fixing the
one remaining call that passwd &time as args.

Change profiling in ncr.c to use ticks instead of time.  Resolution is
the same.

Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call
hzto() which subtracts time" sequences.

Reviewed by:	bde

Revision 1.34.2.3: download - view: text, markup, annotated - select for diffs
Sun Mar 1 22:33:27 1998 UTC (13 years, 11 months ago) by steve
Branches: old_RELENG_2_2
CVS tags: old_RELENG_2_2_6_RELEASE
Diff to: previous 1.34.2.2: preferred, colored; branchpoint 1.34: preferred, colored
Changes since revision 1.34.2.2: +3 -3 lines
MFC: Allow NULL cookie verifiers for non-NULL offsets.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Mon Feb 9 06:10:35 1998 UTC (14 years ago) by eivind
Branches: MAIN
CVS tags: old_PRE_SOFTUPDATE, old_POST_SOFTUPDATE
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +2 -2 lines
Staticize.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Fri Feb 6 12:13:56 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +1 -3 lines
Back out DIAGNOSTIC changes.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Wed Feb 4 22:33:14 1998 UTC (14 years ago) by eivind
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +3 -1 lines
Turn DIAGNOSTIC into a new-style option.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Sat Jan 31 11:56:14 1998 UTC (14 years ago) by dyson
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +6 -1 lines
Change the busy page mgmt, so that when pages are freed, they
MUST be PG_BUSY.  It is bogus to free a page that isn't busy,
because it is in a state of being "unavailable" when being
freed.  The additional advantage is that the page_remove code
has a better cross-check that the page should be busy and
unavailable for other use.  There were some minor problems
with the collapse code, and this plugs those subtile "holes."

Also, the vfs_bio code wasn't checking correctly for PG_BUSY
pages.  I am going to develop a more consistant scheme for
grabbing pages, busy or otherwise.  For now, we are stuck
with the current morass.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Mon Dec 29 00:23:34 1997 UTC (14 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +1 -3 lines
Lots of improvements, including restructring the caching and management
of vnodes and objects.  There are some metadata performance improvements
that come along with this.  There are also a few prototypes added when
the need is noticed.  Changes include:

1) Cleaning up vref, vget.
2) Removal of the object cache.
3) Nuke vnode_pager_uncache and friends, because they aren't needed anymore.
4) Correct some missing LK_RETRY's in vn_lock.
5) Correct the page range in the code for msync.

Be gentle, and please give me feedback asap.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sat Dec 27 02:56:34 1997 UTC (14 years, 1 month ago) by bde
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +2 -1 lines
Unspammed nested include of <vm/vm_zone.h>.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Tue Oct 28 15:59:05 1997 UTC (14 years, 3 months ago) by bde
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +1 -3 lines
Removed unused #includes.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Sun Sep 21 04:23:49 1997 UTC (14 years, 4 months ago) by dyson
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +22 -22 lines
Change the M_NAMEI allocations to use the zone allocator.  This change
plus the previous changes to use the zone allocator decrease the useage
of malloc by half.  The Zone allocator will be upgradeable to be able
to use per CPU-pools, and has more intelligent usage of SPLs.  Additionally,
it has reasonable stats gathering capabilities, while making most calls
inline.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Wed Sep 10 20:22:28 1997 UTC (14 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +1 -5 lines
Remove a couple of stubborn NetBSD #if's.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Wed Sep 10 19:52:25 1997 UTC (14 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +1 -19 lines
unifdef -U__NetBSD__ -D__FreeBSD__

Revision 1.48: download - view: text, markup, annotated - select for diffs
Tue Sep 2 01:19:33 1997 UTC (14 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +2 -1 lines
Added used #include - don't depend on <sys/mbuf.h> including
<sys/malloc.h> (unless we only use the bogusly shared M*WAIT flags).

Revision 1.47: download - view: text, markup, annotated - select for diffs
Sat Aug 16 19:15:56 1997 UTC (14 years, 5 months ago) by wollman
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +22 -22 lines
Fix all areas of the system (or at least all those in LINT) to avoid storing
socket addresses in mbufs.  (Socket buffers are the one exception.)  A number
of kernel APIs needed to get fixed in order to make this happen.  Also,
fix three protocol families which kept PCBs in mbufs to not malloc them
instead.  Delete some old compatibility cruft while we're at it, and add
some new routines in the in_cksum family.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Tue Jul 22 15:35:15 1997 UTC (14 years, 6 months ago) by dfr
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +3 -3 lines
Allow NULL cookie verifiers for non-NULL offsets.  This is needed for
Digital Unix boxes since they appear to always send null verifiers.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Wed Jul 16 09:06:28 1997 UTC (14 years, 6 months ago) by dfr
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +76 -30 lines
Merge WebNFS changes from NetBSD.

Obtained from:	NetBSD

Revision 1.44.2.1: download - view: text, markup, annotated - select for diffs
Wed Jul 2 19:54:18 1997 UTC (14 years, 7 months ago) by wollman
Branches: old_WOLLMAN_MBUF
Diff to: previous 1.44: preferred, colored; next MAIN 1.45: preferred, colored
Changes since revision 1.44: +22 -22 lines
Check in my big get-rid-of-sockaddrs-in-mbufs patch, on a private branch.

Requested by: julian

Revision 1.34.2.2: download - view: text, markup, annotated - select for diffs
Mon Jun 16 11:24:27 1997 UTC (14 years, 7 months ago) by bde
Branches: old_RELENG_2_2
CVS tags: old_RELENG_2_2_5_RELEASE
Diff to: previous 1.34.2.1: preferred, colored; branchpoint 1.34: preferred, colored
Changes since revision 1.34.2.1: +4 -3 lines
YAMFC (don't require superuser privileges for creating fifos).

PR:		3838
Reviewed by:	dfr

Revision 1.44: download - view: text, markup, annotated - select for diffs
Sat Jun 14 11:19:35 1997 UTC (14 years, 8 months ago) by bde
Branches: MAIN
CVS tags: old_BP_WOLLMAN_MBUF
Branch point for: old_WOLLMAN_MBUF
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +4 -3 lines
Don't require superuser privileges for creating fifos.  The v2 case was
broken when support for v3 was introduced in rev.1.16.  The v3 case has
always been broken in FreeBSD.

Should be in 2.2.

PR:		3838

Revision 1.43: download - view: text, markup, annotated - select for diffs
Tue Jun 3 13:56:54 1997 UTC (14 years, 8 months ago) by dfr
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +5 -2 lines
Implement the async mount option for NFSv3.  This makes NFS pretend that all
writes sent to the server were synchronous and therefore no commits are
needed.  This is the same as the vfs.nfs.async variable on the server but
allows each client to choose whether to work this way.

Also make the vfs.nfs.async variable do the 'right' thing for NFSv3, i.e.
pretend that the write was synchronous.

Revision 1.34.2.1: download - view: text, markup, annotated - select for diffs
Wed May 14 08:19:27 1997 UTC (14 years, 9 months ago) by dfr
Branches: old_RELENG_2_2
CVS tags: old_RELENG_2_2_2_RELEASE
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +21 -2 lines
YAMFC.  NFS fixes, make NFSv3 the default, some other fs fixes.

Reviewed by:	Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>

Revision 1.42: download - view: text, markup, annotated - select for diffs
Sat May 10 16:59:36 1997 UTC (14 years, 9 months ago) by dfr
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +4 -2 lines
Implement a separate control for write gathering on NFSv3.  This is turned
off for NFSv3 by default since write gathering seems to reduce performance
for NFSv3 by up to 60%.

Add sysctl knobs to control both variables.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sat May 10 16:12:03 1997 UTC (14 years, 9 months ago) by dfr
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +18 -1 lines
Fix a nasty hang connected with write gathering.  Also add debug print
statements to bits of the server which helped me find the hang.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Sat Mar 29 12:40:18 1997 UTC (14 years, 10 months ago) by bde
Branches: MAIN
CVS tags: old_pre_smp_merge, old_post_smp_merge
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +1 -2 lines
Removed #include of <ufs/ufs/dir.h>.  Nfs no longer depends on any ufs
features, and the one thing that it depended on (DIRBLKSIZ) now has
conflicting spelling.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Tue Mar 25 05:13:40 1997 UTC (14 years, 10 months ago) by peter
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +5 -1 lines
Use the correct (relative to the implementation) ordering of args in
the VOP_LINK() calls, Closes PR#3064

Submitted by: bde

Revision 1.38: download - view: text, markup, annotated - select for diffs
Tue Mar 25 05:08:28 1997 UTC (14 years, 10 months ago) by peter
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +7 -4 lines
The local fs interface does not allow link()/unlink() of directories,
do not allow a remote nfs client to cause local fs corruption either.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sat Feb 22 09:42:38 1997 UTC (14 years, 11 months ago) by peter
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +1 -1 lines
Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$.  We are not
ready for it yet.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Feb 10 02:17:15 1997 UTC (15 years ago) by dyson
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +10 -22 lines
This is the kernel Lite/2 commit.  There are some requisite userland
changes, so don't expect to be able to run the kernel as-is (very well)
without the appropriate Lite/2 userland changes.

The system boots and can mount UFS filesystems.

Untested: ext2fs, msdosfs, NFS
Known problems: Incorrect Berkeley ID strings in some files.
		Mount_std mounts will not work until the getfsent
		library routine is changed.

Reviewed by:	various people
Submitted by:	Jeffery Hsu <hsu@freebsd.org>

Revision 1.35: download - view: text, markup, annotated - select for diffs
Tue Jan 14 06:51:22 1997 UTC (15 years ago) by jkh
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +1 -1 lines
Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Thu Sep 19 18:20:56 1996 UTC (15 years, 4 months ago) by nate
Branches: MAIN
CVS tags: old_RELENG_2_2_BP, old_RELENG_2_2_1_RELEASE, old_RELENG_2_2_0_RELEASE
Branch point for: old_RELENG_2_2
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +5 -5 lines
        In sys/time.h, struct timespec is defined as:

        /*
         * Structure defined by POSIX.4 to be like a timeval.
         */
        struct timespec {
                time_t  ts_sec;         /* seconds */
                long    ts_nsec;        /* and nanoseconds */
        };

        The correct names of the fields are tv_sec and tv_nsec.

Reminded by:	James Drobina <jdrobina@infinet.com>

Revision 1.33: download - view: text, markup, annotated - select for diffs
Thu Sep 5 07:58:04 1996 UTC (15 years, 5 months ago) by davidg
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +2 -1 lines
Release an unneeded reference to a vnode that was gained in a VFS_VGET().
Fixes a readdirplus panic.

Submitted by:	Doug Rabson <dfr@render.com>

Revision 1.32: download - view: text, markup, annotated - select for diffs
Tue Sep 3 14:24:59 1996 UTC (15 years, 5 months ago) by bde
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +2 -2 lines
Eliminated nested include of <sys/unistd.h> in <sys/file.h> in the kernel.
Include it directly in the few places where it is used.

Reduced some #includes of <sys/file.h> to #includes of <sys/fcntl.h> or
nothing.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Wed Aug 21 21:55:48 1996 UTC (15 years, 5 months ago) by dyson
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +133 -153 lines
Even though this looks like it, this is not a complex code change.
The interface into the "VMIO" system has changed to be more consistant
and robust.  Essentially, it is now no longer necessary to call vn_open
to get merged VM/Buffer cache operation, and exceptional conditions
such as merged operation of VBLK devices is simpler and more correct.

This code corrects a potentially large set of problems including the
problems with ktrace output and loaded systems, file create/deletes,
etc.

Most of the changes to NFS are cosmetic and name changes, eliminating
a layer of subroutine calls.  The direct calls to vput/vrele have
been re-instituted for better cross platform compatibility.

Reviewed by: davidg

Revision 1.15.2.3: download - view: text, markup, annotated - select for diffs
Tue Jul 2 20:28:20 1996 UTC (15 years, 7 months ago) by bde
Branches: old_RELENG_2_1_0
CVS tags: old_RELENG_2_1_7_RELEASE, old_RELENG_2_1_6_RELEASE, old_RELENG_2_1_6_1_RELEASE, old_RELENG_2_1_5_RELEASE
Diff to: previous 1.15.2.2: preferred, colored; branchpoint 1.15: preferred, colored
Changes since revision 1.15.2.2: +2 -1 lines
Brought in change from rev.1.30: fixed a vnode reference leak in
nfsrv_rename().

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sat Jun 8 12:16:26 1996 UTC (15 years, 8 months ago) by bde
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +2 -1 lines
Fixed a vnode reference leak in nfsrv_rename().  The target inode wasn't
released until the file system was unmounted.  This bug also affected
kern/vfs_syscalls.c but was fixed in rev.1.18 and rev.1.20 there.

Reviewed by:	davidg

Revision 1.29: download - view: text, markup, annotated - select for diffs
Tue Apr 30 23:23:07 1996 UTC (15 years, 9 months ago) by bde
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +2 -2 lines
Fixed nfs sysctls.  They missed out on the fs -> vfs name changes from
Lite2.  This broke nfsstat.

Revision 1.15.2.2: download - view: text, markup, annotated - select for diffs
Thu Mar 21 20:29:58 1996 UTC (15 years, 10 months ago) by phk
Branches: old_RELENG_2_1_0
Diff to: previous 1.15.2.1: preferred, colored; branchpoint 1.15: preferred, colored
Changes since revision 1.15.2.1: +3 -1 lines
Remove KADB, we havn't had it ever I think.
Add support for NFS_SERVER and NFS_CLIENT options.

Revision 1.1.1.2 (vendor branch): download - view: text, markup, annotated - select for diffs
Mon Mar 11 19:34:03 1996 UTC (15 years, 11 months ago) by peter
Branches: old_CSRG
CVS tags: old_bsd_44_lite_2
Diff to: previous 1.1.1.1: preferred, colored
Changes since revision 1.1.1.1: +2137 -708 lines
Import 4.4BSD-Lite2 onto the vendor branch, note that in the kernel, all
files are off the vendor branch, so this should not change anything.

A "U" marker generally means that the file was not changed in between
the 4.4Lite and Lite-2 releases, and does not need a merge.  "C" generally
means that there was a change.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Sat Jan 13 23:27:48 1996 UTC (16 years, 1 month ago) by phk
Branches: MAIN
CVS tags: old_wollman_polling
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +9 -6 lines
Add an option NFS_NOSERVER which saves 100K in the install kernel (or
any other kernel that uses it).  Use with option NFS.

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sun Dec 17 21:12:22 1995 UTC (16 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +11 -7 lines
Staticize.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Thu Dec 7 12:47:25 1995 UTC (16 years, 2 months ago) by davidg
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +4 -1 lines
Untangled the vm.h include file spaghetti.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sun Oct 29 15:32:59 1995 UTC (16 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +10 -19 lines
Second batch of cleanup changes.
This time mostly making a lot of things static and some unused
variables here and there.

Revision 1.24: download - view: text, markup, annotated - select for diffs
Thu Aug 24 11:39:31 1995 UTC (16 years, 5 months ago) by davidg
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +11 -1 lines
Added NFS_ASYNC kernel option. It only has an effect for NFSv2.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Thu Aug 24 10:45:15 1995 UTC (16 years, 5 months ago) by dfr
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +3 -3 lines
Some fixes found using gcc -Wall:

nfsm_rpchead() has been called with the wrong number of args and misplaced
args since someone added new args in the middle for nfsv3.

Here's another one that would be important on 64-bit systems.  VOP_READDIR
takes a `u_int **cookies' arg.

Submitted by:	Bruce Evans <bde@zeta.org.au>

Revision 1.15.2.1: download - view: text, markup, annotated - select for diffs
Wed Aug 23 03:38:56 1995 UTC (16 years, 5 months ago) by davidg
Branches: old_RELENG_2_1_0
CVS tags: old_RELENG_2_1_0_RELEASE
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +13 -2 lines
Add support for an NFS_ASYNC kernel option.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sun Aug 6 11:55:25 1995 UTC (16 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +2 -3 lines
Fixed bug where vnode_pager_uncache() wasn't always called when it should
be. The result was that the file's space wouldn't be properly freed when
it was deleted.

Submitted by:	John Dyson

Revision 1.21: download - view: text, markup, annotated - select for diffs
Thu Aug 3 12:14:16 1995 UTC (16 years, 6 months ago) by dfr
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +18 -2 lines
Slight changes to locking around VOP_READRIR.
Detect in nfsrv_readdirplus when a filesystem soes not support VFS_VGET and
return NFSERR_NOTSUPP so that the client will use ordinary readdir instead.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Wed Aug 2 10:12:47 1995 UTC (16 years, 6 months ago) by dfr
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +3 -1 lines
Lock the directory vnode before VOP_READDIR in nfsrv_readdirplus

Revision 1.19: download - view: text, markup, annotated - select for diffs
Tue Aug 1 18:50:57 1995 UTC (16 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +2 -2 lines
Removed my special-case hack for VOP_LINK and fixed the problem with the
wrong vp's ops vector being used by changing the VOP_LINK's argument order.
The special-case hack doesn't go far enough and breaks the generic
bypass routine used in some non-leaf filesystems. Pointed out by Kirk
McKusick.

Revision 1.18: download - view: text, markup, annotated - select for diffs
Wed Jun 28 12:01:03 1995 UTC (16 years, 7 months ago) by davidg
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +9 -9 lines
1) Converted v_vmdata to v_object.
2) Removed unnecessary vm_object_lookup()/pager_cache(object, TRUE) pairs
   after vnode_pager_alloc() calls - the object is already guaranteed to be
   persistent.
3) Removed some gratuitous casts.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Wed Jun 28 07:06:50 1995 UTC (16 years, 7 months ago) by davidg
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +2 -2 lines
Fixed VOP_LINK argument order botch.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue Jun 27 11:06:37 1995 UTC (16 years, 7 months ago) by dfr
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +2161 -771 lines
Changes to support version 3 of the NFS protocol.
The version 2 support has been tested (client+server) against FreeBSD-2.0,
IRIX 5.3 and FreeBSD-current (using a loopback mount).  The version 2 support
is stable AFAIK.
The version 3 support has been tested with a loopback mount and minimally
against an IRIX 5.3 server.  It needs more testing and may have problems.
I have patched amd to support the new variable length filehandles although
it will still only use version 2 of the protocol.

Before booting a kernel with these changes, nfs clients will need to at least
build and install /usr/sbin/mount_nfs.  Servers will need to build and
install /usr/sbin/mountd.

NFS diskless support is untested.

Obtained from: Rick Macklem <rick@snowhite.cis.uoguelph.ca>

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sun Jun 11 19:31:45 1995 UTC (16 years, 8 months ago) by rgrimes
Branches: MAIN
CVS tags: old_RELENG_2_1_0_BP
Branch point for: old_RELENG_2_1_0
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +1 -6 lines
Merge RELENG_2_0_5 into HEAD

Revision 1.14.2.1: download - view: text, markup, annotated - select for diffs
Wed Jun 7 07:25:09 1995 UTC (16 years, 8 months ago) by davidg
Branches: old_RELENG_2_0_5
CVS tags: old_RELENG_2_0_5_RELEASE
Diff to: previous 1.14: preferred, colored; next MAIN 1.15: preferred, colored
Changes since revision 1.14: +1 -6 lines
Backed out one part of rev 1.13. In this one case, two references to the
vnode are gained, but only one reference to the object is gained. The
object reference is (correctly) lost by the nfsrv_vrele() at the exit
point of the nfsrv_link function.
The bug is easily seen by doing a standard "link" operation to a 2.0.5
server (ln foo bar). The system will immediately panic with "object
deallocated too many times".
This fixes the panic reported today by ohki@gssm.otsuka.tsukuba.ac.jp.

(will be) Reviewed by:	John Dyson

Revision 1.14: download - view: text, markup, annotated - select for diffs
Tue May 30 08:12:38 1995 UTC (16 years, 8 months ago) by rgrimes
Branches: MAIN
CVS tags: old_RELENG_2_0_5_BP
Branch point for: old_RELENG_2_0_5
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +8 -8 lines
Remove trailing whitespace.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Mon May 29 04:01:08 1995 UTC (16 years, 8 months ago) by davidg
Branches: MAIN
CVS tags: old_RELENG_2_0_5_ALPHA
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +32 -2 lines
Fixed some serious bugs that resulted in object reference counts not being
handled correctly. This would manifest itself as "object deallocated too
many times" panics and perhaps other strange inconsistencies on NFS servers.

Reviewed by:	me, of course
Submitted by:	John Dyson

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sun Mar 19 12:04:11 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +3 -4 lines
Removed unnecessary call to vnode_pager_uncache(). We automatically clear
the VTEXT flag after all mappers have finished with the object.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Fri Mar 17 07:45:19 1995 UTC (16 years, 10 months ago) by davidg
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +4 -4 lines
Changed some (incorrect) nfsrv_vput()'s back into regular vput()'s. This
fixes the last of the known NQNFS problems (until I find more, that is :-)).

Revision 1.10: download - view: text, markup, annotated - select for diffs
Wed Feb 15 03:38:12 1995 UTC (16 years, 11 months ago) by davidg
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -2 lines
Woops, change a nfsrv_vput back into a nfsrv_vrele.

Submitted by:	John Dyson

Revision 1.9: download - view: text, markup, annotated - select for diffs
Wed Feb 15 03:03:03 1995 UTC (16 years, 11 months ago) by davidg
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +4 -4 lines
Fixed three bugs related to the merged cache changes. The bugs likely would
make NFS servers flakey - probably the cause of freefall's recent hangs.

Submitted by:	John Dyson

Revision 1.8: download - view: text, markup, annotated - select for diffs
Mon Jan 9 16:05:07 1995 UTC (17 years, 1 month ago) by davidg
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +86 -86 lines
These changes embody the support of the fully coherent merged VM buffer cache,
much higher filesystem I/O performance, and much better paging performance. It
represents the culmination of over 6 months of R&D.

The majority of the merged VM/cache work is by John Dyson.

The following highlights the most significant changes. Additionally, there are
(mostly minor) changes to the various filesystem modules (nfs, msdosfs, etc) to
support the new VM/buffer scheme.

vfs_bio.c:
Significant rewrite of most of vfs_bio to support the merged VM buffer cache
scheme.  The scheme is almost fully compatible with the old filesystem
interface.  Significant improvement in the number of opportunities for write
clustering.

vfs_cluster.c, vfs_subr.c
Upgrade and performance enhancements in vfs layer code to support merged
VM/buffer cache.  Fixup of vfs_cluster to eliminate the bogus pagemove stuff.

vm_object.c:
Yet more improvements in the collapse code.  Elimination of some windows that
can cause list corruption.

vm_pageout.c:
Fixed it, it really works better now.  Somehow in 2.0, some "enhancements"
broke the code.  This code has been reworked from the ground-up.

vm_fault.c, vm_page.c, pmap.c, vm_object.c
Support for small-block filesystems with merged VM/buffer cache scheme.

pmap.c vm_map.c
Dynamic kernel VM size, now we dont have to pre-allocate excessive numbers of
kernel PTs.

vm_glue.c
Much simpler and more effective swapping code.  No more gratuitous swapping.

proc.h
Fixed the problem that the p_lock flag was not being cleared on a fork.

swap_pager.c, vnode_pager.c
Removal of old vfs_bio cruft to support the past pseudo-coherency.  Now the
code doesn't need it anymore.

machdep.c
Changes to better support the parameter values for the merged VM/buffer cache
scheme.

machdep.c, kern_exec.c, vm_glue.c
Implemented a seperate submap for temporary exec string space and another one
to contain process upages. This eliminates all map fragmentation problems
that previously existed.

ffs_inode.c, ufs_inode.c, ufs_readwrite.c
Changes for merged VM/buffer cache.  Add "bypass" support for sneaking in on
busy buffers.

Submitted by:	John Dyson and David Greenman

Revision 1.7: download - view: text, markup, annotated - select for diffs
Sun Oct 2 17:26:58 1994 UTC (17 years, 4 months ago) by phk
Branches: MAIN
CVS tags: old_RELEASE_2_0, old_OLAH_TTCP, old_BETA_2_0, old_ALPHA_2_0
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +102 -57 lines
Prototyping and general gcc-shutting up.  Gcc has one warning now which looks
bad, I will get to it eventually, unless somebody beats me to it.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Wed Sep 28 16:45:18 1994 UTC (17 years, 4 months ago) by dfr
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +65 -39 lines
Make NFS ask the filesystems for directory cookies instead of making them
itself.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Sep 22 19:38:25 1994 UTC (17 years, 4 months ago) by wollman
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +1 -7 lines
More loadable VFS changes:

- Make a number of filesystems work again when they are statically compiled
  (blush)

- FIFOs are no longer optional; ``options FIFO'' removed from distributed
  config files.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Aug 29 06:09:06 1994 UTC (17 years, 5 months ago) by davidg
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +2 -3 lines
"bogus" fixes from 1.1.5 to work around some cache coherency problems.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Tue Aug 2 07:52:09 1994 UTC (17 years, 6 months ago) by davidg
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +1 -0 lines
Added $Id$

Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed May 25 09:12:33 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +27 -6 lines
The big 4.4BSD Lite to FreeBSD 2.0.0 (Development) patch.

Reviewed by:	Rodney W. Grimes
Submitted by:	John Dyson and David Greenman

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Tue May 24 10:08:30 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: old_CSRG
CVS tags: old_bsd_44_lite, old_REL_before_johndavid_2_0_0
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
BSD 4.4 Lite Kernel Sources

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue May 24 10:08:29 1994 UTC (17 years, 8 months ago) by rgrimes
Branches: MAIN
Initial revision

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options