Home | History | Annotate | Download | only in filecorefs
History log of /src/sys/fs/filecorefs/filecore_vnops.c
RevisionDateAuthorComments
 1.50  27-Mar-2022  christos dedup the eofs link/symlink methods
 1.49  18-Jul-2021  dholland Abolish all the silly indirection macros for initializing vnode ops tables.

These are things of the form #define foofs_op genfs_op, or #define
foofs_op genfs_eopnotsupp, or similar. They serve no purpose besides
obfuscation, and have gotten cutpasted all over everywhere.
 1.48  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.47  27-Jun-2020  christos branches: 1.47.6;
Introduce genfs_pathconf() and use it for the default case in all filesystems.
 1.46  16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.45  23-Apr-2020  ad PR kern/54759 (vm.ubc_direct deadlock when read()/write() into mapping of itself)

- Add new flag UBC_ISMAPPED which tells ubc_uiomove() the object is mmap()ed
somewhere. Use it to decide whether to do direct-mapped copy, rather than
poking around directly in the vnode in ubc_uiomove(), which is ugly and
doesn't work for tmpfs. It would be nicer to contain all this in UVM but
the filesystem provides the needed locking here (VV_MAPPED) and to
reinvent that would suck more.

- Rename UBC_UNMAP_FLAG() to UBC_VNODE_FLAGS(). Pass in UBC_ISMAPPED where
appropriate.
 1.44  20-Apr-2015  riastradh branches: 1.44.28;
Make VOP_LINK return directory still locked and referenced.

Ride 7.99.10 bump.
 1.43  28-Mar-2015  maxv Remove the 'cred' argument from bread(). Remove a now unused var in
ffs_snapshot.c. Update the man page accordingly.

ok hannken@
 1.42  25-Jul-2014  dholland branches: 1.42.4;
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.41  23-Jan-2014  hannken branches: 1.41.2;
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.40  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.39  20-Oct-2013  christos remove unused
 1.38  23-Jun-2013  dholland branches: 1.38.2;
Stick ffs_, ext2_, chfs_, filecore_, cd9660_, or mfs_ in front of
the following symbols so as to disambiguate fully. (Christos already
did the lfs ones.)

lblkno
lblktosize
lfragtosize
numfrags
blkroundup
fragroundup
 1.37  19-Jun-2013  dholland blkoff() -> filecore_blkoff()
blksize() -> filecore_blksize()
 1.36  18-Mar-2013  plunky C99 section 6.7.2.3 (Tags) Note 3 states that:

A type specifier of the form

enum identifier

without an enumerator list shall only appear after the type it
specifies is complete.

which means that we cannot pass an "enum vtype" argument to
kauth_access_action() without fully specifying the type first.
Unfortunately there is a complicated include file loop which
makes that difficult, so convert this minimal function into a
macro (and capitalize it).

(ok elad@)
 1.35  20-Dec-2012  hannken Change bread() and breadn() to never return a buffer on
error and modify all callers to not brelse() on error.

Welcome to 6.99.16

PR kern/46282 (6.0_BETA crash: msdosfs_bmap -> pcbmap -> bread -> bio_doread)
 1.34  13-Mar-2012  elad branches: 1.34.2;
Replace the remaining KAUTH_GENERIC_ISSUSER authorization calls with
something meaningful. All relevant documentation has been updated or
written.

Most of these changes were brought up in the following messages:

http://mail-index.netbsd.org/tech-kern/2012/01/18/msg012490.html
http://mail-index.netbsd.org/tech-kern/2012/01/19/msg012502.html
http://mail-index.netbsd.org/tech-kern/2012/02/17/msg012728.html

Thanks to christos, manu, njoly, and jmmv for input.

Huge thanks to pgoyette for spinning these changes through some build
cycles and ATF.
 1.33  23-May-2011  rmind branches: 1.33.4; 1.33.8;
Convert some simple_lock(9) uses to mutex(9) and malloc(9) to kmem(9).
 1.32  03-Jul-2009  elad branches: 1.32.4; 1.32.6;
Where possible, extract the file-system's access() routine to two internal
functions: the first checking if the operation is possible (regardless of
permissions), the second checking file-system permissions, ACLs, etc.

Mailing list reference:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005311.html
 1.31  23-Jun-2009  elad Move the implementation of vaccess() to genfs_can_access(), in line with
the other routines of the same spirit.

Adjust file-system code to use it.

Keep vaccess() for KPI compatibility and to keep element of least
surprise. A "diagnostic" message warning that vaccess() is deprecated will
be printed when it's used (obviously, only in DIAGNOSTIC kernels).

No objections on tech-kern@:

http://mail-index.netbsd.org/tech-kern/2009/06/21/msg005310.html
 1.30  14-Mar-2009  dsl ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
 1.29  14-Mar-2009  dsl Remove all the __P() from sys (excluding sys/dist)
Diff checked with grep and MK1 eyeball.
i386 and amd64 GENERIC and sys still build.
 1.28  26-Nov-2008  pooka branches: 1.28.4;
Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.
 1.27  16-May-2008  hannken branches: 1.27.4; 1.27.6;
Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write. Call fscow_run() with valid data where possible.

The LP_UFSCOW hack is no longer needed to protect ffs_copyonwrite() against
endless recursion.

- Add a flag B_MODIFY to bread(), breada() and breadn(). If set the caller
intends to modify the buffer returned.

- Always run copy-on-write on buffers returned from ffs_balloc().

- Add new function ffs_getblk() that gets a buffer, assigns a new blkno,
may clear the buffer and runs copy-on-write. Process possible errors
from getblk() or fscow_run(). Part of PR kern/38664.

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
 1.26  30-Apr-2008  ad branches: 1.26.2;
Make various bits of debug code compile again.
 1.25  25-Jan-2008  ad branches: 1.25.6; 1.25.8; 1.25.10;
Remove VOP_LEASE. Discussed on tech-kern.
 1.24  26-Nov-2007  pooka 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.23  08-Oct-2007  ad branches: 1.23.4;
Merge brelse() changes from the vmlocking branch.
 1.22  24-Sep-2007  rumble Avoid stack allocation of large dirent structures in foo_readdir().
 1.21  29-Jul-2007  rumble branches: 1.21.4; 1.21.6; 1.21.8; 1.21.10;
Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.
 1.20  29-Jul-2007  ad It's not a good idea for device drivers to modify b_flags, as they don't
need to understand the locking around that field. Instead of setting
B_ERROR, set b_error instead. b_error is 'owned' by whoever completes
the I/O request.
 1.19  04-Mar-2007  jnemeth branches: 1.19.2; 1.19.10;
yet more caddr_t -> void * fallout
 1.18  15-May-2006  christos branches: 1.18.14;
More kauth fallout.
 1.17  14-May-2006  elad integrate kauth.
 1.16  11-Dec-2005  christos branches: 1.16.4; 1.16.6; 1.16.8; 1.16.10; 1.16.12;
merge ktrace-lwp.
 1.15  29-Nov-2005  yamt merge yamt-readahead branch.
 1.14  02-Nov-2005  yamt branches: 1.14.2;
merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE
 1.13  19-Aug-2005  christos branches: 1.13.2;
namlen is u_int16_t now.
 1.12  19-Aug-2005  christos Add an _ to DIRENT_SIZE
 1.11  09-Jan-2005  chs branches: 1.11.10;
adjust the UBC mapping code to support non-vnode uvm_objects.
this means we can no longer look at the vnode size to determine how many
pages to request in a fault, which is good since for NFS the size can change
out from under us on the server anyway. there's also a new flag UBC_UNMAP
for ubc_release(), so that the file system code can make the decision about
whether to cache mappings for files being used as executables.
 1.10  13-Sep-2004  jdolecek set mp->mnt_stat.f_namemax on filesystem mount for use by statvfs, and use
the value for also pathconf(_PC_NAME_MAX) to keep the two in sync
 1.9  12-May-2004  jrf caddr_t -> void * and removal of some more casts.
 1.8  26-Jan-2004  hannken Fix xxx_strategy() to use the vnode arg instead of bp->b_vp.
 1.7  25-Jan-2004  hannken Make VOP_STRATEGY(bp) a real VOP as discussed on tech-kern.

VOP_STRATEGY(bp) is replaced by one of two new functions:

- VOP_STRATEGY(vp, bp) Call the strategy routine of vp for bp.
- DEV_STRATEGY(bp) Call the d_strategy routine of bp->b_dev for bp.

DEV_STRATEGY(bp) is used only for block-to-block device situations.
 1.6  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.5  06-Jul-2003  rearnsha Fix a build failure when NFSSERVER. Unconditionally define
