Home | History | Annotate | Download | only in coda
History log of /src/sys/coda/coda_vnops.c
RevisionDateAuthorComments
 1.119  14-May-2024  andvar fix recently committed typos by msaitoh in few more places, as well as few more.
mainly s/contigous/contiguous/ and s/miliseconds/milliseconds/ in comments.
 1.118  27-Mar-2022  christos add a kauth vnode check for creating links
 1.117  05-Dec-2021  msaitoh s/sybolic/symbolic/ in comment.
 1.116  20-Oct-2021  thorpej Overhaul of the EVFILT_VNODE kevent(2) filter:

- Centralize vnode kevent handling in the VOP_*() wrappers, rather than
forcing each individual file system to deal with it (except VOP_RENAME(),
because VOP_RENAME() is a mess and we currently have 2 different ways
of handling it; at least it's reasonably well-centralized in the "new"
way).
- Add support for NOTE_OPEN, NOTE_CLOSE, NOTE_CLOSE_WRITE, and NOTE_READ,
compatible with the same events in FreeBSD.
- Track which kevent notifications clients are interested in receiving
to avoid doing work for events no one cares about (avoiding, e.g.
taking locks and traversing the klist to send a NOTE_WRITE when
someone is merely watching for a file to be deleted, for example).

In support of the above:

- Add support in vnode_if.sh for specifying PRE- and POST-op handlers,
to be invoked before and after vop_pre() and vop_post(), respectively.
Basic idea from FreeBSD, but implemented differently.
- Add support in vnode_if.sh for specifying CONTEXT fields in the
vop_*_args structures. These context fields are used to convey information
between the file system VOP function and the VOP wrapper, but do not
occupy an argument slot in the VOP_*() call itself. These context fields
are initialized and subsequently interpreted by PRE- and POST-op handlers.
- Version VOP_REMOVE(), uses the a context field for the file system to report
back the resulting link count of the target vnode. Return this in tmpfs,
udf, nfs, chfs, ext2fs, lfs, and ufs.

NetBSD 9.99.92.
 1.115  29-Jun-2021  dholland - Add a new vnode op: VOP_PARSEPATH.
- Move namei_getcomponent to genfs_vnops.c and call it genfs_parsepath.
- Add a parsepath entry to every vnode ops table.

VOP_PARSEPATH takes a directory vnode to be searched and a complete
following path and chooses how much of that path to consume. To begin
with, all parsepath calls are genfs_parsepath, which locates the first
'/' as always.

Note that the call doesn't take the whole struct componentname, only
the string. The other bits of struct componentname should not be
needed and there's no reason to cause potential complications by
exposing them.
 1.114  14-Nov-2020  hannken branches: 1.114.4;
Rewrite coda_readdir() to directly process the container file.

Passing this operation down to the file system holding the container
cannot work for anything but UFS and UFS doesn't allow reading
directory from a plain file since ~2015.

Fixes PR kern/55775 Coda client, its in-kernel part, opens wrong files ...
 1.113  14-Nov-2020  hannken Add coda_pathconf() always returning EINVAL.
 1.112  16-May-2020  christos branches: 1.112.2;
Add ACL support for FFS. From FreeBSD.
 1.111  13-Apr-2020  ad Replace most uses of vp->v_usecount with a call to vrefcnt(vp), a function
that hides the details and does atomic_load_relaxed(). Signature matches
FreeBSD.
 1.110  24-Feb-2020  ad branches: 1.110.4;
v_interlock -> vmobjloc
 1.109  23-Feb-2020  ad UVM locking changes, proposed on tech-kern:

- Change the lock on uvm_object, vm_amap and vm_anon to be a RW lock.
- Break v_interlock and vmobjlock apart. v_interlock remains a mutex.
- Do partial PV list locking in the x86 pmap. Others to follow later.
 1.108  17-Jan-2020  ad VFS_VGET(), VFS_ROOT(), VFS_FHTOVP(): give them a "int lktype" argument, to
allow us to get shared locks (or no lock) on the returned vnode. Matches
FreeBSD.
 1.107  20-Nov-2018  christos branches: 1.107.4; 1.107.6;
Fix locking for readdir code (Brett Lymn)
 1.106  26-May-2017  riastradh branches: 1.106.2; 1.106.8; 1.106.10;
Make VOP_RECLAIM do the last unlock of the vnode.

VOP_RECLAIM naturally has exclusive access to the vnode, so having it
locked on entry is not strictly necessary -- but it means if there
are any final operations that must be done on the vnode, such as
ffs_update, requiring exclusive access to it, we can now kassert that
the vnode is locked in those operations.

We can't just have the caller release the last lock because some file
systems don't use genfs_lock, and require the vnode to remain valid
for VOP_UNLOCK to work, notably unionfs.
 1.105  26-Apr-2017  riastradh Change VOP_REMOVE and VOP_RMDIR to preserve lock/ref on dvp.

No change to vp -- the plan is to replace the node by the
componentname in the vop parameters, and let all directory vops do
lookups internally.

Proposed on tech-kern with no objections:
https://mail-index.netbsd.org/tech-kern/2017/04/17/msg021825.html
 1.104  11-Apr-2017  riastradh Make VOP_INACTIVE preserve vnode lock on return.

Discussed on tech-kern:
https://mail-index.netbsd.org/tech-kern/2017/04/01/msg021751.html

Ride 7.99.68, a bumpy bus of incremental vfs improvements!
 1.103  20-Aug-2016  hannken branches: 1.103.2;
Remove now obsolete operation vcache_remove().

Welcome to 7.99.36
 1.102  20-Apr-2015  riastradh branches: 1.102.2;
Make VOP_LINK return directory still locked and referenced.

Ride 7.99.10 bump.
 1.101  13-Dec-2014  hannken Change coda from hashlist to vcache.
- Replace all hash list crawlers with vfs_vnode_iterator.
 1.100  13-Dec-2014  hannken Remove cnodes from coda_reclaim(), not from coda_inactive().
 1.99  13-Dec-2014  hannken Attach the control object vnode to the coda mount and release it
on unmount. Initialize special files with NODEV.
 1.98  18-Oct-2014  snj branches: 1.98.2;
src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
 1.97  25-Jul-2014  dholland Add VOP_FALLOCATE and VOP_FDISCARD to every vnode ops table I can
find.

The filesystem ones all call genfs_eopnotsupp - right now I am only
implementing the plumbing and we can implement fallocate and/or
fdiscard for files later.

The device ones call spec_fallocate (which is also genfs_eopnotsupp)
and spec_fdiscard, which dispatches to the device-level op.

The fifo ones all call vn_fifo_bypass, which also ends up being
EOPNOTSUPP.
 1.96  20-Mar-2014  skrll branches: 1.96.2;
Mechanically replace simplelock with kmutex_t.
 1.95  27-Feb-2014  hannken The current implementation of vn_lock() is racy. Modification of
the vnode operations vector for active vnodes is unsafe because it
is not known whether deadfs or the original file system will be
called.

- Pass down LK_RETRY to the lock operation (hint for deadfs only).

- Change deadfs lock operation to return ENOENT if LK_RETRY is unset.

- Change all other lock operations to check for dead vnode once
the vnode is locked and unlock and return ENOENT in this case.

With these changes in place vnode lock operations will never succeed
after vclean() has marked the vnode as VI_XLOCK and before vclean()
has changed the operations vector.

Adresses PR kern/37706 (Forced unmount of file systems is unsafe)

Discussed on tech-kern.

Welcome to 6.99.33
 1.94  07-Feb-2014  hannken Change vnode operation lookup to return the resulting vnode *vpp unlocked.
Change cache_lookup() to return an unlocked vnode.

Discussed on tech-kern@

Welcome to 6.99.31
 1.93  23-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to return
the resulting vnode *vpp unlocked.

Discussed on tech-kern@

Welcome to 6.99.30
 1.92  17-Jan-2014  hannken Change vnode operations create, mknod, mkdir and symlink to keep the
directory node dvp locked on return.

Discussed on tech-kern@

Welcome to 6.99.29
 1.91  17-Oct-2013  christos remove unused code.
 1.90  02-Aug-2012  christos branches: 1.90.2; 1.90.4;
- move debugging functions to vcoda so modules with -DDEBUG link
- fix writing to coda files. this is probably not the right way to do
this, but it satisfies the locking protocol:
1. Sometimes coda_open() is called with an unlocked vnode which
does not satisfy the locking protocol. Lock it for now. We
need to find out why this happens
2. VFS_VGET sometimes returns the container vnode unlocked. What
is the locking protocol for VFS_VGET? We also lock it here.
 1.89  28-Jul-2012  matt -fno-common fallout.
 1.88  04-May-2012  christos comment out debugging printfs
 1.87  04-May-2012  christos fix locking in getpages when running executables.
 1.86  03-May-2012  christos move the assert after the locked case.
 1.85  02-May-2012  christos Instead of sharing the coda vnode lock with the ffs vnode lock, share the
ffs vnode lock with coda.
 1.84  28-Apr-2012  christos cosmetic only: __func__, vnode_t
 1.83  28-Apr-2012  christos Fixes from get/putpages from rmind.
In grab vnode, share the lock of the coda vnode with the underlying vnode,
so that the locking protocol works.
 1.82  26-Apr-2012  christos re-arrange things so that vcoda does not depend on coda.
 1.81  13-Sep-2011  gdt branches: 1.81.2; 1.81.6;
Reduce verbosity of semi-debug coda_inactive printf.

Rather than print if the usecount is > 0, only print if it is greater
than 1. It seems 1 is normal.
 1.80  12-Jun-2011  rmind Welcome to 5.99.53! Merge rmind-uvmplock branch:

- Reorganize locking in UVM and provide extra serialisation for pmap(9).
New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
kernel-lock on some ports). Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
 1.79  19-May-2011  rmind branches: 1.79.2;
Remove cache_purge(9) calls from reclamation routines in the file systems,
as vclean(9) performs it for us since Lite2 merge.
 1.78  30-Nov-2010  dholland branches: 1.78.2;
Abolish the SAVENAME and HASBUF flags. There is now always a buffer,
so the path in a struct componentname is now always valid during VOP
calls.
 1.77  30-Nov-2010  dholland Abolish struct componentname's cn_pnbuf. Use the path buffer in the
pathbuf object passed to namei as work space instead. (For now a pnbuf
pointer appears in struct nameidata, to support certain unclean things
that haven't been fixed yet, but it will be going away in the future.)

This removes the need for the SAVENAME and HASBUF namei flags.
 1.76  20-Jul-2010  christos Correct incomplete size checks for the coda ioctls. From Dan Rosenberg.
 1.75  01-Jul-2010  hannken Remove vlockmgr(). Generic vnode lock operations now use a rwlock located
in the vnode. All LK_* flags move from sys/lock.h to sys/vnode.h. Calls
to vlockmgr() in file systems get replaced with VOP_LOCK() or VOP_UNLOCK().

Welcome to 5.99.34.

Discussed on tech-kern.
 1.74  24-Jun-2010  hannken Clean up vnode lock operations pass 2:

VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
 1.73  24-Jun-2010  hannken coda_lock(): LK_INTERLOCK flag no longer possible.
 1.72  24-Jun-2010  hannken Clean up vnode lock operations:

- VOP_LOCK(vp, flags): Limit the set of allowed flags to LK_EXCLUSIVE,
LK_SHARED and LK_NOWAIT. LK_INTERLOCK is no longer allowed as it
makes no sense here.

- VOP_ISLOCKED(vp): Remove the for some time unused return value
LK_EXCLOTHER. Mark this operation as "diagnostic only".
Making a lock decision based on this operation is no longer allowed.

Discussed on tech-kern.
 1.71  23-Nov-2009  rmind branches: 1.71.2; 1.71.4;
Remove some unecessary includes sys/user.h header.
 1.70  29-Jun-2009  dholland Convert 67 namei call sites to use namei_simple, in these functions:

check_console, veriexecclose, veriexec_delete, veriexec_file_add,
emul_find_root, coff_load_shlib (sh3 version), coff_load_shlib,
compat_20_sys_statfs, compat_20_netbsd32_statfs,
ELFNAME2(netbsd32,probe_noteless), darwin_sys_statfs,
ibcs2_sys_statfs, ibcs2_sys_statvfs, linux_sys_uselib,
osf1_sys_statfs, sunos_sys_statfs, sunos32_sys_statfs,
ultrix_sys_statfs, do_sys_mount, fss_create_files (3 of 4),
adosfs_mount, cd9660_mount, coda_ioctl, coda_mount, ext2fs_mount,
ffs_mount, filecore_mount, hfs_mount, lfs_mount, msdosfs_mount,
ntfs_mount, sysvbfs_mount, udf_mount, union_mount, sys_chflags,
sys_lchflags, sys_chmod, sys_lchmod, sys_chown, sys_lchown,
sys___posix_chown, sys___posix_lchown, sys_link, do_sys_pstatvfs,
sys_quotactl, sys_revoke, sys_truncate, do_sys_utimes, sys_extattrctl,
sys_extattr_set_file, sys_extattr_set_link, sys_extattr_get_file,
sys_extattr_get_link, sys_extattr_delete_file,
sys_extattr_delete_link, sys_extattr_list_file, sys_extattr_list_link,
sys_setxattr, sys_lsetxattr, sys_getxattr, sys_lgetxattr,
sys_listxattr, sys_llistxattr, sys_removexattr, sys_lremovexattr

All have been scrutinized (several times, in fact) and compile-tested,
but not all have been explicitly tested in action.

XXX: While I haven't (intentionally) changed the use or nonuse of
XXX: TRYEMULROOT in any of these places, I'm not convinced all the
XXX: uses are correct; an audit might be desirable.
 1.69  11-Jan-2009  christos branches: 1.69.2;
merge christos-time_t
 1.68  30-Jan-2008  ad branches: 1.68.6; 1.68.8; 1.68.12; 1.68.20; 1.68.22; 1.68.26; 1.68.28;
Replace struct lock on vnodes with a simpler lock object built on
krwlock_t. This is a step towards removing lockmgr and simplifying
vnode locking. Discussed on tech-kern.
 1.67  25-Jan-2008  ad Remove VOP_LEASE. Discussed on tech-kern.
 1.66  02-Jan-2008  ad Merge vmlocking2 to head.
 1.65  25-Dec-2007  perry Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
 1.64  08-Dec-2007  pooka branches: 1.64.4;
Remove cn_lwp from struct componentname. curlwp should be used
from on. The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
 1.63  26-Nov-2007  pooka branches: 1.63.2;
Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start. In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
 1.62  23-Jul-2007  pooka branches: 1.62.4; 1.62.6; 1.62.12; 1.62.14;
Initialize size and/or writesize when creating a vnode.
 1.61  25-Apr-2007  dogcow branches: 1.61.2;
make coda compile again.
 1.60  15-Apr-2007  gdt Stop doing vref of vnodes on open (and vrele on close); this makes no
sense.

Improve coda_inactive, turning commented out DIAGNOSTIC checks into printfs.

minor style/comment fixes.
 1.59  15-Apr-2007  gdt In coda_{get,put}pages, drop and obtain v_uobj.vmobjlock rather than
v_interlock. They are actually the same lock, but the former protects
the uvm object associated with the vnode, and the latter vnode
reference counts. Explained to me by chs@.
 1.58  15-Apr-2007  gdt Based on suggestion from chs@, drop coda vnode interlock before
obtaining interlock on container vnode in coda_{get,put}pages. This
is the only functional change in this commit.

Improve many comments. In particular, note that the relationship
between VOP_OPEN and obtaining a container file (e.g. for getpages for
executables) is messy.

Add printfs for 'internal open' cases in coda_rdwr. These have not
been triggered in my testing. Note an apparent vref leak.
 1.57  12-Apr-2007  gdt Rewrite coda_{get,put}pages. Now copying files from coda with mmap
does not trigger assertions in uvm_fault, and executing files from
coda works as well.

Code very lightly reviewed by wrstuden@; scrutiny by those who
understand vnode and especially {get,put}pages would be appreciated.
 1.56  09-Apr-2007  gdt revert putpages part of last change. Thanks to pooka@ for pointing
out that the v_interlock in the previous code and v_uobj.vmobjlock are
really the same thing.
 1.55  08-Apr-2007  gdt Further cleanups on coda vnode handling.

Re-enable mmap. The problem is how uvm_fault handles page faults from
coda vnodes via container files, and executing a program caused the
same problem so disabling mmap only helped cp(1).

coda_open:
rename variables to match vnode_if.src
better comments about lock/reference state of vnodes
keep lock on container file until after VOP_OPEN, which requires locked vp
remove #if 0'd code to PNBUF_PUT

coda_link:
rename variables to match vnode_if.src
error out early if vp == dvp
check return value on vn_lock, and add comment questoining the lock
clarify lock handling, but unchanged logic
remove #if 0'd code to PNBUF_PUT

coda_rmdir:
error out early if vp == dvp
remove #if 0'd code to PNBUF_PUT

coda_grab_vnode:
add comments, and in particular question undocumented VFS_VGET semantics

coda_getpages:
question calling VOP_OPEN, which requires a locked vnode, with the
vnode we got (vop_getpages does not guarantee a locked vnode)

coda_putpages:
remove inexplicable simple_unlock(&vp->v_interlock);
add printf so we notice if this is ever called

add comment explaining that the implementation will lead to trouble,
because vnode_if.src says putpages is called with v_uobj.vmobjlock
held and is supposed to unlock it

With these changes and an uncommitted change to uvm_fault not to panic
if uvm objects are not equal, coda seems stable again.
 1.54  06-Apr-2007  gdt Disable mmap for coda. When copying a file from coda to normal ffs, I
got a panic in uvm_fault from ffs_write. I believe this is because cp
used mmap, the container file page was not in core, and uvm_fault
objected to the container file vnode and the coda vnode not matching.
I have long been plagued by crashes on cp from coda, and this was the
first time I got and understood a backtrace.

Clean up old comments that are no longer accurate.

Document refcounting better.

Note some questionable behaviors with XXX.

Clean up PNBUF_PUT and SAVESTART. Only do this where vnodeops(9) says
we should, and do it on error also.

In symlink, vput parent and free namebuf even in error cases.
 1.53  05-Apr-2007  gdt Improve conformance to vnode locking rules in coda_lookup, by doing
the unlock parent, lock child, lock parent in the ISDOTDOT case.

Clean up and rewrite comments to match more closely current reality.

Sprinkle XXX where I'm not sure the current rules are being followed.

Reviewed by wrstuden@, who agreed that this is an improvement over the
current code, with concerns about LK_RETRY and whether the ISDOTDOT
locking is done soon enough.
 1.52  04-Mar-2007  christos branches: 1.52.2; 1.52.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.51  09-Dec-2006  chs branches: 1.51.2;
a smorgasbord of improvements to vnode locking and path lookup:
- LOCKPARENT is no longer relevant for lookup(), relookup() or VOP_LOOKUP().
these now always return the parent vnode locked. namei() works as before.
lookup() and various other paths no longer acquire vnode locks in the
wrong order via vrele(). fixes PR 32535.
as a nice side effect, path lookup is also up to 25% faster.
- the above allows us to get rid of PDIRUNLOCK.
- also get rid of WANTPARENT (just use LOCKPARENT and unlock it).
- remove an assumption in layer_node_find() that all file systems implement
a recursive VOP_LOCK() (unionfs doesn't).
- require that all file systems supply vfs_vptofh and vfs_fhtovp routines.
fill in eopnotsupp() for file systems that don't support being exported
and remove the checks for NULL. (layerfs calls these without checking.)
- in union_lookup1(), don't change refcounts in the ISDOTDOT case, just
adjust which vnode is locked. fixes PR 33374.
- apply fixes for ufs_rename() from ufs_vnops.c rev. 1.61 to ext2fs_rename().
 1.50  21-Jul-2006  ad branches: 1.50.4; 1.50.6; 1.50.8;
- Use the LWP cached credentials where sane.
- Minor cosmetic changes.
 1.49  14-May-2006  elad integrate kauth.
 1.48  12-Apr-2006  christos COVERITY CID 1113: Don't use NULL for VOP_READDIR
 1.47  01-Mar-2006  yamt branches: 1.47.2; 1.47.4; 1.47.6;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.
 1.46  12-Jan-2006  gdt branches: 1.46.2; 1.46.4;
In coda_lookup, add LK_RETRY to locking of child vnode. The previous
code paniced if the first attempt to lock the vnode failed, and such
failures are not errors - just cause to wait. gdt was regularly
hitting this panic.

Correct one of two identical panic messages.

Add XXX comments about

ISDOTDOT locking rules not being followed

questioning the practice of unlocking parent before locking child.
(But, given that the vnode is referenced, it can't be deleted, so
maybe this is fine.)

Why is failured to unlock not a panic but failure to lock is?
 1.45  11-Dec-2005  christos branches: 1.45.2;
merge ktrace-lwp.
 1.44  02-Nov-2005  yamt branches: 1.44.2;
merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE
 1.43  30-Aug-2005  xtraeme branches: 1.43.2;
* Remove __P()
* Use ANSI function declarations
 1.42  19-Aug-2005  christos 64 bit inode changes.
 1.41  29-May-2005  christos branches: 1.41.2;
- sprinkle const
- avoid shadowed variables.
 1.40  26-Feb-2005  perry nuke trailing whitespace
 1.39  25-Jun-2004  petrov branches: 1.39.4; 1.39.6;
Fix coda symlink vnodeops. Provided by Greg Troxel. PR kern/25963.
 1.38  30-Oct-2003  simonb branches: 1.38.2;
Remove some assigned-to but otherwise unused variables.
 1.37  27-Aug-2003  drochner update for the protocol used by coda>=6,
patches supplied by the coda-6.0.2 distribution,
with small changes to support the old protocol optionally
(options CODA_COMPAT_5)
 1.36  29-Jun-2003  fvdl branches: 1.36.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.35  29-Jun-2003  thorpej Undo part of the ktrace/lwp changes. In particular:
* Remove the "lwp *" argument that was added to vget(). Turns out
that nothing actually used it!
* Remove the "lwp *" arguments that were added to VFS_ROOT(), VFS_VGET(),
and VFS_FHTOVP(); all they did was pass it to vget() (which, as noted
above, didn't use it).
* Remove all of the "lwp *" arguments to internal functions that were added
just to appease the above.
 1.34  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.33  06-Jan-2003  wiz writable, not writeable.
 1.32  27-Sep-2002  provos remove trailing \n in panic(). approved perry.
 1.31  30-Jul-2002  soren Die, qaddr_t, die! - mnt_data in struct mount is already effectively
a void *, so stop pretending otherwise.
 1.30  06-Dec-2001  chs branches: 1.30.8;
add a VOP_PUTPAGES method for all the filesystems that don't have pages,
just unlock the interlock.
 1.29  24-Nov-2001  perry add a VTOC macro that doesn't cast, and fix a spurious lvalue cast with it.
 1.28  23-Nov-2001  perry __FUNCTION__ -> __func__
 1.27  12-Nov-2001  lukem add RCSIDs
 1.26  24-Jul-2001  assar branches: 1.26.2;
change vop_symlink and vop_mknod to return vpp (the created node)
refed, so that the caller can actually use it. update callers and
file systems that implement these vnode operations
 1.25  03-Jul-2001  chs branches: 1.25.2;
add coda_{get,put}pages so that mmap works.
 1.24  28-May-2001  chs add a genfs_mmap() and change all of the disk-based filesystems
to implement VOP_MMAP() with the genfs version, in preparation for
actually using this VOP.
 1.23  22-Jan-2001  jdolecek branches: 1.23.2;
make filesystem vnodeop, specop, fifoop and vnodeopv_* arrays const
 1.22  27-Nov-2000  chs Initial integration of the Unified Buffer Cache project.
 1.21  19-Sep-2000  fvdl Adapt for VOP_FSYNC parameter change.
 1.20  03-Aug-2000  thorpej Convert namei pathname buffer allocation to use the pool allocator.
 1.19  27-Jun-2000  mrg remove redundant vm includes.
 1.18  05-Apr-2000  phil branches: 1.18.4;
Quiet some printfs unless VERBOSE.
 1.17  30-Mar-2000  augustss Kill register declarations.
 1.16  31-Oct-1999  chs fix DEBUG printfs to compile.
 1.15  17-Oct-1999  cgd branches: 1.15.2; 1.15.4;
nuke RCS "Log" tags. They cause problems for third parties importing
our sources, and for NetBSD release engineering folks. (They've
been against the NetBSD coding style forever, but they crept in anyway.)
 1.14  16-Oct-1999  wrstuden In spec_close(), if we're not doing a non-blocking close and VXLOCK is
not set, unlock the vnode before calling the device's close routine and
relock it after it returns. tty close routines will sleep waiting for
buffers to drain, which won't happen often times as the other side needs
to grab the vnode lock first.

Make all unmount routines lock the device vnode before calling VOP_CLOSE().
 1.13  01-Oct-1999  soren branches: 1.13.2;
Account for widened v_usecount in struct vnode.
 1.12  18-Sep-1999  matt Make this compile on alpha again.
 1.11  03-Aug-1999  wrstuden Add support for fcntl(2) to generate VOP_FCNTL calls. Any fcntl
call with F_FSCTL set and F_SETFL calls generate calls to a new
fileop fo_fcntl. Add genfs_fcntl() and soo_fcntl() which return 0
for F_SETFL and EOPNOTSUPP otherwise. Have all leaf filesystems
use genfs_fcntl().

Reviewed by: thorpej
Tested by: wrstuden
 1.10  08-Jul-1999  wrstuden Bump osrelease to 1.4E. Add layerfs files, remove null_subr.c.

Update coda to new struct lock in struct vnode.

make fdescfs, kernfs, portalfs, and procfs actually lock their vnodes.
It's not that hard.

Make unionfs set v_vnlock = NULL so any overlayed fs will call its
VOP_LOCK.
 1.9  10-Dec-1998  rvb branches: 1.9.4; 1.9.6;
Commit a couple of old fixes
 1.8  09-Nov-1998  rvb Change the way unmounting happens to guarantee that the
client programs are allowed to finish up (coda_call is
forced to complete) and release their locks. Thus there
is a reasonable chance that the vflush implicit in the
unmount will not get hung on held locks.
 1.7  28-Sep-1998  rvb I want to distinguish from DEBUG printouts and CODA_VERBOSE printouts.
The latter are normal informational messages that are sometimes
interesting to view.
 1.6  26-Sep-1998  tv DIAGNOSTIC -> DEBUG for all non-panic messages. DIAGNOSTIC is only for
sanity checks and should not turn on any messages not already printed
without it.
 1.5  25-Sep-1998  rvb Conditionalize "stray" printouts under DIAGNOSTIC and DEBUG.
Make files compile if DEBUG is on (from Alan Barrett). Finally,
make coda an lkm.
 1.4  15-Sep-1998  rvb Final piece of rename cfs->coda
 1.3  12-Sep-1998  rvb Change cfs/CFS in symbols, strings and constants to coda/CODA
to avoid fs conflicts.
 1.2  08-Sep-1998  rvb Pass2 complete
 1.1  29-Aug-1998  rvb branches: 1.1.1;
Initial revision
 1.1.1.1  29-Aug-1998  rvb Very Preliminary Coda
 1.9.6.1  02-Aug-1999  thorpej Update from trunk.
 1.9.4.4  12-Feb-2000  he Apply patch (requested by he):
Fix a compile problem under CODA_VERBOSE caused by the v_usecount
widening.
 1.9.4.3  06-Feb-2000  he Apply patch (requested by christos):
Fix a compilation problem caused by the widening of v_usecount.
 1.9.4.2  18-Oct-1999  cgd pull up rev 1.14 from trunk (requested by wrstuden):
In spec_close(), call the device's close routine with the vnode
unlocked if the call might block. Force a non-blocking close if
VXLOCK is set. This eliminates a potential deadlock situation, and
should eliminate the dirty buffers on reboot issue.
 1.9.4.1  10-Oct-1999  cgd pull up rev 1.13 from trunk (requested by mycroft):
Fix potential overflow of v_usecount and v_writecount (and panics
resulting from this) by widening them to `long'. Mostly affects
systems where maxvnodes>=32768.
 1.13.2.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.15.4.1  15-Nov-1999  fvdl Sync with -current
 1.15.2.3  11-Feb-2001  bouyer Sync with HEAD.
 1.15.2.2  08-Dec-2000  bouyer Sync with HEAD.
 1.15.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.18.4.1  14-Dec-2000  he Pull up revision 1.21 (requested by fvdl):
Improve NFS performance, possibly with as much as 100% in
throughput. Please note: this implies a kernel interface change,
VOP_FSYNC gains two arguments.
 1.23.2.10  07-Jan-2003  thorpej Sync with HEAD.
 1.23.2.9  18-Oct-2002  nathanw Catch up to -current.
 1.23.2.8  01-Aug-2002  nathanw Catch up to -current.
 1.23.2.7  24-Jun-2002  nathanw Curproc->curlwp renaming.

Change uses of "curproc->l_proc" back to "curproc", which is more like the
original use. Bare uses of "curproc" are now "curlwp".

"curproc" is now #defined in proc.h as ((curlwp) ? (curlwp)->l_proc) : NULL)
so that it is always safe to reference curproc (*de*referencing curproc
is another story, but that's always been true).
 1.23.2.6  08-Jan-2002  nathanw Catch up to -current.
 1.23.2.5  14-Nov-2001  nathanw Catch up to -current.
 1.23.2.4  24-Aug-2001  nathanw A few files and lwp/proc conversions I missed in the last big update.
GENERIC runs again.
 1.23.2.3  24-Aug-2001  nathanw Catch up with -current.
 1.23.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.23.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.25.2.4  10-Oct-2002  jdolecek sync kqueue with -current; this includes merge of gehenna-devsw branch,
merge of i386 MP branch, and part of autoconf rototil work
 1.25.2.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.25.2.2  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.25.2.1  03-Aug-2001  lukem update to -current
 1.26.2.3  01-Oct-2001  fvdl Catch up with -current.
 1.26.2.2  26-Sep-2001  fvdl * add a VCLONED vnode flag that indicates a vnode representing a cloned
device.
* rename REVOKEALL to REVOKEALIAS, and add a REVOKECLONE flag, to pass
to VOP_REVOKE
* the revoke system call will revoke all aliases, as before, but not the
clones
* vdevgone is called when detaching a device, so make it use REVOKECLONE
to get rid of all clones as well
* clean up all uses of VOP_OPEN wrt. locking.
* add a few VOPS to spec_vnops that need to do something when it's a
clone vnode (access and getattr)
* add a copy of the vnode vattr structure of the original 'master' vnode
to the specinfo of a cloned vnode. could possibly redirect getattr to
the 'master' vnode, but this has issues with revoke
* add a vdev_reassignvp function that disassociates a vnode from its
original device, and reassociates it with the specified dev_t. to be
used by cloning devices only, in case a new minor is allocated.
* change all direct references in drivers to v_devcookie and v_rdev
to vdev_privdata(vp) and vdev_rdev(vp). for diagnostic purposes
when debugging race conditions that still exist wrt. locking and
revoking vnodes.
* make the locking state of a vnode consistent when passed to
d_open and d_close (unlocked). locked would be better, but has
some deadlock issues
 1.26.2.1  18-Sep-2001  fvdl Various changes to make cloning devices possible:

* Add an extra argument (struct vnode **) to VOP_OPEN. If it is
not NULL, specfs will create a cloned (aliased) vnode during
the call, and return it there. The caller should release and
unlock the original vnode if a new vnode was returned. The
new vnode is returned locked.

* Add a flag field to the cdevsw and bdevsw structures.
DF_CLONING indicates that it wants a new vnode for each
open (XXX is there a better way? devprop?)

* If a device is cloning, always call the close entry
point for a VOP_CLOSE.


Also, rewrite cons.c to do the right thing with vnodes. Use VOPs
rather then direct device entry calls. Suggested by mycroft@

Light to moderate testing done an i386 system (arch doesn't matter
though, these are MI changes).
 1.30.8.1  29-Aug-2002  gehenna catch up with -current.
 1.36.2.8  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.36.2.7  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.36.2.6  24-Oct-2004  skrll coda_grab_vnode no longer requires a struct lwp * argument.
 1.36.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.36.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.36.2.3  24-Aug-2004  skrll Undo part of the ktrace/lwp changes. In particular:
* Remove the "lwp *" argument that was added to vget(). Turns out
that nothing actually used it!
* Remove the "lwp *" arguments that were added to VFS_ROOT(), VFS_VGET(),
and VFS_FHTOVP(); all they did was pass it to vget() (which, as noted
above, didn't use it).
* Remove all of the "lwp *" arguments to internal functions that were added
just to appease the above.
 1.36.2.2  03-Aug-2004  skrll Sync with HEAD
 1.36.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.38.2.1  27-Jun-2004  jdc Pull up revision 1.39 (requested by petrov in ticket #550).

Fix coda symlink vnodeops. Provided by Greg Troxel. PR kern/25963.
 1.39.6.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.39.4.1  29-Apr-2005  kent sync with -current
 1.41.2.6  04-Feb-2008  yamt sync with head.
 1.41.2.5  21-Jan-2008  yamt sync with head
 1.41.2.4  07-Dec-2007  yamt sync with head
 1.41.2.3  03-Sep-2007  yamt sync with head.
 1.41.2.2  30-Dec-2006  yamt sync with head.
 1.41.2.1  21-Jun-2006  yamt sync with head.
 1.43.2.1  20-Oct-2005  yamt adapt coda.
 1.44.2.2  18-Nov-2005  yamt - associate read-ahead context to vnode, rather than file.
- revert VOP_READ prototype.
 1.44.2.1  15-Nov-2005  yamt - adapt to the new prototype of VOP_READ.
- adapt ext2fs and union.
 1.45.2.2  18-Feb-2006  yamt adapt the rest of MI code.
 1.45.2.1  15-Jan-2006  yamt sync with head.
 1.46.4.2  01-Jun-2006  kardel Sync with head.
 1.46.4.1  22-Apr-2006  simonb Sync with head.
 1.46.2.1  09-Sep-2006  rpaulo sync with head
 1.47.6.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.47.4.3  06-May-2006  christos - Move kauth_cred_t declaration to <sys/types.h>
- Cleanup struct ucred; forward declarations that are unused.
- Don't include <sys/kauth.h> in any header, but include it in the c files
that need it.

Approved by core.
 1.47.4.2  19-Apr-2006  elad sync with head.
 1.47.4.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.47.2.2  11-Aug-2006  yamt sync with head
 1.47.2.1  24-May-2006  yamt sync with head.
 1.50.8.4  04-Aug-2010  bouyer Pull up following revision(s) (requested by christos in ticket #1400):
sys/coda/coda_venus.c: revision 1.28
sys/coda/coda_vnops.c: revision 1.76
sys/coda/coda.h: revision 1.16
Correct incomplete size checks for the coda ioctls. From Dan Rosenberg.
 1.50.8.3  06-Jun-2007  bouyer branches: 1.50.8.3.4;
Apply patch, requested by perseant as part of ticket #703:
sys/coda/coda_vnops.c patch
make coda build again.
 1.50.8.2  13-May-2007  pavel branches: 1.50.8.2.2;
Pull up following revision(s) (requested by gdt in ticket #643):
sys/coda/coda_vnops.c: revision 1.53-1.60 via patch
Major changes to coda vnode operations to restore stability and
functionality. Make coda_lookup conform to the vnode locking protocol
in the IS_DOTDOT case. Fix getpages/putpages to use container vnode
properly so that the uvm code does not fail an assertion. Clean up
handling of pnbuf in light of current rules. Massive update of comments
and general cleanup.
 1.50.8.1  17-Feb-2007  tron Apply patch (requested by chs in ticket #422):
- Fix various deadlock problems with nullfs and unionfs.
- Speed up path lookups by upto 25%.
 1.50.8.3.4.1  04-Aug-2010  bouyer Pull up following revision(s) (requested by christos in ticket #1400):
sys/coda/coda_venus.c: revision 1.28
sys/coda/coda_vnops.c: revision 1.76
sys/coda/coda.h: revision 1.16
Correct incomplete size checks for the coda ioctls. From Dan Rosenberg.
 1.50.8.2.2.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.50.6.1  10-Dec-2006  yamt sync with head.
 1.50.4.1  12-Jan-2007  ad Sync with head.
 1.51.2.3  07-May-2007  yamt sync with head.
 1.51.2.2  15-Apr-2007  yamt sync with head.
 1.51.2.1  12-Mar-2007  rmind Sync with HEAD.
 1.52.4.1  11-Jul-2007  mjf Sync with head.
 1.52.2.5  16-Sep-2007  ad Checkpoint work in progress on the vnode lifecycle and reference counting
stuff. This makes it work properly without kernel_lock and fixes a few
quite old bugs. See vfs_subr.c 1.283.2.17 for details.
 1.52.2.4  20-Aug-2007  ad Sync with HEAD.
 1.52.2.3  15-Jul-2007  ad Sync with head.
 1.52.2.2  08-Jun-2007  ad Sync with head.
 1.52.2.1  05-Apr-2007  ad Compile fixes.
 1.61.2.1  15-Aug-2007  skrll Sync with HEAD.
 1.62.14.2  23-Jul-2007  pooka Initialize size and/or writesize when creating a vnode.
 1.62.14.1  23-Jul-2007  pooka file coda_vnops.c was added on branch matt-mips64 on 2007-07-23 11:27:47 +0000
 1.62.12.3  18-Feb-2008  mjf Sync with HEAD.
 1.62.12.2  27-Dec-2007  mjf Sync with HEAD.
 1.62.12.1  08-Dec-2007  mjf Sync with HEAD.
 1.62.6.2  23-Mar-2008  matt sync with HEAD
 1.62.6.1  09-Jan-2008  matt sync with HEAD
 1.62.4.2  09-Dec-2007  jmcneill Sync with HEAD.
 1.62.4.1  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.63.2.2  26-Dec-2007  ad Sync with head.
 1.63.2.1  04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.64.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.68.28.1  20-May-2011  matt bring matt-nb5-mips64 up to date with netbsd-5-1-RELEASE (except compat).
 1.68.26.1  25-Aug-2010  snj Pull up following revision(s) (requested by christos in ticket #1431):
sys/coda/coda.h: revision 1.16
sys/coda/coda_venus.c: revision 1.28
sys/coda/coda_vnops.c: revision 1.76
Correct incomplete size checks for the coda ioctls. From Dan Rosenberg.
 1.68.22.1  25-Aug-2010  snj Pull up following revision(s) (requested by christos in ticket #1431):
sys/coda/coda.h: revision 1.16
sys/coda/coda_venus.c: revision 1.28
sys/coda/coda_vnops.c: revision 1.76
Correct incomplete size checks for the coda ioctls. From Dan Rosenberg.
 1.68.20.1  19-Jan-2009  skrll Sync with HEAD.
 1.68.12.4  11-Aug-2010  yamt sync with head.
 1.68.12.3  11-Mar-2010  yamt sync with head
 1.68.12.2  18-Jul-2009  yamt sync with head.
 1.68.12.1  04-May-2009  yamt sync with head.
 1.68.8.2  30-Dec-2008  christos dev_t format.
 1.68.8.1  29-Mar-2008  christos Welcome to the time_t=long long dev_t=uint64_t branch.
 1.68.6.1  17-Jan-2009  mjf Sync with HEAD.
 1.69.2.1  23-Jul-2009  jym Sync with HEAD.
 1.71.4.5  31-May-2011  rmind sync with head
 1.71.4.4  19-May-2011  rmind Implement sharing of vnode_t::v_interlock amongst vnodes:
- Lock is shared amongst UVM objects using uvm_obj_setlock() or getnewvnode().
- Adjust vnode cache to handle unsharing, add VI_LOCKSHARE flag for that.
- Use sharing in tmpfs and layerfs for underlying object.
- Simplify locking in ubc_fault().
- Sprinkle some asserts.

Discussed with ad@.
 1.71.4.3  05-Mar-2011  rmind sync with head
 1.71.4.2  03-Jul-2010  rmind sync with head
 1.71.4.1  16-Mar-2010  rmind Change struct uvm_object::vmobjlock to be dynamically allocated with
mutex_obj_alloc(). It allows us to share the locks among UVM objects.
 1.71.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.78.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.79.2.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.81.6.2  02-Jun-2012  mrg sync to latest -current.
 1.81.6.1  29-Apr-2012  mrg sync to latest -current.
 1.81.2.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.81.2.2  30-Oct-2012  yamt sync with head
 1.81.2.1  23-May-2012  yamt sync with head.
 1.90.4.1  18-May-2014  rmind sync with head
 1.90.2.2  03-Dec-2017  jdolecek update from HEAD
 1.90.2.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.96.2.1  10-Aug-2014  tls Rebase.
 1.98.2.4  28-Aug-2017  skrll Sync with HEAD
 1.98.2.3  05-Oct-2016  skrll Sync with HEAD
 1.98.2.2  06-Jun-2015  skrll Sync with HEAD
 1.98.2.1  06-Apr-2015  skrll Sync with HEAD
 1.102.2.1  26-Apr-2017  pgoyette Sync with HEAD
 1.103.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.106.10.3  21-Apr-2020  martin Sync with HEAD
 1.106.10.2  08-Apr-2020  martin Merge changes from current as of 20200406
 1.106.10.1  10-Jun-2019  christos Sync with HEAD
 1.106.8.1  26-Nov-2018  pgoyette Sync with HEAD, resolve a couple of conflicts
 1.106.2.1  14-Nov-2020  martin Pull up following revision(s) (requested by hannken in ticket #1622):

sys/coda/coda_vnops.c: revision 1.114 (patch)
sys/coda/coda.h: revision 1.21 (patch)

Rewrite coda_readdir() to directly process the container file.

Passing this operation down to the file system holding the container
cannot work for anything but UFS and UFS doesn't allow reading
directory from a plain file since ~2015.

Fixes PR kern/55775 Coda client, its in-kernel part, opens wrong files ...
 1.107.6.2  29-Feb-2020  ad Sync with head.
 1.107.6.1  17-Jan-2020  ad Sync with head.
 1.107.4.1  14-Nov-2020  martin Pull up following revision(s) (requested by hannken in ticket #1131):

sys/coda/coda_vnops.c: revision 1.114 (patch)
sys/coda/coda.h: revision 1.21 (patch)

Rewrite coda_readdir() to directly process the container file.

Passing this operation down to the file system holding the container
cannot work for anything but UFS and UFS doesn't allow reading
directory from a plain file since ~2015.

Fixes PR kern/55775 Coda client, its in-kernel part, opens wrong files ...
 1.110.4.1  20-Apr-2020  bouyer Sync with HEAD
 1.112.2.1  14-Dec-2020  thorpej Sync w/ HEAD.
 1.114.4.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed