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

CVS log for src/sys/kern/vfs_default.c

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

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.154.2.6: download - view: text, markup, annotated - select for diffs
Fri Jan 6 19:32:39 2012 UTC (4 weeks, 6 days ago) by jhb
Branches: RELENG_8
Diff to: previous 1.154.2.5: preferred, colored; branchpoint 1.154: preferred, colored; next MAIN 1.155: preferred, colored
Changes since revision 1.154.2.5: +53 -0 lines
SVN rev 229725 on 2012-01-06 19:32:39Z by jhb

MFC 226217,227070,227341,227502:
Add the posix_fadvise(2) system call.  It is somewhat similar to
madvise(2) except that it operates on a file descriptor instead of a
memory region.  It is currently only supported on regular files.

Note that this adds a new VOP, so all filesystem modules must be
recompiled.

Approved by:	re (kib)

Revision 1.165.2.3: download - view: text, markup, annotated - select for diffs
Fri Jan 6 19:29:16 2012 UTC (4 weeks, 6 days ago) by jhb
Branches: RELENG_9
Diff to: previous 1.165.2.2: preferred, colored; branchpoint 1.165: preferred, colored; next MAIN 1.166: preferred, colored
Changes since revision 1.165.2.2: +53 -0 lines
SVN rev 229723 on 2012-01-06 19:29:16Z by jhb

MFC 227070,227341,227502:
Add the posix_fadvise(2) system call.  It is somewhat similar to
madvise(2) except that it operates on a file descriptor instead of a
memory region.  It is currently only supported on regular files.

Note that this adds a new VOP, so all filesystem modules must be
recompiled.

Approved by:	re (kib)

Revision 1.165.2.2: download - view: text, markup, annotated - select for diffs
Fri Jan 6 15:07:28 2012 UTC (4 weeks, 6 days ago) by kib
Branches: RELENG_9
Diff to: previous 1.165.2.1: preferred, colored; branchpoint 1.165: preferred, colored
Changes since revision 1.165.2.1: +1 -1 lines
SVN rev 229703 on 2012-01-06 15:07:28Z by kib

MFC r227697:
Change the interface for VOP_VPTOCNP(), now the dvp must be
referenced. Convert all in-tree implementations of VOP_VPTOCNP().
This fixes VOP_VPTOCNP bypass for nullfs.

Approved by:	re (bz)

Revision 1.167: download - view: text, markup, annotated - select for diffs
Sat Nov 19 07:50:49 2011 UTC (2 months, 3 weeks ago) by kib
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.166: preferred, colored
Changes since revision 1.166: +1 -1 lines
SVN rev 227697 on 2011-11-19 07:50:49Z by kib

Existing VOP_VPTOCNP() interface has a fatal flow that is critical for
nullfs.  The problem is that resulting vnode is only required to be
held on return from the successfull call to vop, instead of being
referenced.

Nullfs VOP_INACTIVE() method reclaims the vnode, which in combination
with the VOP_VPTOCNP() interface means that the directory vnode
returned from VOP_VPTOCNP() is reclaimed in advance, causing
vn_fullpath() to error with EBADF or like.

Change the interface for VOP_VPTOCNP(), now the dvp must be
referenced. Convert all in-tree implementations of VOP_VPTOCNP(),
which is trivial, because vhold(9) and vref(9) are similar in the
locking prerequisites. Out-of-tree fs implementation of VOP_VPTOCNP(),
if any, should have no trouble with the fix.

Tested by:	pho
Reviewed by:	mckusick
MFC after:	3 weeks (subject of re approval)

Revision 1.154.2.5: download - view: text, markup, annotated - select for diffs
Wed Nov 16 18:33:17 2011 UTC (2 months, 3 weeks ago) by jhb
Branches: RELENG_8
Diff to: previous 1.154.2.4: preferred, colored; branchpoint 1.154: preferred, colored
Changes since revision 1.154.2.4: +129 -0 lines
SVN rev 227573 on 2011-11-16 18:33:17Z by jhb

MFC 220791,220793,220846,221836,226364:
Add the posix_fallocate(2) syscall.  The default implementation in
vop_stdallocate() is filesystem agnostic and will run as slow as a
read/write loop in userspace; however, it serves to correctly
implement the functionality for filesystems that do not implement a
VOP_ALLOCATE.

Allow VOP_ALLOCATE to be iterative, and have kern_posix_fallocate(9)
drive looping and potentially yielding.

Reviewed by:	mdf

Revision 1.165.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.165.2.1: preferred, colored; next MAIN 1.165.2.2: preferred, colored
Changes since revision 1.165.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.166: download - view: text, markup, annotated - select for diffs
Fri Nov 4 04:02:50 2011 UTC (3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.165: preferred, colored
Changes since revision 1.165: +53 -0 lines
SVN rev 227070 on 2011-11-04 04:02:50Z by jhb

Add the posix_fadvise(2) system call.  It is somewhat similar to
madvise(2) except that it operates on a file descriptor instead of a
memory region.  It is currently only supported on regular files.

Just as with madvise(2), the advice given to posix_fadvise(2) can be
divided into two types.  The first type provide hints about data access
patterns and are used in the file read and write routines to modify the
I/O flags passed down to VOP_READ() and VOP_WRITE().  These modes are
thus filesystem independent.  Note that to ease implementation (and
since this API is only advisory anyway), only a single non-normal
range is allowed per file descriptor.

The second type of hints are used to hint to the OS that data will or
will not be used.  These hints are implemented via a new VOP_ADVISE().
A default implementation is provided which does nothing for the WILLNEED
request and attempts to move any clean pages to the cache page queue for
the DONTNEED request.  This latter case required two other changes.
First, a new V_CLEANONLY flag was added to vinvalbuf().  This requests
vinvalbuf() to only flush clean buffers for the vnode from the buffer
cache and to not remove any backing pages from the vnode.  This is
used to ensure clean pages are not wired into the buffer cache before
attempting to move them to the cache page queue.  The second change adds
a new vm_object_page_cache() method.  This method is somewhat similar to
vm_object_page_remove() except that instead of freeing each page in the
specified range, it attempts to move clean pages to the cache queue if
possible.

To preserve the ABI of struct file, the f_cdevpriv pointer is now reused
in a union to point to the currently active advice region if one is
present for regular files.

Reviewed by:	jilles, kib, arch@
Approved by:	re (kib)
MFC after:	1 month

Revision 1.165.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.165: preferred, colored
Changes since revision 1.165: +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.165: download - view: text, markup, annotated - select for diffs
Sun May 22 01:07:54 2011 UTC (8 months, 2 weeks ago) by rmacklem
Branches: MAIN
CVS tags: RELENG_9_BP
Branch point for: RELENG_9
Diff to: previous 1.164: preferred, colored
Changes since revision 1.164: +2 -1 lines
SVN rev 222167 on 2011-05-22 01:07:54Z by rmacklem

Add a lock flags argument to the VFS_FHTOVP() file system
method, so that callers can indicate the minimum vnode
locking requirement. This will allow some file systems to choose
to return a LK_SHARED locked vnode when LK_SHARED is specified
for the flags argument. This patch only adds the flag. It
does not change any file system to use it and all callers
specify LK_EXCLUSIVE, so file system semantics are not changed.

Reviewed by:	kib

Revision 1.164: download - view: text, markup, annotated - select for diffs
Tue Apr 19 16:36:24 2011 UTC (9 months, 3 weeks ago) by mdf
Branches: MAIN
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +21 -23 lines
SVN rev 220846 on 2011-04-19 16:36:24Z by mdf

Allow VOP_ALLOCATE to be iterative, and have kern_posix_fallocate(9)
drive looping and potentially yielding.

Requested by:	kib

Revision 1.163: download - view: text, markup, annotated - select for diffs
Mon Apr 18 16:32:22 2011 UTC (9 months, 3 weeks ago) by mdf
Branches: MAIN
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +131 -0 lines
SVN rev 220791 on 2011-04-18 16:32:22Z by mdf

Add the posix_fallocate(2) syscall.  The default implementation in
vop_stdallocate() is filesystem agnostic and will run as slow as a
read/write loop in userspace; however, it serves to correctly
implement the functionality for filesystems that do not implement a
VOP_ALLOCATE.

Note that __FreeBSD_version was already bumped today to 900036 for any
ports which would like to use this function.

Also reserve space in the syscall table for posix_fadvise(2).

Reviewed by:	-arch (previous version)

Revision 1.138.2.2.6.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.138.2.2: preferred, colored; next MAIN 1.139: preferred, colored
Changes since revision 1.138.2.2: +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.154.2.4.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
CVS tags: RELENG_8_2_0_RELEASE
Diff to: previous 1.154.2.4: preferred, colored; next MAIN 1.154.2.5: preferred, colored
Changes since revision 1.154.2.4: +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.154.2.4: download - view: text, markup, annotated - select for diffs
Thu Sep 2 04:56:01 2010 UTC (17 months, 1 week ago) by brian
Branches: RELENG_8
CVS tags: RELENG_8_2_BP
Branch point for: RELENG_8_2
Diff to: previous 1.154.2.3: preferred, colored; branchpoint 1.154: preferred, colored
Changes since revision 1.154.2.3: +3 -0 lines
SVN rev 212137 on 2010-09-02 04:56:01Z by brian

MFC r211684 & r211818; return ENOENT if we fall off the end of the directory.

Revision 1.162: download - view: text, markup, annotated - select for diffs
Wed Aug 25 18:09:51 2010 UTC (17 months, 2 weeks ago) by brian
Branches: MAIN
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +6 -2 lines
SVN rev 211818 on 2010-08-25 18:09:51Z by brian

If we read zero bytes from the directory, early out with ENOENT
rather than forging ahead and interpreting garbage buffer content
and dirent structures.

This change backs out r211684 which was essentially a no-op.

MFC after:	1 week

Revision 1.161: download - view: text, markup, annotated - select for diffs
Mon Aug 23 05:33:31 2010 UTC (17 months, 2 weeks ago) by brian
Branches: MAIN
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +2 -3 lines
SVN rev 211684 on 2010-08-23 05:33:31Z by brian

uio_resid isn't updated by VOP_READDIR for nfs filesystems.  Use
the uio_offset adjustment instead to calculate a correct *len.

Without this change, we run off the end of the directory data
we're reading and panic horribly for nfs filesystems.

MFC after:	1 week

Revision 1.154.2.3.2.1: download - view: text, markup, annotated - select for diffs
Mon Jun 14 02:09:06 2010 UTC (19 months, 3 weeks ago) by kensmith
Branches: RELENG_8_1
CVS tags: RELENG_8_1_0_RELEASE
Diff to: previous 1.154.2.3: preferred, colored; next MAIN 1.154.2.4: preferred, colored
Changes since revision 1.154.2.3: +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.160: download - view: text, markup, annotated - select for diffs
Wed May 12 21:24:46 2010 UTC (20 months, 4 weeks ago) by zml
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +11 -0 lines
SVN rev 208003 on 2010-05-12 21:24:46Z by zml

Add VOP_ADVLOCKPURGE so that the file system is called when purging
locks (in the case where the VFS impl isn't using lf_*)

Submitted by:       Matthew Fleming <matthew.fleming@isilon.com>
Reviewed by:        zml, dfr

Revision 1.154.2.3: download - view: text, markup, annotated - select for diffs
Fri Apr 9 08:45:30 2010 UTC (22 months ago) by kib
Branches: RELENG_8
CVS tags: RELENG_8_1_BP
Branch point for: RELENG_8_1
Diff to: previous 1.154.2.2: preferred, colored; branchpoint 1.154: preferred, colored
Changes since revision 1.154.2.2: +16 -0 lines
SVN rev 206414 on 2010-04-09 08:45:30Z by kib

MFC r206094:
Supply default implementation of VOP_RENAME() that does neccessary
unlocks and unreferences for argument vnodes, as expected by
kern_renameat(9), and returns EOPNOTSUPP. This fixes locks and
reference leaks when rename is attempted on fs that does not
implement rename.

Revision 1.159: download - view: text, markup, annotated - select for diffs
Fri Apr 2 14:03:43 2010 UTC (22 months, 1 week ago) by kib
Branches: MAIN
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +16 -0 lines
SVN rev 206094 on 2010-04-02 14:03:43Z by kib

Supply default implementation of VOP_RENAME() that does neccessary
unlocks and unreferences for argument vnodes, as expected by
kern_renameat(9), and returns EOPNOTSUPP. This fixes locks and
reference leaks when rename is attempted on fs that does not
implement rename.

PR:	kern/107439
Based on submission by:	Mikolaj Golub <to.my.trociny gmail com>
Tested by:	Mikolaj Golub
MFC after:	1 week

Revision 1.154.2.2: download - view: text, markup, annotated - select for diffs
Sat Mar 27 17:22:11 2010 UTC (22 months, 2 weeks ago) by trasz
Branches: RELENG_8
Diff to: previous 1.154.2.1: preferred, colored; branchpoint 1.154: preferred, colored
Changes since revision 1.154.2.1: +15 -0 lines
SVN rev 205748 on 2010-03-27 17:22:11Z by trasz

MFC r197680:

Provide default implementation for VOP_ACCESS(9), so that filesystems which
want to provide VOP_ACCESSX(9) don't have to implement both.  Note that
this commit makes implementation of either of these two mandatory.

Reviewed by:	kib

Revision 1.158: download - view: text, markup, annotated - select for diffs
Thu Feb 18 22:14:44 2010 UTC (23 months, 3 weeks ago) by pjd
Branches: MAIN
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +1 -4 lines
SVN rev 204065 on 2010-02-18 22:14:44Z by pjd

Use vput() instead of VOP_UNLOCK()+vrele(). The comment here is out-dated,
we no longer pass thread pointer to VOP_UNLOCK().

Revision 1.138.2.2.4.1: download - view: text, markup, annotated - select for diffs
Wed Feb 10 00:26:20 2010 UTC (23 months, 4 weeks ago) by kensmith
Branches: RELENG_7_3
CVS tags: RELENG_7_3_0_RELEASE
Diff to: previous 1.138.2.2: preferred, colored; next MAIN 1.139: preferred, colored
Changes since revision 1.138.2.2: +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.157: download - view: text, markup, annotated - select for diffs
Wed Nov 11 13:49:22 2009 UTC (2 years, 2 months ago) by trasz
Branches: MAIN
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +0 -8 lines
SVN rev 199183 on 2009-11-11 13:49:22Z by trasz

Revert r198873.  Having different VAPPEND semantics for VOP_ACCESS(9)
and VOP_ACCESSX(9) is not a good idea.

Revision 1.156: download - view: text, markup, annotated - select for diffs
Wed Nov 4 06:47:14 2009 UTC (2 years, 3 months ago) by trasz
Branches: MAIN
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +8 -0 lines
SVN rev 198873 on 2009-11-04 06:47:14Z by trasz

While VAPPEND without VWRITE makes sense for VOP_ACCESSX(9) (e.g. to check
for the permission to create subdirectory (ACE4_ADD_SUBDIRECTORY)), it doesn't
really make sense for VOP_ACCESS(9).  Also, many VOP_ACCESS(9) implementations
don't expect that.  Make sure we don't confuse them.

Revision 1.154.2.1.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.154.2.1: preferred, colored; next MAIN 1.154.2.2: preferred, colored
Changes since revision 1.154.2.1: +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.155: download - view: text, markup, annotated - select for diffs
Thu Oct 1 17:22:03 2009 UTC (2 years, 4 months ago) by trasz
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +15 -0 lines
SVN rev 197680 on 2009-10-01 17:22:03Z by trasz

Provide default implementation for VOP_ACCESS(9), so that filesystems which
want to provide VOP_ACCESSX(9) don't have to implement both.  Note that
this commit makes implementation of either of these two mandatory.

Reviewed by:	kib

Revision 1.154.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
CVS tags: RELENG_8_0_BP
Branch point for: RELENG_8_0
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +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.154: download - view: text, markup, annotated - select for diffs
Sun Jun 21 19:21:01 2009 UTC (2 years, 7 months ago) by kib
Branches: MAIN
CVS tags: RELENG_8_BP
Branch point for: RELENG_8
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +5 -4 lines
SVN rev 194601 on 2009-06-21 19:21:01Z by kib

Add explicit struct ucred * argument for VOP_VPTOCNP, to be used by
vn_open_cred in default implementation. Valid struct ucred is needed for
audit and MAC, and curthread credentials may be wrong.

This further requires modifying the interface of vn_fullpath(9), but it
is out of scope of this change.

Reviewed by:	rwatson

Revision 1.153: download - view: text, markup, annotated - select for diffs
Sun Jun 21 13:41:32 2009 UTC (2 years, 7 months ago) by kib
Branches: MAIN
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +1 -1 lines
SVN rev 194586 on 2009-06-21 13:41:32Z by kib

Add another flags argument to vn_open_cred. Use it to specify that some
vn_open_cred invocations shall not audit namei path.

In particular, specify VN_OPEN_NOAUDIT for dotdot lookup performed by
default implementation of vop_vptocnp, and for the open done for core
file. vn_fullpath is called from the audit code, and vn_open there need
to disable audit to avoid infinite recursion. Core file is created on
return to user mode, that, in particular, happens during syscall return.
The creation of the core file is audited by direct calls, and we do not
want to overwrite audit information for syscall.

Reported, reviewed and tested by: rwatson

Revision 1.152: download - view: text, markup, annotated - select for diffs
Fri Jun 5 14:23:24 2009 UTC (2 years, 8 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.151: preferred, colored
Changes since revision 1.151: +2 -0 lines
SVN rev 193508 on 2009-06-05 14:23:24Z by rwatson

Add mac_framework.h include missed when MAC code was (presumably) copied
from another file.

Revision 1.151: download - view: text, markup, annotated - select for diffs
Sat May 30 13:59:05 2009 UTC (2 years, 8 months ago) by trasz
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +17 -0 lines
SVN rev 193092 on 2009-05-30 13:59:05Z by trasz

Add VOP_ACCESSX, which can be used to query for newly added V*
permissions, such as VWRITE_ACL.  For a filsystems that don't
implement it, there is a default implementation, which works
as a wrapper around VOP_ACCESS.

Reviewed by:	rwatson@

Revision 1.150: 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.149: preferred, colored
Changes since revision 1.149: +8 -12 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.138.2.2.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.138.2.2: preferred, colored; next MAIN 1.139: preferred, colored
Changes since revision 1.138.2.2: +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.149: download - view: text, markup, annotated - select for diffs
Fri Apr 10 10:52:19 2009 UTC (2 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +0 -1 lines
SVN rev 190888 on 2009-04-10 10:52:19Z by rwatson

Remove VOP_LEASE and supporting functions.  This hasn't been used since
the removal of NQNFS, but was left in in case it was required for NFSv4.
Since our new NFSv4 client and server can't use it for their
requirements, GC the old mechanism, as well as other unused lease-
related code and interfaces.

Due to its impact on kernel programming and binary interfaces, this
change should not be MFC'd.

Proposed by:    jeff
Reviewed by:    jeff
Discussed with: rmacklem, zach loafman @ isilon

Revision 1.138.2.2: download - view: text, markup, annotated - select for diffs
Fri Mar 13 10:52:22 2009 UTC (2 years, 10 months ago) by kib
Branches: RELENG_7
CVS tags: RELENG_7_4_BP, RELENG_7_3_BP, RELENG_7_2_BP
Branch point for: RELENG_7_4, RELENG_7_3, RELENG_7_2
Diff to: previous 1.138.2.1: preferred, colored; branchpoint 1.138: preferred, colored; next MAIN 1.139: preferred, colored
Changes since revision 1.138.2.1: +1 -11 lines
SVN rev 189766 on 2009-03-13 10:52:22Z by kib

MFC r189450:
Extract the no_poll() and vop_nopoll() code into the common routine
poll_no_poll().
Return a poll_no_poll() result from devfs_poll_f() when
filedescriptor does not reference the live cdev, instead of ENXIO.

Revision 1.148: download - view: text, markup, annotated - select for diffs
Sun Mar 8 19:05:53 2009 UTC (2 years, 11 months ago) by marcus
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +235 -1 lines
SVN rev 189539 on 2009-03-08 19:05:53Z by marcus

Add a default implementation for VOP_VPTOCNP(9) which scans the parent
directory of a vnode to find a dirent with a matching file number.  The
name from that dirent is then used to provide the component name.

Note: if the initial vnode argument is not a directory itself, then
the default VOP_VPTOCNP(9) implementation still returns ENOENT.

Reviewed by:	kib
Approved by:	kib
Tested by:	pho

Revision 1.147: download - view: text, markup, annotated - select for diffs
Fri Mar 6 15:35:37 2009 UTC (2 years, 11 months ago) by kib
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +1 -11 lines
SVN rev 189450 on 2009-03-06 15:35:37Z by kib

Extract the no_poll() and vop_nopoll() code into the common routine
poll_no_poll().
Return a poll_no_poll() result from devfs_poll_f() when
filedescriptor does not reference the live cdev, instead of ENXIO.

Noted and tested by:	hps
MFC after:	1 week

Revision 1.146: download - view: text, markup, annotated - select for diffs
Fri Dec 12 00:57:38 2008 UTC (3 years, 1 month ago) by marcus
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +8 -0 lines
SVN rev 185956 on 2008-12-12 00:57:38Z by marcus

Add a new VOP, VOP_VPTOCNP, which translates a vnode to its component name
on a best-effort basis.  Teach vn_fullpath to use this new VOP if a
regular VFS cache lookup fails.  This VOP is designed to supplement the
VFS cache to provide a better chance that a vnode-to-name lookup will
succeed.

Currently, an implementation for devfs is being committed.  The default
implementation is to return ENOENT.

A big thanks to kib for the mentorship on this, and to pho for running it
through his stress test suite.

Reviewed by:	arch
Approved by:	kib

Revision 1.138.2.1.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
CVS tags: RELENG_7_1_0_RELEASE
Diff to: previous 1.138.2.1: preferred, colored; next MAIN 1.138.2.2: preferred, colored
Changes since revision 1.138.2.1: +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.127.2.6.2.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.127.2.6: preferred, colored; next MAIN 1.128: preferred, colored
Changes since revision 1.127.2.6: +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.145: 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.144: preferred, colored
Changes since revision 1.144: +10 -6 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.138.2.1: download - view: text, markup, annotated - select for diffs
Fri Aug 1 09:46:19 2008 UTC (3 years, 6 months ago) by kib
Branches: RELENG_7
CVS tags: RELENG_7_1_BP
Branch point for: RELENG_7_1
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +40 -1 lines
SVN rev 181119 on 2008-08-01 09:46:19Z by kib

MFC r178243:
Move the head of byte-level advisory lock list from the
filesystem-specific vnode data to the struct vnode. Provide the
default implementation for the vop_advlock and vop_advlockasync.
Purge the locks on the vnode reclaim by using the lf_purgelocks().
The default implementation is augmented for the nfs and smbfs.
In the nfs_advlock, push the Giant inside the nfs_dolock.

Before the change, the vop_advlock and vop_advlockasync have taken the
unlocked vnode and dereferenced the fs-private inode data, racing with
with the vnode reclamation due to forced unmount. Now, the vop_getattr
under the shared vnode lock is used to obtain the inode size, and
later, in the lf_advlockasync, after locking the vnode interlock, the
VI_DOOMED flag is checked to prevent an operation on the doomed vnode.

MFC r178247:
Fix compilation with LOCKF_DEBUG.

As was announced on the stable@, the MFC changes the VFS KBI on RELENG_7.

Approved by:	re (kensmith)

Revision 1.144: download - view: text, markup, annotated - select for diffs
Wed Apr 16 11:33:31 2008 UTC (3 years, 9 months ago) by kib
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +40 -1 lines
Move the head of byte-level advisory lock list from the
filesystem-specific vnode data to the struct vnode. Provide the
default implementation for the vop_advlock and vop_advlockasync.
Purge the locks on the vnode reclaim by using the lf_purgelocks().
The default implementation is augmented for the nfs and smbfs.
In the nfs_advlock, push the Giant inside the nfs_dolock.

Before the change, the vop_advlock and vop_advlockasync have taken the
unlocked vnode and dereferenced the fs-private inode data, racing with
with the vnode reclamation due to forced unmount. Now, the vop_getattr
under the shared vnode lock is used to obtain the inode size, and
later, in the lf_advlockasync, after locking the vnode interlock, the
VI_DOOMED flag is checked to prevent an operation on the doomed vnode.

The implementation of the lf_purgelocks() is submitted by dfr.

Reported by:	kris
Tested by:	kris, pho
Discussed with:	jeff, dfr
MFC after:	2 weeks

Revision 1.143: download - view: text, markup, annotated - select for diffs
Sat Mar 22 09:15:14 2008 UTC (3 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +12 -15 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.127.2.6: download - view: text, markup, annotated - select for diffs
Tue Feb 26 18:19:49 2008 UTC (3 years, 11 months ago) by obrien
Branches: RELENG_6
CVS tags: RELENG_6_4_BP
Branch point for: RELENG_6_4
Diff to: previous 1.127.2.5: preferred, colored; branchpoint 1.127: preferred, colored; next MAIN 1.128: preferred, colored
Changes since revision 1.127.2.5: +1 -1 lines
Back out MFC of "eradicate caddr_t".
Turn's out Kris' suspisions were right - from a suttle code compatability
point of view.  Robert Watson found that ARLA code had something like this:
	typedef int (*foo_t)(caddr_t); ... foo_t fred;
The compile gets all snarky when it finds int fred(void *) { .. }.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Mon Feb 25 18:45:56 2008 UTC (3 years, 11 months ago) by attilio
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +1 -4 lines
Axe the 'thread' argument from VOP_ISLOCKED() and lockstatus() as it is
always curthread.

As KPI gets broken by this patch, manpages and __FreeBSD_version will be
updated by further commits.

Tested by:	Andrea Barberio <insomniac at slackware dot it>

Revision 1.127.2.5: download - view: text, markup, annotated - select for diffs
Mon Feb 25 08:55:01 2008 UTC (3 years, 11 months ago) by obrien
Branches: RELENG_6
Diff to: previous 1.127.2.4: preferred, colored; branchpoint 1.127: preferred, colored
Changes since revision 1.127.2.4: +1 -1 lines
MFC: Eradicate caddr_t from the VFS API.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Fri Feb 15 21:04:36 2008 UTC (3 years, 11 months ago) by attilio
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +2 -1 lines
- Introduce lockmgr_args() in the lockmgr space.  This function performs
  the same operation of lockmgr() but accepting a custom wmesg, prio and
  timo for the particular lock instance, overriding default values
  lkp->lk_wmesg, lkp->lk_prio and lkp->lk_timo.
- Use lockmgr_args() in order to implement BUF_TIMELOCK()
- Cleanup BUF_LOCK()
- Remove LK_INTERNAL as it is nomore used in the lockmgr namespace

Tested by:	Andrea Barberio <insomniac at slackware dot it>

Revision 1.140: download - view: text, markup, annotated - select for diffs
Thu Jan 24 12:34:28 2008 UTC (4 years ago) by attilio
Branches: MAIN
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +3 -4 lines
Cleanup lockmgr interface and exported KPI:
- Remove the "thread" argument from the lockmgr() function as it is
  always curthread now
- Axe lockcount() function as it is no longer used
- Axe LOCKMGR_ASSERT() as it is bogus really and no currently used.
  Hopefully this will be soonly replaced by something suitable for it.
- Remove the prototype for dumplockinfo() as the function is no longer
  present

Addictionally:
- Introduce a KASSERT() in lockstatus() in order to let it accept only
  curthread or NULL as they should only be passed
- Do a little bit of style(9) cleanup on lockmgr.h

KPI results heavilly broken by this change, so manpages and
FreeBSD_version will be modified accordingly by further commits.

Tested by: matteo

Revision 1.139: download - view: text, markup, annotated - select for diffs
Sun Jan 13 14:44:10 2008 UTC (4 years ago) by attilio
Branches: MAIN
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +5 -4 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.138: download - view: text, markup, annotated - select for diffs
Fri May 18 13:02:13 2007 UTC (4 years, 8 months ago) by kib
Branches: MAIN
CVS tags: RELENG_7_BP, RELENG_7_0_BP, RELENG_7_0_0_RELEASE, RELENG_7_0
Branch point for: RELENG_7
Diff to: previous 1.137: preferred, colored
Changes since revision 1.137: +2 -2 lines
Since renaming of vop_lock to _vop_lock, pre- and post-condition
function calls are no more generated for vop_lock.
Rename _vop_lock to vop_lock1 to satisfy tools/vnode_if.awk assumption
about vop naming conventions. This restores pre/post-condition calls.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Fri Feb 16 17:32:41 2007 UTC (4 years, 11 months ago) by pjd
Branches: MAIN
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +1 -14 lines
Remove VFS_VPTOFH entirely. API is already broken and it is good time to
do it.

Suggested by:	rwatson

Revision 1.136: 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.135: preferred, colored
Changes since revision 1.135: +11 -0 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.135: download - view: text, markup, annotated - select for diffs
Mon Nov 13 05:51:22 2006 UTC (5 years, 2 months ago) by kmacy
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +5 -3 lines
change vop_lock handling to allowing tracking of callers' file and line for
acquisition of lockmgr locks

Approved by: scottl (standing in for mentor rwatson)

Revision 1.127.2.4: download - view: text, markup, annotated - select for diffs
Wed Sep 27 00:41:50 2006 UTC (5 years, 4 months ago) by tegge
Branches: RELENG_6
CVS tags: RELENG_6_3_BP, RELENG_6_3_0_RELEASE, RELENG_6_3, RELENG_6_2_BP, RELENG_6_2_0_RELEASE, RELENG_6_2
Diff to: previous 1.127.2.3: preferred, colored; branchpoint 1.127: preferred, colored
Changes since revision 1.127.2.3: +6 -4 lines
MFC rev 1.134: Handle reclaimed vnode in VOP_GETWRITEMOUNT()

Approved by:	re (kensmith)

Revision 1.127.2.3: download - view: text, markup, annotated - select for diffs
Wed Sep 27 00:34:51 2006 UTC (5 years, 4 months ago) by tegge
Branches: RELENG_6
Diff to: previous 1.127.2.2: preferred, colored; branchpoint 1.127: preferred, colored
Changes since revision 1.127.2.2: +15 -1 lines
MFC rev 1.133: VOP_GETWRITEMOUNT() returns a referenced mount.

Approved by:	re (kensmith)

Revision 1.134: download - view: text, markup, annotated - select for diffs
Wed Sep 20 00:27:02 2006 UTC (5 years, 4 months ago) by tegge
Branches: MAIN
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +6 -4 lines
Don't try to obtain a reference to a nonexisting (NULL) mount structure in
default VOP_GETWRITEMOUNT().

Revision 1.133: download - view: text, markup, annotated - select for diffs
Fri Mar 31 03:52:24 2006 UTC (5 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +15 -1 lines
 - GETWRITEMOUNT now returns a referenced mountpoint to prevent its
   identity from changing.  This is possible now that mounts are not freed.

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

Revision 1.127.2.2: download - view: text, markup, annotated - select for diffs
Mon Mar 13 03:06:17 2006 UTC (5 years, 11 months ago) by jeff
Branches: RELENG_6
CVS tags: RELENG_6_1_BP, RELENG_6_1_0_RELEASE, RELENG_6_1
Diff to: previous 1.127.2.1: preferred, colored; branchpoint 1.127: preferred, colored
Changes since revision 1.127.2.1: +0 -5 lines
MFC Rev 1.128
VFS SMP fixes, stack api, softupdates fixes.

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

Revision 1.132: download - view: text, markup, annotated - select for diffs
Mon Jan 30 08:21:23 2006 UTC (6 years ago) by jeff
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +1 -0 lines
 - Add a comment warning about an anomalous condition where we VOP_UNLOCK
   and then vrele rather than vput because we would like to VOP_UNLOCK with
   a specific thread.

Revision 1.127.2.1: download - view: text, markup, annotated - select for diffs
Sat Jan 14 01:18:02 2006 UTC (6 years ago) by tegge
Branches: RELENG_6
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +5 -3 lines
MFC: Add marker vnodes to ensure that all vnodes associated with the mount
     point are iterated over when using MNT_VNODE_FOREACH.

Revision 1.131: download - view: text, markup, annotated - select for diffs
Mon Jan 9 20:42:17 2006 UTC (6 years, 1 month ago) by tegge
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +5 -3 lines
Add marker vnodes to ensure that all vnodes associated with the mount point are
iterated over when using MNT_VNODE_FOREACH.

Reviewed by:	truckman

Revision 1.130: download - view: text, markup, annotated - select for diffs
Wed Dec 14 00:49:51 2005 UTC (6 years, 1 month ago) by des
Branches: MAIN
Diff to: previous 1.129: preferred, colored
Changes since revision 1.129: +1 -1 lines
Eradicate caddr_t from the VFS API.

Revision 1.129: download - view: text, markup, annotated - select for diffs
Wed Aug 17 06:59:23 2005 UTC (6 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +6 -0 lines
In vop_stdpathconf(ap) also default for _PC_NAME_MAX and _PC_PATH_MAX.

Revision 1.128: download - view: text, markup, annotated - select for diffs
Wed Aug 3 04:48:21 2005 UTC (6 years, 6 months ago) by jeff
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +0 -5 lines
 - Replace the series of DEBUG_LOCKS hacks which tried to save the vn_lock
   caller by saving the stack of the last locker/unlocker in lockmgr.  We
   also put the stack in KTR at the moment.

Contributed by:		Antoine Brodin <antoine.brodin@laposte.net>

Revision 1.127: download - view: text, markup, annotated - select for diffs
Tue Jun 14 20:32:27 2005 UTC (6 years, 7 months ago) by jeff
Branches: MAIN
CVS tags: RELENG_6_BP, RELENG_6_0_BP, RELENG_6_0_0_RELEASE, RELENG_6_0
Branch point for: RELENG_6
Diff to: previous 1.126: preferred, colored
Changes since revision 1.126: +3 -0 lines
 - Add and enhance asserts related to the wrong bufobj panic.

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

Revision 1.126: download - view: text, markup, annotated - select for diffs
Thu Jun 9 20:20:29 2005 UTC (6 years, 8 months ago) by ssouhlal
Branches: MAIN
Diff to: previous 1.125: preferred, colored
Changes since revision 1.125: +8 -0 lines
Allow EVFILT_VNODE events to work on every filesystem type, not just
UFS by:
- Making the pre and post hooks for the VOP functions work even when
DEBUG_VFS_LOCKS is not defined.
- Moving the KNOTE activations into the corresponding VOP hooks.
- Creating a MNTK_NOKNOTE flag for the mnt_kern_flag field of struct
mount that permits filesystems to disable the new behavior.
- Creating a default VOP_KQFILTER function: vfs_kqfilter()

My benchmarks have not revealed any performance degradation.

Reviewed by:	jeff, bde
Approved by:	rwatson, jmg (kqueue changes), grehan (mentor)

Revision 1.125: download - view: text, markup, annotated - select for diffs
Sun May 1 00:59:34 2005 UTC (6 years, 9 months ago) by jeff
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +2 -10 lines
 - Remove unnecessary spls.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Sun Apr 3 10:24:03 2005 UTC (6 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +4 -3 lines
 - Now that writes to character devices supporting softupdates can
   generate dirty bufs even with a locked vnode, 100 retries is not that
   many.  This should probably change from a retry count to an abort when
   we are no longer cleaning any buffers.
 - Don't call vprint() while we still hold the vnode locked.  Move the call
   to later in the function.
 - Clean up a comment.

Revision 1.123: download - view: text, markup, annotated - select for diffs
Thu Mar 24 07:30:00 2005 UTC (6 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.122: preferred, colored
Changes since revision 1.122: +2 -1 lines
 - Fixup the default vfs_root function to match the new prototype.

Sponsored by:	Isilon Systems, Inc.

Revision 1.122: download - view: text, markup, annotated - select for diffs
Sun Mar 13 11:45:01 2005 UTC (6 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.121: preferred, colored
Changes since revision 1.121: +1 -14 lines
 - Don't drop the lock in the default inactive handler anymore, VOP_NULL
   will do for vop_stdinactive now.

Sponsored by:	Isilon Systems, Inc.

Revision 1.97.2.2: download - view: text, markup, annotated - select for diffs
Wed Feb 23 23:06:29 2005 UTC (6 years, 11 months ago) by alc
Branches: RELENG_5
CVS tags: RELENG_5_5_BP, RELENG_5_5_0_RELEASE, RELENG_5_5, RELENG_5_4_BP, RELENG_5_4_0_RELEASE, RELENG_5_4
Diff to: previous 1.97.2.1: preferred, colored; branchpoint 1.97: preferred, colored; next MAIN 1.98: preferred, colored
Changes since revision 1.97.2.1: +1 -0 lines
MFC
 Move a call to wakeup() from vm_object_terminate() to
 vnode_pager_dealloc() because this call is only needed to wake threads
 that slept when they discovered a dead object connected to a vnode.  To
 eliminate unnecessary calls to wakeup() by vnode_pager_dealloc(),
 introduce a new flag, OBJ_DISCONNECTWNT.

Revision 1.121: download - view: text, markup, annotated - select for diffs
Sun Feb 20 23:02:20 2005 UTC (6 years, 11 months ago) by das
Branches: MAIN
Diff to: previous 1.120: preferred, colored
Changes since revision 1.120: +0 -10 lines
Remove VFS_START().  Its original purpose involved the mfs filesystem,
which is long gone.

Discussed with:	mckusick
Reviewed by:	phk

Revision 1.120: download - view: text, markup, annotated - select for diffs
Mon Feb 7 09:26:39 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +0 -13 lines
Remove vop_stddestroyvobject()

Revision 1.97.2.1: download - view: text, markup, annotated - select for diffs
Mon Jan 31 23:26:18 2005 UTC (7 years ago) by imp
Branches: RELENG_5
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +1 -1 lines
MFC: /*- and related license changes

Revision 1.119: download - view: text, markup, annotated - select for diffs
Fri Jan 28 08:56:48 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.118: preferred, colored
Changes since revision 1.118: +1 -25 lines
Move the contents of vop_stddestroyvobject() to the new vnode_pager
function vnode_destroy_vobject().

Make the new function zero the vp->v_object pointer so we can tell
if a call is missing.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Tue Jan 25 00:42:15 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +0 -24 lines
Take VOP_GETVOBJECT() out to pasture.  We use the direct pointer now.

Revision 1.117: download - view: text, markup, annotated - select for diffs
Tue Jan 25 00:12:24 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.116: preferred, colored
Changes since revision 1.116: +0 -14 lines
Kill VOP_CREATEVOBJECT(), it is now the responsibility of the filesystem
for a given vnode to create a vnode_pager object if one is needed.

Revision 1.116: download - view: text, markup, annotated - select for diffs
Mon Jan 24 21:21:58 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +1 -50 lines
Move the body of vop_stdcreatevobject() over to the vnode_pager under
the name Sande^H^H^H^H^Hvnode_create_vobject().

Make the new function take a size argument which removes the need for
a VOP_STAT() or a very pessimistic guess for disks.

Call that new function from vop_stdcreatevobject().

Make vnode_pager_alloc() private now that its only user came home.

Revision 1.115: download - view: text, markup, annotated - select for diffs
Mon Jan 24 13:13:57 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +1 -2 lines
Kill the VV_OBJBUF and test the v_object for NULL instead.

Revision 1.114: download - view: text, markup, annotated - select for diffs
Mon Jan 24 10:32:14 2005 UTC (7 years ago) by jeff
Branches: MAIN
Diff to: previous 1.113: preferred, colored
Changes since revision 1.113: +0 -4 lines
 - Remove GIANT_REQUIRED where it is no longer required.

Sponsored By:	Isilon Systems, Inc.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Thu Jan 13 12:25:18 2005 UTC (7 years ago) by phk
Branches: MAIN
Diff to: previous 1.112: preferred, colored
Changes since revision 1.112: +1 -1 lines
Ditch vfs_object_create() and make the callers call VOP_CREATEVOBJECT()
directly.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Tue Jan 11 07:36:19 2005 UTC (7 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +3 -5 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.111: download - view: text, markup, annotated - select for diffs
Thu Jan 6 23:35:40 2005 UTC (7 years, 1 month ago) by imp
Branches: MAIN
Diff to: previous 1.110: preferred, colored
Changes since revision 1.110: +1 -1 lines
/* -> /*- for copyright notices, minor format tweaks as necessary

Revision 1.110: download - view: text, markup, annotated - select for diffs
Fri Dec 3 08:56:30 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +3 -1 lines
Add missing vop_bypass (returning EOPNOTSUPP).

Tripped up:	marks

Revision 1.109: download - view: text, markup, annotated - select for diffs
Wed Dec 1 23:16:36 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +25 -42 lines
Back when VOP_* was introduced, we did not have new-style struct
initializations but we did have lofty goals and big ideals.

Adjust to more contemporary circumstances and gain type checking.

	Replace the entire vop_t frobbing thing with properly typed
	structures.  The only casualty is that we can not add a new
	VOP_ method with a loadable module.  History has not given
	us reason to belive this would ever be feasible in the the
	first place.

	Eliminate in toto VOCALL(), vop_t, VNODEOP_SET() etc.

	Give coda correct prototypes and function definitions for
	all vop_()s.

	Generate a bit more data from the vnode_if.src file:  a
	struct vop_vector and protype typedefs for all vop methods.

	Add a new vop_bypass() and make vop_default be a pointer
	to another struct vop_vector.

	Remove a lot of vfs_init since vop_vector is ready to use
	from the compiler.

	Cast various vop_mumble() to void * with uppercase name,
	for instance VOP_PANIC, VOP_NULL etc.

	Implement VCALL() by making vdesc_offset the offsetof() the
	relevant function pointer in vop_vector.  This is disgusting
	but since the code is generated by a script comparatively
	safe.  The alternative for nullfs etc. would be much worse.

	Fix up all vnode method vectors to remove casts so they
	become typesafe.  (The bulk of this is generated by scripts)

Revision 1.108: download - view: text, markup, annotated - select for diffs
Thu Nov 18 07:55:05 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.107: preferred, colored
Changes since revision 1.107: +21 -21 lines
Make more sense out of vop_stdcreatevobject()

Revision 1.107: download - view: text, markup, annotated - select for diffs
Mon Nov 15 09:18:27 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +3 -3 lines
Make VOP_BMAP return a struct bufobj for the underlying storage device
instead of a vnode for it.

The vnode_pager does not and should not have any interest in what
the filesystem uses for backend.

(vfs_cluster doesn't use the backing store argument.)

Revision 1.106: download - view: text, markup, annotated - select for diffs
Sat Nov 13 22:59:52 2004 UTC (7 years, 2 months ago) by phk
Branches: MAIN
Diff to: previous 1.105: preferred, colored
Changes since revision 1.105: +1 -1 lines
The default VOP_REVOKE() should be vop_panic() as we should never
get here in the first place.

Revision 1.105: download - view: text, markup, annotated - select for diffs
Sat Nov 6 11:41:22 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +1 -0 lines
Properly implement a default version of VOP_GETWRITEMOUNT.

Remove improper access to vop_stdgetwritemount() which should and
will instead rely on the VOP default path.

Revision 1.104: download - view: text, markup, annotated - select for diffs
Sat Nov 6 05:33:01 2004 UTC (7 years, 3 months ago) by alc
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +1 -0 lines
Move a call to wakeup() from vm_object_terminate() to vnode_pager_dealloc()
because this call is only needed to wake threads that slept when they
discovered a dead object connected to a vnode.  To eliminate unnecessary
calls to wakeup() by vnode_pager_dealloc(), introduce a new flag,
OBJ_DISCONNECTWNT.

Reviewed by: tegge@

Revision 1.103: download - view: text, markup, annotated - select for diffs
Fri Oct 29 10:59:28 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +0 -1 lines
Remove VOP_SPECSTRATEGY() from the system.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Wed Oct 27 06:47:00 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +0 -3 lines
Eliminate unnecessary KASSERT.

Eliminate a printf which would never tell us anything anyway because the
KASSERT would have triggered.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Mon Oct 25 09:14:02 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +3 -4 lines
Loose the v_dirty* and v_clean* alias macros.

Check the count field where we just want to know the full/empty state,
rather than using TAILQ_EMPTY() or TAILQ_FIRST().

Revision 1.100: download - view: text, markup, annotated - select for diffs
Thu Oct 21 15:53:52 2004 UTC (7 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +7 -9 lines
Move the VI_BWAIT flag into no bo_flag element of bufobj and call it BO_WWAIT

Add bufobj_wref(), bufobj_wdrop() and bufobj_wwait() to handle the write
count on a bufobj.  Bufobj_wdrop() replaces vwakeup().

Use these functions all relevant places except in ffs_softdep.c where
the use if interlocked_sleep() makes this impossible.

Rename b_vnbufs to b_bobufs now that we touch all the relevant files anyway.

Revision 1.99: download - view: text, markup, annotated - select for diffs
Fri Sep 24 06:23:31 2004 UTC (7 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +1 -1 lines
Use vn_isdisk() to check if vnode is a disk.

(repeat, CVS core dumped on me)

Revision 1.98: download - view: text, markup, annotated - select for diffs
Fri Sep 24 06:21:43 2004 UTC (7 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +1 -1 lines
use vn_isdisk() to see if vnode is a disk.

Revision 1.97: download - view: text, markup, annotated - select for diffs
Mon Jul 12 08:14:08 2004 UTC (7 years, 7 months ago) by alfred
Branches: MAIN
CVS tags: RELENG_5_BP, RELENG_5_3_BP, RELENG_5_3_0_RELEASE, RELENG_5_3
Branch point for: RELENG_5
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +2 -1 lines
Make VFS_ROOT() and vflush() take a thread argument.
This is to allow filesystems to decide based on the passed thread
which vnode to return.
Several filesystems used curthread, they now use the passed thread.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Wed Jul 7 07:00:02 2004 UTC (7 years, 7 months ago) by alfred
Branches: MAIN
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +12 -1 lines
style(9)

Revision 1.95: download - view: text, markup, annotated - select for diffs
Wed Jul 7 06:58:29 2004 UTC (7 years, 7 months ago) by alfred
Branches: MAIN
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +10 -0 lines
do the vfsstd thing instead of messing up our VFS_SYSCTL macro.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Sun Jul 4 08:52:34 2004 UTC (7 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +1 -9 lines
When we traverse the vnodes on a mountpoint we need to look out for
our cached 'next vnode' being removed from this mountpoint.  If we
find that it was recycled, we restart our traversal from the start
of the list.

Code to do that is in all local disk filesystems (and a few other
places) and looks roughly like this:

		MNT_ILOCK(mp);
	loop:
		for (vp = TAILQ_FIRST(&mp...);
		    (vp = nvp) != NULL;
		    nvp = TAILQ_NEXT(vp,...)) {
			if (vp->v_mount != mp)
				goto loop;
			MNT_IUNLOCK(mp);
			...
			MNT_ILOCK(mp);
		}
		MNT_IUNLOCK(mp);

The code which takes vnodes off a mountpoint looks like this:

	MNT_ILOCK(vp->v_mount);
	...
	TAILQ_REMOVE(&vp->v_mount->mnt_nvnodelist, vp, v_nmntvnodes);
	...
	MNT_IUNLOCK(vp->v_mount);
	...
	vp->v_mount = something;

(Take a moment and try to spot the locking error before you read on.)

On a SMP system, one CPU could have removed nvp from our mountlist
but not yet gotten to assign a new value to vp->v_mount while another
CPU simultaneously get to the top of the traversal loop where it
finds that (vp->v_mount != mp) is not true despite the fact that
the vnode has indeed been removed from our mountpoint.

Fix:

Introduce the macro MNT_VNODE_FOREACH() to traverse the list of
vnodes on a mountpoint while taking into account that vnodes may
be removed from the list as we go.  This saves approx 65 lines of
duplicated code.

Split the insmntque() which potentially moves a vnode from one mount
point to another into delmntque() and insmntque() which does just
what the names say.

Fix delmntque() to set vp->v_mount to NULL while holding the
mountpoint lock.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Mon Apr 5 21:03:36 2004 UTC (7 years, 10 months ago) by imp
Branches: MAIN
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +0 -4 lines
Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core

Revision 1.92: download - view: text, markup, annotated - select for diffs
Mon Mar 29 22:41:20 2004 UTC (7 years, 10 months ago) by peter
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +0 -160 lines
Clean up the stub fake vnode locking implemenations.  The main reason this
stuff was here (NFS) was fixed by Alfred in November.  The only remaining
consumer of the stub functions was umapfs, which is horribly horribly
broken.  It has missed out on about the last 5 years worth of maintenence
that was done on nullfs (from which umapfs is derived).  It needs major
work to bring it up to date with the vnode locking protocol.  umapfs really
needs to find a caretaker to bring it into the 21st century.

Functions GC'ed:
vop_noislocked, vop_nolock, vop_nounlock, vop_sharedlock.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Wed Nov 5 04:30:07 2003 UTC (8 years, 3 months ago) by kan
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.90: preferred, colored
Changes since revision 1.90: +5 -5 lines
Remove mntvnode_mtx and replace it with per-mountpoint mutex.
Introduce two new macros MNT_ILOCK(mp)/MNT_IUNLOCK(mp) to
operate on this mutex transparently.

Eventually new mutex will be protecting more fields in
struct mount, not only vnode list.

Discussed with: jeff

Revision 1.90: download - view: text, markup, annotated - select for diffs
Sun Nov 2 04:52:53 2003 UTC (8 years, 3 months ago) by kan
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +2 -1 lines
Take care not to call vput if thread used in corresponding vget
wasn't curthread, i.e. when we receive a thread pointer to use
as a function argument. Use VOP_UNLOCK/vrele in these cases.

The only case there td != curthread known at the moment is
boot() calling sync with thread0 pointer.

This fixes the panic on shutdown people have reported.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Sat Nov 1 05:51:54 2003 UTC (8 years, 3 months ago) by kan
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +1 -5 lines
Temporarily undo parts of the stuct mount locking commit by jeff.
It is unsafe to hold a mutex across vput/vrele calls.

This will be redone when a better locking strategy is agreed upon.

Discussed with: jeff

Revision 1.88: download - view: text, markup, annotated - select for diffs
Thu Oct 30 16:22:51 2003 UTC (8 years, 3 months ago) by kan
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +1 -0 lines
Relock mntvnode_mtx if vget fails in vfs_stdsync. The loop is
always shoould entered with mutex locked.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Sat Sep 27 12:53:33 2003 UTC (8 years, 4 months ago) by phk
Branches: MAIN
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +1 -0 lines
Introduce no_poll() default method for device drivers.  Have it
do exactly the same as vop_nopoll() for consistency and put a
comment in the two pointing at each other.

Retire seltrue() in favour of no_poll().

Create private default functions in kern_conf.c instead of public
ones.

Change default strategy to return the bio with ENODEV instead of
doing nothing which would lead the bio stranded.

Retire public nullopen() and nullclose() as well as the entire band
of public no{read,write,ioctl,mmap,kqfilter,strategy,poll,dump}
funtions, they are the default actions now.

Move the final two trivial functions from subr_xxx.c to kern_conf.c
and retire the now empty subr_xxx.c

Revision 1.86: download - view: text, markup, annotated - select for diffs
Sun Jun 15 19:49:14 2003 UTC (8 years, 7 months ago) by phk
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +3 -25 lines
I have not had any reports of trouble for a long time, so remove the
gentle versions of the vop_strategy()/vop_specstrategy() mismatch methods
and use vop_panic() instead.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Wed Jun 11 00:56:58 2003 UTC (8 years, 8 months ago) by obrien
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +3 -3 lines
Use __FBSDID().

Revision 1.84: download - view: text, markup, annotated - select for diffs
Tue May 6 02:45:28 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
CVS tags: RELENG_5_1_BP, RELENG_5_1_0_RELEASE, RELENG_5_1
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +1 -1 lines
Lock the vm_object when performing vm_pager_deallocate().

Revision 1.83: download - view: text, markup, annotated - select for diffs
Fri May 2 19:33:21 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +4 -1 lines
Lock access to the vm_object's flags in vop_stdcreatevobject().

Revision 1.82: download - view: text, markup, annotated - select for diffs
Thu May 1 03:51:05 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +2 -0 lines
Lock an update to a vm_object's ref_count.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Tue Apr 29 13:36:03 2003 UTC (8 years, 9 months ago) by kan
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +1 -2 lines
Deprecate machine/limits.h in favor of new sys/limits.h.
Change all in-tree consumers to include <sys/limits.h>

Discussed on:	standards@
Partially submitted by: Craig Rodrigues <rodrigc@attbi.com>

Revision 1.80: download - view: text, markup, annotated - select for diffs
Sat Apr 26 19:36:19 2003 UTC (8 years, 9 months ago) by alc
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +5 -2 lines
 - Lock the vm_object on entry to vm_object_terminate().

Revision 1.79: download - view: text, markup, annotated - select for diffs
Thu Mar 13 07:19:22 2003 UTC (8 years, 11 months ago) by jeff
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +0 -1 lines
 - Remove a race between fsync like functions and flushbufqueues() by
   requiring locked bufs in vfs_bio_awrite().  Previously the buf could
   have been written out by fsync before we acquired the buf lock if it
   weren't for giant.  The cluster_wbuild() handles this race properly but
   the single write at the end of vfs_bio_awrite() would not.
 - Modify flushbufqueues() so there is only one copy of the loop.  Pass a
   parameter in that says whether or not we should sync bufs with deps.
 - Call flushbufqueues() a second time and then break if we couldn't find
   any bufs without deps.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Tue Mar 11 22:15:10 2003 UTC (8 years, 11 months ago) by kan
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +56 -1 lines
Rename vfs_stdsync function to vfs_stdnosync which matches more
closely what function is really doing. Update all existing consumers
to use the new name.

Introduce a new vfs_stdsync function, which iterates over mount
point's vnodes and call FSYNC on each one of them in turn.

Make nwfs and smbfs use this new function instead of rolling their
own identical sync implementations.

Reviewed by:	jeff

Revision 1.77: download - view: text, markup, annotated - select for diffs
Mon Mar 10 21:55:00 2003 UTC (8 years, 11 months ago) by kan
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +15 -16 lines
Remove trainling whitespace.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Fri Mar 7 20:45:07 2003 UTC (8 years, 11 months ago) by jhb
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +2 -4 lines
Respect any passed in external lockmgr flags such as LK_NOWAIT in the
default implementations of VOP_LOCK() and VOP_UNLOCK().

Tested by:	jlemon, phk
Glanced at by:	jeffr

Revision 1.75: download - view: text, markup, annotated - select for diffs
Mon Mar 3 23:37:50 2003 UTC (8 years, 11 months ago) by jeff
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +1 -1 lines
 - Correct the wchan in vop_stdfsync()

This is almost what bde asked for.  There is some desire to have per fs wchans
still but that is difficult giving the current arrangement of the code.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Mon Mar 3 19:50:36 2003 UTC (8 years, 11 months ago) by njl
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +3 -3 lines
Pick up one file missed in the previous vprint() cleanup

Revision 1.73: 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.72: preferred, colored
Changes since revision 1.72: +1 -1 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.72: download - view: text, markup, annotated - select for diffs
Sun Feb 9 12:29:38 2003 UTC (9 years ago) by jeff
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +1 -1 lines
 - Claim we're 'fsync' and not 'spec_fsync' in vop_stdfsync.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Sun Feb 9 11:28:34 2003 UTC (9 years ago) by jeff
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +89 -0 lines
 - Cleanup unlocked accesses to buf flags by introducing a new b_vflag member
   that is protected by the vnode lock.
 - Move B_SCANNED into b_vflags and call it BV_SCANNED.
 - Create a vop_stdfsync() modeled after spec's sync.
 - Replace spec_fsync, msdos_fsync, and hpfs_fsync with the stdfsync and some
   fs specific processing.  This gives all of these filesystems proper
   behavior wrt MNT_WAIT/NOWAIT and the use of the B_SCANNED flag.
 - Annotate the locking in buf.h

Revision 1.28.2.7: download - view: text, markup, annotated - select for diffs
Fri Jan 10 18:23:26 2003 UTC (9 years, 1 month ago) by bde
Branches: RELENG_4
CVS tags: RELENG_4_9_BP, RELENG_4_9_0_RELEASE, RELENG_4_9, RELENG_4_8_BP, RELENG_4_8_0_RELEASE, RELENG_4_8, RELENG_4_11_BP, RELENG_4_11_0_RELEASE, RELENG_4_11, RELENG_4_10_BP, RELENG_4_10_0_RELEASE, RELENG_4_10
Diff to: previous 1.28.2.6: preferred, colored; branchpoint 1.28: preferred, colored; next MAIN 1.29: preferred, colored
Changes since revision 1.28.2.6: +17 -4 lines
MFC (1.41: unbreak the default vnop for lookup and fix some nearby style
bugs).

Revision 1.70: download - view: text, markup, annotated - select for diffs
Sat Jan 4 22:10:36 2003 UTC (9 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +25 -0 lines
Temporarily introduce a new VOP_SPECSTRATEGY operation while I try
to sort out disk-io from file-io in the vm/buffer/filesystem space.

The intent is to sort VOP_STRATEGY calls into those which operate
on "real" vnodes and those which operate on VCHR vnodes.  For
the latter kind, the call will be changed to VOP_SPECSTRATEGY,
possibly conditionally for those places where dual-use happens.

Add a default VOP_SPECSTRATEGY method which will call the normal
VOP_STRATEGY.  First time it is called it will print debugging
information.  This will only happen if a normal vnode is passed
to VOP_SPECSTRATEGY by mistake.

Add a real VOP_SPECSTRATEGY in specfs, which does what VOP_STRATEGY
does on a VCHR vnode today.

Add a new VOP_STRATEGY method in specfs to catch instances where
the conversion to VOP_SPECSTRATEGY has not yet happened.  Handle
the request just like we always did, but first time called print
debugging information.

Apart up to two instances of console messages per boot, this amounts
to a glorified no-op commit.

If you get any of the messages on your console I would very much
like a copy of them mailed to phk@freebsd.org

Revision 1.69: download - view: text, markup, annotated - select for diffs
Sat Jan 4 20:31:27 2003 UTC (9 years, 1 month ago) by phk
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +1 -1 lines
resort the vnode ops list.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Thu Oct 24 17:55:49 2002 UTC (9 years, 3 months ago) by phk
Branches: MAIN
CVS tags: RELENG_5_0_BP, RELENG_5_0_0_RELEASE, RELENG_5_0
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +1 -5 lines
Don't try to be cute and save a call/return by implementing a degenerate
vrele() inline.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Mon Oct 14 03:20:35 2002 UTC (9 years, 3 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +7 -7 lines
Regularize the vop_stdlock'ing protocol across all the filesystems
that use it. Specifically, vop_stdlock uses the lock pointed to by
vp->v_vnlock. By default, getnewvnode sets up vp->v_vnlock to
reference vp->v_lock. Filesystems that wish to use the default
do not need to allocate a lock at the front of their node structure
(as some still did) or do a lockinit. They can simply start using
vn_lock/VOP_UNLOCK. Filesystems that wish to manage their own locks,
but still use the vop_stdlock functions (such as nullfs) can simply
replace vp->v_vnlock with a pointer to the lock that they wish to
have used for the vnode. Such filesystems are responsible for
setting the vp->v_vnlock back to the default in their vop_reclaim
routine (e.g., vp->v_vnlock = &vp->v_lock).

In theory, this set of changes cleans up the existing filesystem
lock interface and should have no function change to the existing
locking scheme.

Sponsored by:	DARPA & NAI Labs.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Wed Sep 25 01:42:24 2002 UTC (9 years, 4 months ago) by jeff
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +12 -8 lines
 - Use the standard vp interlock macros.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Tue Aug 13 11:11:51 2002 UTC (9 years, 5 months ago) by phk
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +2 -0 lines
Remember to unlock the (optional) vnode in vfs_stdextattrctl().  Failing
to do this made the following script hang:

	#!/bin/sh
	set -ex

	extattrctl start /tmp
	extattrctl initattr 64 /tmp/EA00
	extattrctl enable /tmp user ea00 /tmp/EA00
	extattrctl showattr /tmp/EA00

if the filesystem backing /tmp did not support EAs.

The real solution is probably to have the extattrctl syscall do the
unlocking rather than depend on the filesystem to do it.  Considering
that extattrctl is going to be made obsolete anyway, this has dogwash
priority.

Sponsored by:	DARPA & NAI Labs.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Sun Aug 4 10:29:32 2002 UTC (9 years, 6 months ago) by jeff
Branches: MAIN
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +1 -1 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.63: download - view: text, markup, annotated - select for diffs
Sat Jul 27 05:16:20 2002 UTC (9 years, 6 months ago) by jeff
Branches: MAIN
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +3 -3 lines
 - The default for lock, unlock, and islocked is now std* instead of no*.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Tue Jul 9 22:50:29 2002 UTC (9 years, 7 months ago) by mux
Branches: MAIN
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +0 -20 lines
Remove vfs_stdmount() and vfs_stdunmount().  They are not
really useful and are incompatible with nmount.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sat Apr 27 22:20:33 2002 UTC (9 years, 9 months ago) by iedowse
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +0 -3 lines
Remove a stale comment saying that the vnode lock must be the first
element in the structure pointed to by vp->v_data; the vnode lock
is now within the vnode structure itself.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Wed Mar 20 04:09:58 2002 UTC (9 years, 10 months ago) by jeff
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +0 -1 lines
Remove references to vm_zone.h and switch over to the new uma API.

Also, remove maxsockets.  If you look carefully you'll notice that the old
zone allocator never honored this anyway.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Tue Mar 19 21:24:07 2002 UTC (9 years, 10 months ago) by alfred
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +2 -2 lines
Remove __P.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sun Mar 17 01:25:44 2002 UTC (9 years, 10 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +2 -1 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.57: download - view: text, markup, annotated - select for diffs
Tue Mar 5 15:38:49 2002 UTC (9 years, 11 months ago) by eivind
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +44 -5 lines
Document all functions, global and static variables, and sysctls.
Includes some minor whitespace changes, and re-ordering to be able to document
properly (e.g, grouping of variables and the SYSCTL macro calls for them, where
the documentation has been added.)

Reviewed by:	phk (but all errors are mine)

Revision 1.28.2.6: download - view: text, markup, annotated - select for diffs
Thu Oct 25 18:55:58 2001 UTC (10 years, 3 months ago) by dillon
Branches: RELENG_4
CVS tags: RELENG_4_7_BP, RELENG_4_7_0_RELEASE, RELENG_4_7, RELENG_4_6_BP, RELENG_4_6_2_RELEASE, RELENG_4_6_1_RELEASE, RELENG_4_6_0_RELEASE, RELENG_4_6, RELENG_4_5_BP, RELENG_4_5_0_RELEASE, RELENG_4_5
Diff to: previous 1.28.2.5: preferred, colored; branchpoint 1.28: preferred, colored
Changes since revision 1.28.2.5: +12 -1 lines
MFC 1.56.  Fix incorrect double-termination of vm_object and document
vop_stdgetvobject() to allow calls without holding the vnode interlock
(which will be used by the sync code speedups coming down the pipe)

Revision 1.56: download - view: text, markup, annotated - select for diffs
Tue Oct 23 01:23:41 2001 UTC (10 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +13 -2 lines
Fix incorrect double-termination of vm_object.  When a vm_object is
terminated and flushes pending dirty pages it is possible for the
object to be ref'd (0->1) and then deref'd (1->0) during termination.
We do not terminate the object a second time.

Document vop_stdgetvobject() to explicitly allow it to be called without
the vnode interlock held (for upcoming sync_msync() and ffs_sync()
performance optimizations)

MFC after:	3 days

Revision 1.28.2.5: download - view: text, markup, annotated - select for diffs
Sun Oct 14 20:10:05 2001 UTC (10 years, 3 months ago) by luigi
Branches: RELENG_4
Diff to: previous 1.28.2.4: preferred, colored; branchpoint 1.28: preferred, colored
Changes since revision 1.28.2.4: +2 -4 lines
Remove a warning for an unused variable (technically the variable
was used, but in a way that the compiler could optimize out presumably
before checking for usage.)

Revision 1.55: download - view: text, markup, annotated - select for diffs
Wed Sep 12 08:37:46 2001 UTC (10 years, 5 months ago) by julian
Branches: MAIN
CVS tags: KSE_MILESTONE_2
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +39 -39 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.28.2.4: download - view: text, markup, annotated - select for diffs
Wed Jul 4 17:32:40 2001 UTC (10 years, 7 months ago) by tegge
Branches: RELENG_4
CVS tags: RELENG_4_4_BP, RELENG_4_4_0_RELEASE, RELENG_4_4
Diff to: previous 1.28.2.3: preferred, colored; branchpoint 1.28: preferred, colored
Changes since revision 1.28.2.3: +2 -7 lines
Lobotimize vop_noislocked() to just return 0, making it consistent with
the implementation of vop_nolock() and vop_nounlock().
Before this commit, vop_noislocked() and vop_stdislocked() did the same
thing.

This should resolve some hangs on SMP systems where vop_noislocked()
interacted with filesystems that did not have a struct lock at the
start of their per-vnode private date (mfs, procfs, devfs, linprocfs).

Reviewed by:	dillon
Approved by:	dillon

Revision 1.54: download - view: text, markup, annotated - select for diffs
Wed Jul 4 16:20:13 2001 UTC (10 years, 7 months ago) by dillon
Branches: MAIN
CVS tags: KSE_PRE_MILESTONE_2
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +6 -13 lines
With Alfred's permission, remove vm_mtx in favor of a fine-grained approach
(this commit is just the first stage).  Also add various GIANT_ macros to
formalize the removal of Giant, making it easy to test in a more piecemeal
fashion. These macros will allow us to test fine-grained locks to a degree
before removing Giant, and also after, and to remove Giant in a piecemeal
fashion via sysctl's on those subsystems which the authors believe can
operate without Giant.

Revision 1.28.2.3: download - view: text, markup, annotated - select for diffs
Tue Jun 26 04:20:08 2001 UTC (10 years, 7 months ago) by bp
Branches: RELENG_4
Diff to: previous 1.28.2.2: preferred, colored; branchpoint 1.28: preferred, colored
Changes since revision 1.28.2.2: +14 -25 lines
MFC: the rest of fixes for nullfs. Please note, that for now only
ufs mounts can be used for null mounts. msdosfs and cd9660fs fixes
are trivial and will be committed shortly. Null mounts on top of nfs
filesystem will cause problems after rename() operation. This issue
also present in -current and can be fixed too.

Revision 1.28.2.2: download - view: text, markup, annotated - select for diffs
Thu Jun 7 23:19:28 2001 UTC (10 years, 8 months ago) by jlemon
Branches: RELENG_4
Diff to: previous 1.28.2.1: preferred, colored; branchpoint 1.28: preferred, colored
Changes since revision 1.28.2.1: +4 -4 lines
MFC: r1.51; allow POLLIN/POLLOUT work the same as POLLRDNORM/POLLWRNORM.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Wed May 23 19:51:12 2001 UTC (10 years, 8 months ago) by jhb
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +1 -4 lines
Don't release the vm lock just to turn around and grab it again.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Sat May 19 01:28:04 2001 UTC (10 years, 8 months ago) by alfred
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +16 -2 lines
Introduce a global lock for the vm subsystem (vm_mtx).

vm_mtx does not recurse and is required for most low level
vm operations.

faults can not be taken without holding Giant.

Memory subsystems can now call the base page allocators safely.

Almost all atomic ops were removed as they are covered under the
vm mutex.

Alpha and ia64 now need to catch up to i386's trap handlers.

FFS and NFS have been tested, other filesystems will need minor
changes (grabbing the vm lock when twiddling page properties).

Reviewed (partially) by: jake, jhb

Revision 1.28.2.1: download - view: text, markup, annotated - select for diffs
Fri May 18 09:58:43 2001 UTC (10 years, 8 months ago) by bp
Branches: RELENG_4
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +113 -1 lines
MFC: introduce VOP_CREATEVOBJECT(), VOP_GETVOBJECT and VOP_DESTROYVOBJECT()
which help to get proper reference to VM backing object.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Mon May 14 14:37:25 2001 UTC (10 years, 8 months ago) by jlemon
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +4 -4 lines
When calling poll() on a fd associated with a filesystem, let POLLIN/POLLOUT
behave identically to POLLRDNORM/POLLWRNORM.

Submitted by: bde
PR: 27287
merge after: 1 week

Revision 1.50: download - view: text, markup, annotated - select for diffs
Sun May 6 17:40:22 2001 UTC (10 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +3 -2 lines
Fix return type of vop_stdputpages()

Noticed by:	rwatson

Revision 1.49: download - view: text, markup, annotated - select for diffs
Tue May 1 08:34:32 2001 UTC (10 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +34 -1 lines
Implement vop_std{get|put}pages() and add them to the default vop[].

Un-copy&paste all the VOP_{GET|PUT}PAGES() functions which do nothing but
the default.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Sun Apr 29 11:48:35 2001 UTC (10 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +26 -1 lines
Add a vop_stdbmap(), and make it part of the default vop vector.

Make 7 filesystems which don't really know about VOP_BMAP rely
on the default vector, rather than more or less complete local
vop_nopbmap() implementations.

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

Requested by:	bde

Revision 1.46: download - view: text, markup, annotated - select for diffs
Wed Apr 25 07:07:47 2001 UTC (10 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +1 -11 lines
Move the netexport structure from the fs-specific mountstructure
to struct mount.

This makes the "struct netexport *" paramter to the vfs_export
and vfs_checkexport interface unneeded.

Consequently that all non-stacking filesystems can use
vfs_stdcheckexp().

At the same time, make it a pointer to a struct netexport
in struct mount, so that we can remove the bogus AF_MAX
and #include <net/radix.h> from <sys/mount.h>

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

Revision 1.44: download - view: text, markup, annotated - select for diffs
Tue Apr 17 08:56:35 2001 UTC (10 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +1 -9 lines
This patch removes the VOP_BWRITE() vector.

VOP_BWRITE() was a hack which made it possible for NFS client
side to use struct buf with non-bio backing.

This patch takes a more general approach and adds a bp->b_op
vector where more methods can be added.

The success of this patch depends on bp->b_op being initialized
all relevant places for some value of "relevant" which is not
easy to determine.  For now the buffers have grown a b_magic
element which will make such issues a tiny bit easier to debug.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Mon Mar 19 05:44:14 2001 UTC (10 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +3 -3 lines
o Rename "namespace" argument to "attrnamespace" as namespace is a C++
  reserved word.

Submitted by:	jkh
Obtained from:	TrustedBSD Project

Revision 1.42: download - view: text, markup, annotated - select for diffs
Thu Mar 15 02:54:24 2001 UTC (10 years, 10 months ago) by rwatson
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +4 -3 lines
o Change the API and ABI of the Extended Attribute kernel interfaces to
  introduce a new argument, "namespace", rather than relying on a first-
  character namespace indicator.  This is in line with more recent
  thinking on EA interfaces on various mailing lists, including the
  posix1e, Linux acl-devel, and trustedbsd-discuss forums.  Two namespaces
  are defined by default, EXTATTR_NAMESPACE_SYSTEM and
  EXTATTR_NAMESPACE_USER, where the primary distinction lies in the
  access control model: user EAs are accessible based on the normal
  MAC and DAC file/directory protections, and system attributes are
  limited to kernel-originated or appropriately privileged userland
  requests.

o These API changes occur at several levels: the namespace argument is
  introduced in the extattr_{get,set}_file() system call interfaces,
  at the vnode operation level in the vop_{get,set}extattr() interfaces,
  and in the UFS extended attribute implementation.  Changes are also
  introduced in the VFS extattrctl() interface (system call, VFS,
  and UFS implementation), where the arguments are modified to include
  a namespace field, as well as modified to advoid direct access to
  userspace variables from below the VFS layer (in the style of recent
  changes to mount by adrian@FreeBSD.org).  This required some cleanup
  and bug fixing regarding VFS locks and the VFS interface, as a vnode
  pointer may now be optionally submitted to the VFS_EXTATTRCTL()
  call.  Updated documentation for the VFS interface will be committed
  shortly.

o In the near future, the auto-starting feature will be updated to
  search two sub-directories to the ".attribute" directory in appropriate
  file systems: "user" and "system" to locate attributes intended for
  those namespaces, as the single filename is no longer sufficient
  to indicate what namespace the attribute is intended for.  Until this
  is committed, all attributes auto-started by UFS will be placed in
  the EXTATTR_NAMESPACE_SYSTEM namespace.

o The default POSIX.1e attribute names for ACLs and Capabilities have
  been updated to no longer include the '$' in their filename.  As such,
  if you're using these features, you'll need to rename the attribute
  backing files to the same names without '$' symbols in front.

o Note that these changes will require changes in userland, which will
  be committed shortly.  These include modifications to the extended
  attribute utilities, as well as to libutil for new namespace
  string conversion routines.  Once the matching userland changes are
  committed, a buildworld is recommended to update all the necessary
  include files and verify that the kernel and userland environments
  are in sync.  Note: If you do not use extended attributes (most people
  won't), upgrading is not imperative although since the system call
  API has changed, the new userland extended attribute code will no longer
  compile with old include files.

o Couple of minor cleanups while I'm there: make more code compilation
  conditional on FFS_EXTATTR, which should recover a bit of space on
  kernels running without EA's, as well as update copyright dates.

Obtained from:	TrustedBSD Project

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun Feb 18 02:22:58 2001 UTC (10 years, 11 months ago) by bde
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +18 -5 lines
Added a dummy lookup vop.  Specfs was broken by removing its dummy
lookup vop so that it defaulted to using vop_eopnotsupp for strange
lookups like the ones for open("/dev/null/", ...) and stat("/dev/null/",
...).  This mainly caused the wrong errno to be returned by vfs syscalls
(EOPNOTSUPP is not in POSIX, and is not documented in connection with
specfs in open.2 and is not documented in stat.2 at all).  Also, lookup
vops are apparently required to set *ap->a_vpp to NULL on error, but
vop_eopnotsupp is too broken to do this.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Fri Feb 9 06:09:52 2001 UTC (11 years ago) by bmilekic
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +3 -3 lines
Change and clean the mutex lock interface.

mtx_enter(lock, type) becomes:

mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks)
mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized)

similarily, for releasing a lock, we now have:

mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN.
We change the caller interface for the two different types of locks
because the semantics are entirely different for each case, and this
makes it explicitly clear and, at the same time, it rids us of the
extra `type' argument.

The enter->lock and exit->unlock change has been made with the idea
that we're "locking data" and not "entering locked code" in mind.

Further, remove all additional "flags" previously passed to the
lock acquire/release routines with the exception of two:

MTX_QUIET and MTX_NOSWITCH

The functionality of these flags is preserved and they can be passed
to the lock/unlock routines by calling the corresponding wrappers:

mtx_{lock, unlock}_flags(lock, flag(s)) and
mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN
locks, respectively.

Re-inline some lock acq/rel code; in the sleep lock case, we only
inline the _obtain_lock()s in order to ensure that the inlined code
fits into a cache line. In the spin lock case, we inline recursion and
actually only perform a function call if we need to spin. This change
has been made with the idea that we generally tend to avoid spin locks
and that also the spin locks that we do have and are heavily used
(i.e. sched_lock) do recurse, and therefore in an effort to reduce
function call overhead for some architectures (such as alpha), we
inline recursion for this case.

Create a new malloc type for the witness code and retire from using
the M_DEV type. The new type is called M_WITNESS and is only declared
if WITNESS is enabled.

Begin cleaning up some machdep/mutex.h code - specifically updated the
"optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN
and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently
need those.

Finally, caught up to the interface changes in all sys code.

Contributors: jake, jhb, jasone (in no particular order)

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Nov 1 17:57:22 2000 UTC (11 years, 3 months ago) by eivind
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +1 -2 lines
Give vop_mmap an untimely death.  The opportunity to give it a timely
death timed out in 1996.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Fri Oct 20 07:58:05 2000 UTC (11 years, 3 months ago) by jhb
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +2 -2 lines
Catch up to moving headers:
- machine/ipl.h -> sys/ipl.h
- machine/mutex.h -> sys/mutex.h

Revision 1.37: download - view: text, markup, annotated - select for diffs
Wed Oct 4 01:29:09 2000 UTC (11 years, 4 months ago) by jasone
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +4 -3 lines
Convert lockmgr locks from using simple locks to using mutexes.

Add lockdestroy() and appropriate invocations, which corresponds to
lockinit() and must be called to clean up after a lockmgr lock is no
longer needed.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Mon Sep 25 15:24:02 2000 UTC (11 years, 4 months ago) by bp
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +19 -53 lines
Add a lock structure to vnode structure. Previously it was either allocated
separately (nfs, cd9660 etc) or keept as a first element of structure
referenced by v_data pointer(ffs). Such organization leads to known problems
with stacked filesystems.

From this point vop_no*lock*() functions maintain only interlock lock.
vop_std*lock*() functions maintain built-in v_lock structure using lockmgr().
vop_sharedlock() is compatible with vop_stdunlock(), but maintains a shared
lock on vnode.

If filesystem wishes to export lockmgr compatible lock, it can put an address
of this lock to v_vnlock field. This indicates that the upper filesystem
can take advantage of it and use single lock structure for entire (or part)
of stack of vnodes. This field shouldn't be examined or modified by VFS code
except for initialization purposes.

Reviewed in general by:	mckusick

Revision 1.35: download - view: text, markup, annotated - select for diffs
Tue Sep 12 09:49:06 2000 UTC (11 years, 5 months ago) by bp
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +117 -1 lines
Add three new VOPs: VOP_CREATEVOBJECT, VOP_DESTROYVOBJECT and VOP_GETVOBJECT.
They will be used by nullfs and other stacked filesystems to support full
cache coherency.

Reviewed in general by:	mckusick, dillon

Revision 1.34: download - view: text, markup, annotated - select for diffs
Fri Aug 18 10:00:39 2000 UTC (11 years, 5 months ago) by phk
Branches: MAIN
CVS tags: PRE_SMPNG
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +14 -7 lines
Introduce vop_stdinactive() and make it the default if no vop_inactive
is declared.

Sort and prune a few vop_op[].

Revision 1.33: download - view: text, markup, annotated - select for diffs
Tue Jul 11 22:07:44 2000 UTC (11 years, 7 months ago) by mckusick
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +16 -1 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.32: download - view: text, markup, annotated - select for diffs
Fri May 5 09:58:26 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +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.31: download - view: text, markup, annotated - select for diffs
Sat Apr 15 05:53:48 2000 UTC (11 years, 9 months ago) by phk
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -2 lines
Complete the bio/buf divorce for all code below devfs::strategy

Exceptions:
        Vinum untouched.  This means that it cannot be compiled.
        Greg Lehey is on the case.

        CCD not converted yet, casts to struct buf (still safe)

        atapi-cd casts to struct buf to examine B_PHYS

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sun Apr 2 15:24:21 2000 UTC (11 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +4 -4 lines
Move B_ERROR flag to b_ioflags and call it BIO_ERROR.

(Much of this done by script)

Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.

Move b_pblkno and b_iodone_chain to struct bio while we transition, they
will be obsoleted once bio structs chain/stack.

Add bio_queue field for struct bio aware disksort.

Address a lot of stylistic issues brought up by bde.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Mon Mar 20 10:44:30 2000 UTC (11 years, 10 months ago) by phk
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +5 -5 lines
Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new
field in struct buf: b_iocmd.  The b_iocmd is enforced to have
exactly one bit set.

B_WRITE was bogusly defined as zero giving rise to obvious coding
mistakes.

Also eliminate the redundant struct buf flag B_CALL, it can just
as efficiently be done by comparing b_iodone to NULL.

Should you get a panic or drop into the debugger, complaining about
"b_iocmd", don't continue.  It is likely to write on your disk
where it should have been reading.

This change is a step in the direction towards a stackable BIO capability.

A lot of this patch were machine generated (Thanks to style(9) compliance!)

Vinum users:  Greg has not had time to test this yet, be careful.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Wed Jan 19 06:07:28 2000 UTC (12 years ago) by rwatson
Branches: MAIN
CVS tags: RELENG_4_BP, RELENG_4_3_BP, RELENG_4_3_0_RELEASE, RELENG_4_3, RELENG_4_2_0_RELEASE, RELENG_4_1_1_RELEASE, RELENG_4_1_0_RELEASE, RELENG_4_0_0_RELEASE
Branch point for: RELENG_4
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +2 -2 lines
Fix bde'isms in acl/extattr syscall interface, renaming syscalls to
prettier (?) names, adding some const's around here, et al.

Reviewed by:	bde

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sun Dec 19 06:07:44 1999 UTC (12 years, 1 month ago) by rwatson
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +17 -1 lines
Second pass commit to introduce new ACL and Extended Attribute system
calls, vnops, vfsops, both in /kern, and to individual file systems that
require a vfsop_ array entry.

Reviewed by:	eivind

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

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sat Dec 11 16:12:52 1999 UTC (12 years, 2 months ago) by eivind
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +5 -3 lines
Lock reporting and assertion changes.
* lockstatus() and VOP_ISLOCKED() gets a new process argument and a new
  return value: LK_EXCLOTHER, when the lock is held exclusively by another
  process.
* The ASSERT_VOP_(UN)LOCKED family is extended to use what this gives them
* Extend the vnode_if.src format to allow more exact specification than
  locked/unlocked.

This commit should not do any semantic changes unless you are using
DEBUG_VFS_LOCKS.

Discussed with:	grog, mch, peter, phk
Reviewed by:	peter

Revision 1.24: download - view: text, markup, annotated - select for diffs
Sun Nov 7 15:09:49 1999 UTC (12 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +4 -2 lines
Make vop_panic() a little more informative.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Sat Sep 11 00:45:58 1999 UTC (12 years, 5 months ago) by alfred
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +11 -4 lines
Seperate the export check in VFS_FHTOVP, exports are now checked via
VFS_CHECKEXP.

Add fh(open|stat|stafs) syscalls to allow userland to query filesystems
based on (network) filehandle.

Obtained from:	NetBSD

Revision 1.22: download - view: text, markup, annotated - select for diffs
Tue Sep 7 22:42:35 1999 UTC (12 years, 5 months ago) by alfred
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +117 -1 lines
All unimplemented VFS ops now have entries in kern/vfs_default.c that return
reasonable defaults.

This avoids confusing and ugly casting to eopnotsupp or making dummy functions.
Bogus casting of filesystem sysctls to eopnotsupp() have been removed.

This should make *_vfsops.c more readable and reduce bloat.

Reviewed by:	msmith, eivind
Approved by:	phk
Tested by:	Jeroen Ruigrok/Asmodai <asmodai@wxs.nl>

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

Revision 1.20: download - view: text, markup, annotated - select for diffs
Thu Jun 17 23:42:45 1999 UTC (12 years, 7 months ago) by gpalmer
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +2 -0 lines
Add Id strings

Revision 1.19: download - view: text, markup, annotated - select for diffs
Sun May 2 23:56:12 1999 UTC (12 years, 9 months ago) by alc
Branches: MAIN
CVS tags: POST_VFS_BIO_NFS_PATCH
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +12 -0 lines
The VFS/BIO subsystem contained a number of hacks in order to optimize
piecemeal, middle-of-file writes for NFS.  These hacks have caused no
end of trouble, especially when combined with mmap().  I've removed
them.  Instead, NFS will issue a read-before-write to fully
instantiate the struct buf containing the write.  NFS does, however,
optimize piecemeal appends to files.  For most common file operations,
you will not notice the difference.  The sole remaining fragment in
the VFS/BIO system is b_dirtyoff/end, which NFS uses to avoid cache
coherency issues with read-merge-write style operations.  NFS also
optimizes the write-covers-entire-buffer case by avoiding the
read-before-write.  There is quite a bit of room for further
optimization in these areas.

The VM system marks pages fully-valid (AKA vm_page_t->valid =
VM_PAGE_BITS_ALL) in several places, most noteably in vm_fault.  This
is not correct operation.  The vm_pager_get_pages() code is now
responsible for marking VM pages all-valid.  A number of VM helper
routines have been added to aid in zeroing-out the invalid portions of
a VM page prior to the page being marked all-valid.  This operation is
necessary to properly support mmap().  The zeroing occurs most often
when dealing with file-EOF situations.  Several bugs have been fixed
in the NFS subsystem, including bits handling file and directory EOF
situations and buf->b_flags consistancy issues relating to clearing
B_ERROR & B_INVAL, and handling B_DONE.

getblk() and allocbuf() have been rewritten.  B_CACHE operation is now
formally defined in comments and more straightforward in
implementation.  B_CACHE for VMIO buffers is based on the validity of
the backing store.  B_CACHE for non-VMIO buffers is based simply on
whether the buffer is B_INVAL or not (B_CACHE set if B_INVAL clear,
and vise-versa).  biodone() is now responsible for setting B_CACHE
when a successful read completes.  B_CACHE is also set when a bdwrite()
is initiated and when a bwrite() is initiated.  VFS VOP_BWRITE
routines (there are only two - nfs_bwrite() and bwrite()) are now
expected to set B_CACHE.  This means that bowrite() and bawrite() also
set B_CACHE indirectly.

There are a number of places in the code which were previously using
buf->b_bufsize (which is DEV_BSIZE aligned) when they should have
been using buf->b_bcount.  These have been fixed.  getblk() now clears
B_DONE on return because the rest of the system is so bad about
dealing with B_DONE.

Major fixes to NFS/TCP have been made.  A server-side bug could cause
requests to be lost by the server due to nfs_realign() overwriting
other rpc's in the same TCP mbuf chain.  The server's kernel must be
recompiled to get the benefit of the fixes.

Submitted by:	Matthew Dillon <dillon@apollo.backplane.com>

Revision 1.18: download - view: text, markup, annotated - select for diffs
Thu Feb 25 15:54:06 1999 UTC (12 years, 11 months ago) by bde
Branches: MAIN
CVS tags: PRE_VFS_BIO_NFS_PATCH, PRE_SMP_VMSHARE, PRE_NEWBUS, POST_SMP_VMSHARE, POST_NEWBUS
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +1 -0 lines
Added a used #include (don't depend on "vnode_if.h" including <sys/buf.h>).

Revision 1.17: download - view: text, markup, annotated - select for diffs
Wed Jan 20 14:49:11 1999 UTC (13 years ago) by eivind
Branches: MAIN
CVS tags: RELENG_3_BP, RELENG_3_5_0_RELEASE, RELENG_3_4_0_RELEASE, RELENG_3_3_0_RELEASE, RELENG_3_2_PAO_BP, RELENG_3_2_PAO, RELENG_3_2_0_RELEASE, RELENG_3_1_0_RELEASE, RELENG_3
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +11 -1 lines
Add 'options DEBUG_LOCKS', which stores extra information in struct
lock, and add some macros and function parameters to make sure that
the information get to the point where it can be put in the lock
structure.

While I'm here, add DEBUG_VFS_LOCKS to LINT.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue Nov 10 09:04:09 1998 UTC (13 years, 3 months ago) by peter
Branches: MAIN
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +7 -0 lines
Make the vnode opv vector construction fully dynamic.  Previously we
leaked memory on each unload and were limited to items referenced in
the kernel copy of vnode_if.c.  Now a kernel module is free to create
it's own VOP_FOO() routines and the rest of the system will happily
deal with it, including passthrough layers like union/umap/etc.

Have VFS_SET() call a common vfs_modevent() handler rather than
inline duplicating the common code all over the place.

Have VNODEOP_SET() have the vnodeops removed at unload time (assuming a
module) so that the vop_t ** vector is reclaimed.

Slightly adjust the vop_t ** vectors so that calling slot 0 is a panic
rather than a page fault.  This could happen if VOP_something() was called
without *any* handlers being present anywhere (including in vfs_default.c).
slot 1 becomes the default vector for the vnodeop table.

TODO: reclaim zones on unload (eg: nfs code)

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sat Jul 4 20:45:32 1998 UTC (13 years, 7 months ago) by julian
Branches: MAIN
CVS tags: RELENG_3_0_0_RELEASE, PRE_NOBDEV
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +1 -0 lines
VOP_STRATEGY grows an (struct vnode *) argument
as the value in b_vp is often not really what you want.
(and needs to be frobbed). more cleanups will follow this.
Reviewed by: Bruce Evans <bde@freebsd.org>

Revision 1.14: download - view: text, markup, annotated - select for diffs
Wed May 6 05:29:31 1998 UTC (13 years, 9 months ago) by msmith
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +0 -23 lines
As described by the submitter:

Reverse the VFS_VRELE patch.  Reference counting of vnodes does not need
to be done per-fs.  I noticed this while fixing vfs layering violations.
Doing reference counting in generic code is also the preference cited by
John Heidemann in recent discussions with him.

The implementation of alternative vnode management per-fs is still a valid
requirement for some filesystems but will be revisited sometime later,
most likely using a different framework.

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

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat Mar 7 21:35:31 1998 UTC (13 years, 11 months ago) by dyson
Branches: MAIN
CVS tags: PRE_SOFTUPDATE, PRE_DEVFS_SLICE, POST_SOFTUPDATE, POST_DEVFS_SLICE
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +2 -2 lines
This mega-commit is meant to fix numerous interrelated problems.  There
has been some bitrot and incorrect assumptions in the vfs_bio code.  These
problems have manifest themselves worse on NFS type filesystems, but can
still affect local filesystems under certain circumstances.  Most of
the problems have involved mmap consistancy, and as a side-effect broke
the vfs.ioopt code.  This code might have been committed seperately, but
almost everything is interrelated.

1)	Allow (pmap_object_init_pt) prefaulting of buffer-busy pages that
	are fully valid.
2)	Rather than deactivating erroneously read initial (header) pages in
	kern_exec, we now free them.
3)	Fix the rundown of non-VMIO buffers that are in an inconsistent
	(missing vp) state.
4)	Fix the disassociation of pages from buffers in brelse.  The previous
	code had rotted and was faulty in a couple of important circumstances.
5)	Remove a gratuitious buffer wakeup in vfs_vmio_release.
6)	Remove a crufty and currently unused cluster mechanism for VBLK
	files in vfs_bio_awrite.  When the code is functional, I'll add back
	a cleaner version.
7)	The page busy count wakeups assocated with the buffer cache usage were
	incorrectly cleaned up in a previous commit by me.  Revert to the
	original, correct version, but with a cleaner implementation.
8)	The cluster read code now tries to keep data associated with buffers
	more aggressively (without breaking the heuristics) when it is presumed
	that the read data (buffers) will be soon needed.
9)	Change to filesystem lockmgr locks so that they use LK_NOPAUSE.  The
	delay loop waiting is not useful for filesystem locks, due to the
	length of the time intervals.
10)	Correct and clean-up spec_getpages.
11)	Implement a fully functional nfs_getpages, nfs_putpages.
12)	Fix nfs_write so that modifications are coherent with the NFS data on
	the server disk (at least as well as NFS seems to allow.)
13)	Properly support MS_INVALIDATE on NFS.
14)	Properly pass down MS_INVALIDATE to lower levels of the VM code from
	vm_map_clean.
15)	Better support the notion of pages being busy but valid, so that
	fewer in-transit waits occur.  (use p->busy more for pageouts instead
	of PG_BUSY.)  Since the page is fully valid, it is still usable for
	reads.
16)	It is possible (in error) for cached pages to be busy.  Make the
	page allocation code handle that case correctly.  (It should probably
	be a printf or panic, but I want the system to handle coding errors
	robustly.  I'll probably add a printf.)
17)	Correct the design and usage of vm_page_sleep.  It didn't handle
	consistancy problems very well, so make the design a little less
	lofty.  After vm_page_sleep, if it ever blocked, it is still important
	to relookup the page (if the object generation count changed), and
	verify it's status (always.)
18)	In vm_pageout.c, vm_pageout_clean had rotted, so clean that up.
19)	Push the page busy for writes and VM_PROT_READ into vm_pageout_flush.
20)	Fix vm_pager_put_pages and it's descendents to support an int flag
	instead of a boolean, so that we can pass down the invalidate bit.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Sun Mar 1 22:46:04 1998 UTC (13 years, 11 months ago) by msmith
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +23 -0 lines
The intent is to get rid of WILLRELE in vnode_if.src by making
a complement to all ops that return a vpp, VFS_VRELE.  This is
initially only for file systems that implement the following ops
that do a WILLRELE:

	vop_create, vop_whiteout, vop_mknod, vop_remove, vop_link,
	vop_rename, vop_mkdir, vop_rmdir, vop_symlink

This is initial DNA that doesn't do anything yet.  VFS_VRELE is
implemented but not called.

A default vfs_vrele was created for fs implementations that use the
standard vnode management routines.

VFS_VRELE implementations were made for the following file systems:

Standard (vfs_vrele)
	ffs mfs nfs msdosfs devfs ext2fs

Custom
	union umapfs

Just EOPNOTSUPP
	fdesc procfs kernfs portal cd9660

These implementations may change as VOP changes are implemented.

In the next phase, in the vop implementations calls to vrele and the vrele
part of vput will be moved to the top layer vfs_vnops and made visible
to all layers.  vput will be replaced by unlock in these cases.  Unlocking
will still be done in the per fs layer but the refcount decrement will be
triggered at the top because it doesn't hurt to hold a vnode reference a
little longer.  This will have minimal impact on the structure of the
existing code.

This will only be done for vnode arguments that are released by the various
fs vop implementations.

Wider use of VFS_VRELE will likely require restructuring of the code.

Reviewed by:	phk, dyson, terry et. al.
Submitted by:	Michael Hancock <michaelh@cet.co.jp>

Revision 1.11: download - view: text, markup, annotated - select for diffs
Tue Jan 6 05:16:06 1998 UTC (14 years, 1 month ago) by dyson
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +18 -3 lines
Make our v_usecount vnode reference count work identically to the
original BSD code.  The association between the vnode and the vm_object
no longer includes reference counts.  The major difference is that
vm_object's are no longer freed gratuitiously from the vnode, and so
once an object is created for the vnode, it will last as long as the
vnode does.

When a vnode object reference count is incremented, then the underlying
vnode reference count is incremented also.  The two "objects" are now
more intimately related, and so the interactions are now much less
complex.

When vnodes are now normally placed onto the free queue with an object still
attached.  The rundown of the object happens at vnode rundown time, and
happens with exactly the same filesystem semantics of the original VFS
code.  There is absolutely no need for vnode_pager_uncache and other
travesties like that anymore.

A side-effect of these changes is that SMP locking should be much simpler,
the I/O copyin/copyout optimizations work, NFS should be more ponderable,
and further work on layered filesystems should be less frustrating, because
of the totally coherent management of the vnode objects and vnodes.

Please be careful with your system while running this code, but I would
greatly appreciate feedback as soon a reasonably possible.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Wed Dec 17 14:44:23 1997 UTC (14 years, 1 month ago) by wollman
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -0 lines
Revert poll() for UFS files to traditional behavior where polling for read-
or writability always returns true.  This works around bugs in netscape and
squid, at a minimum.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Mon Dec 15 03:09:29 1997 UTC (14 years, 1 month ago) by wollman
Branches: MAIN
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +23 -2 lines
Add support for poll(2) on files.   vop_nopoll() now returns POLLNVAL
if one of the new poll types is requested; hopefully this will not break
any existing code.  (This is done so that programs have a dependable
way of determining whether a filesystem supports the extended poll types
or not.)

The new poll types added are:

	POLLWRITE - file contents may have been modified
	POLLNLINK - file was linked, unlinked, or renamed
	POLLATTRIB - file's attributes may have been changed
	POLLEXTEND - file was extended

Note that the internal operation of poll() means that it is impossible
for two processes to reliably poll for the same event (this could
be fixed but may not be worth it), so it is not possible to rewrite
`tail -f' to use poll at this time.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Fri Dec 5 19:55:40 1997 UTC (14 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +1 -0 lines
Don't include <sys/lock.h> in headers when only `struct simplelock' is
required.  Fixed everything that depended on the pollution.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Tue Nov 18 13:03:48 1997 UTC (14 years, 2 months ago) by bde
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +1 -3 lines
Removed an unused #include.

Fixed a style bug (one of many KNF breakages in vfs_subr.c moved here).

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sun Oct 26 20:55:04 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +205 -2 lines
VFS interior redecoration.

Rename vn_default_error to vop_defaultop all over the place.
Move vn_bwrite from vfs_bio.c to vfs_default.c and call it vop_stdbwrite.
Use vop_null instead of nullop.
Move vop_nopoll from vfs_subr.c to vfs_default.c
Move vop_sharedlock from vfs_subr.c to vfs_default.c
Move vop_nolock from vfs_subr.c to vfs_default.c
Move vop_nounlock from vfs_subr.c to vfs_default.c
Move vop_noislocked from vfs_subr.c to vfs_default.c
Use vop_ebadf instead of *_ebadf.
Add vop_defaultop for getpages on master vnode in MFS.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Sun Oct 26 20:26:32 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +1 -1 lines
Simplify the lease_check stuff.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Fri Oct 17 12:36:16 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +45 -0 lines
Make a set of VOP standard lock, unlock & islocked VOP operators, which
depend on the lock being located at vp->v_data.  Saves 3x3 identical
vop procs, more as the other filesystems becomes lock aware.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Thu Oct 16 21:59:42 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +3 -0 lines
VFS clean up "hekto commit"

1.  Add defaults for more VOPs
        VOP_LOCK        vop_nolock
        VOP_ISLOCKED    vop_noislocked
        VOP_UNLOCK      vop_nounlock
    and remove direct reference in filesystems.

2.  Rename the nfsv2 vnop tables to improve sorting order.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Thu Oct 16 20:32:22 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +76 -6 lines
Another VFS cleanup "kilo commit"

1.  Remove VOP_UPDATE, it is (also) an UFS/{FFS,LFS,EXT2FS,MFS}
    intereface function, and now lives in the ufsmount structure.

2.  Remove VOP_SEEK, it was unused.

3.  Add mode default vops:

    VOP_ADVLOCK          vop_einval
    VOP_CLOSE            vop_null
    VOP_FSYNC            vop_null
    VOP_IOCTL            vop_enotty
    VOP_MMAP             vop_einval
    VOP_OPEN             vop_null
    VOP_PATHCONF         vop_einval
    VOP_READLINK         vop_einval
    VOP_REALLOCBLKS      vop_eopnotsupp

    And remove identical functionality from filesystems

4.   Add vop_stdpathconf, which returns the canonical stuff.  Use
     it in the filesystems.  (XXX: It's probably wrong that specfs
     and fifofs sets this vop, shouldn't it come from the "host"
     filesystem, for instance ufs or cd9660 ?)

5.   Try to make system wide VOP functions have vop_* names.

6.   Initialize the um_* vectors in LFS.

(Recompile your LKMS!!!)

Revision 1.1: download - view: text, markup, annotated - select for diffs
Thu Oct 16 17:48:22 1997 UTC (14 years, 3 months ago) by phk
Branches: MAIN
Oops. forgot the blasted cvs add.

Pointed hat sent from:	Karl Denninger  <karl@Mcs.Net>

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