filecore_lease_check to genfs_lease_check (was previously lease_check
which isn't defined anywhere). No need to include opt_nfsserver.h
any more.
 1.4  26-Jun-2003  itojun branches: 1.4.2;
strlcpy
 1.3  23-Jun-2003  martin #ifdef _KERNEL_OPT police
 1.2  23-Jun-2003  martin Make sure to include opt_foo.h if a defflag option FOO is used.
 1.1  23-Dec-2002  jdolecek branches: 1.1.2;
move filecorefs code from sys/filecorefs to sys/fs/filecorefs
 1.1.2.2  29-Dec-2002  thorpej With with HEAD.
 1.1.2.1  23-Dec-2002  thorpej file filecore_vnops.c was added on branch nathanw_sa on 2002-12-29 19:55:53 +0000
 1.4.2.9  11-Dec-2005  christos Sync with head.
 1.4.2.8  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.4.2.7  17-Jan-2005  skrll Sync with HEAD.
 1.4.2.6  27-Oct-2004  skrll Fix various comments that describe the argument structures
 1.4.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.4.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.4.2.3  12-Aug-2004  skrll Sync with HEAD.
 1.4.2.2  03-Aug-2004  skrll Sync with HEAD
 1.4.2.1  03-Jul-2003  wrstuden LWP-ify filecore fs.

Note: These changes suffer from the same cnp->cn_lwp issue noted for
ufs. They will need to get fixed at the same time as ufs. The fix is to
add struct lwp * as a parameter to some VOPs.

Also, some how or another, this code missed out on the changes to use
genfs_lease_check, and had a dangling reference to lease_check().
Given that genfs_lease_check has been around since 1998, I'm puzzled as
to what's been going on. Noticed in a compild of acorn32/GENERIC.
 1.11.10.5  04-Feb-2008  yamt sync with head.
 1.11.10.4  07-Dec-2007  yamt sync with head
 1.11.10.3  27-Oct-2007  yamt sync with head.
 1.11.10.2  03-Sep-2007  yamt sync with head.
 1.11.10.1  21-Jun-2006  yamt sync with head.
 1.13.2.1  20-Oct-2005  yamt adapt filecore.
 1.14.2.3  19-Nov-2005  yamt - as read-ahead context is per-vnode now,
there are less reasons to make VOP_READ call uvm_ra_request explicitly.
move it to pager (uvn_get) so that it can handle accesses via mmap as well.
- pass advice to pager via ubc.
- tweak DPRINTF.

XXX can be disturbed by PGO_LOCKED.

XXX it's controversial where it should be done.
(uvm_fault, uvn_get or genfs_getpages.)
 1.14.2.2  18-Nov-2005  yamt - associate read-ahead context to vnode, rather than file.
- revert VOP_READ prototype.
 1.14.2.1  15-Nov-2005  yamt adapt the rest of filesystems which use genfs_getpages.
 1.16.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.16.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.16.8.1  24-May-2006  yamt sync with head.
 1.16.6.1  01-Jun-2006  kardel Sync with head.
 1.16.4.1  09-Sep-2006  rpaulo sync with head
 1.18.14.1  12-Mar-2007  rmind Sync with HEAD.
 1.19.10.1  15-Aug-2007  skrll Sync with HEAD.
 1.19.2.3  09-Oct-2007  ad Sync with head.
 1.19.2.2  20-Aug-2007  ad Sync with HEAD.
 1.19.2.1  19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.21.10.2  29-Jul-2007  rumble Use _DIRENT_MINSIZE when determining the number of NFS cookies to allocate,
rather than hard-coding 16.
 1.21.10.1  29-Jul-2007  rumble file filecore_vnops.c was added on branch matt-mips64 on 2007-07-29 21:17:42 +0000
 1.21.8.2  14-Oct-2007  yamt sync with head.
 1.21.8.1  06-Oct-2007  yamt sync with head.
 1.21.6.3  23-Mar-2008  matt sync with HEAD
 1.21.6.2  09-Jan-2008  matt sync with HEAD
 1.21.6.1  06-Nov-2007  matt sync with HEAD
 1.21.4.3  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.21.4.2  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.21.4.1  02-Oct-2007  joerg Sync with HEAD.
 1.23.4.2  18-Feb-2008  mjf Sync with HEAD.
 1.23.4.1  08-Dec-2007  mjf Sync with HEAD.
 1.25.10.3  18-Jul-2009  yamt sync with head.
 1.25.10.2  04-May-2009  yamt sync with head.
 1.25.10.1  16-May-2008  yamt sync with head.
 1.25.8.1  18-May-2008  yamt sync with head.
 1.25.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.25.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.26.2.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.27.6.2  28-Apr-2009  skrll Sync with HEAD.
 1.27.6.1  19-Jan-2009  skrll Sync with HEAD.
 1.27.4.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.28.4.2  23-Jul-2009  jym Sync with HEAD.
 1.28.4.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.32.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.32.4.1  31-May-2011  rmind sync with head
 1.33.8.1  05-Apr-2012  mrg sync to latest -current.
 1.33.4.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.33.4.2  23-Jan-2013  yamt sync with head
 1.33.4.1  17-Apr-2012  yamt sync with head
 1.34.2.4  03-Dec-2017  jdolecek update from HEAD
 1.34.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.34.2.2  23-Jun-2013  tls resync from head
 1.34.2.1  25-Feb-2013  tls resync with head
 1.38.2.1  18-May-2014  rmind sync with head
 1.41.2.1  10-Aug-2014  tls Rebase.
 1.42.4.2  06-Jun-2015  skrll Sync with HEAD
 1.42.4.1  06-Apr-2015  skrll Sync with HEAD
 1.44.28.1  25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.47.6.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed