Home | History | Annotate | Download | only in adosfs
History log of /src/sys/fs/adosfs/advnops.c
RevisionDateAuthorComments
 1.60  13-May-2024  msaitoh s/contigous/contiguous/ in comment.
 1.59  04-Apr-2022  andvar fix various typos, mainly in comments.
 1.58  27-Mar-2022  christos dedup the eofs link/symlink methods
 1.57  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.56  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.55  27-Jun-2020  christos branches: 1.55.6;
Introduce genfs_pathconf() and use it for the default case in all filesystems.
 1.54  16-May-2020  christos Add ACL support for FFS. From FreeBSD.
 1.53  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.52  23-Apr-2020  jdolecek fix obvious typo in error handling - buf error should go to b_error
 1.51  17-Jan-2020  ad branches: 1.51.4;
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.50  26-May-2017  riastradh branches: 1.50.10; 1.50.16;
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.49  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.48  20-Aug-2016  hannken branches: 1.48.2;
Remove now obsolete operation vcache_remove().

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

Ride 7.99.10 bump.
 1.46  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.45  05-Aug-2014  hannken branches: 1.45.4;
Change adosfs from hashlist to vcache.
- point ap->block to real file header block for hard links.
 1.44  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.43  23-Jan-2014  hannken branches: 1.43.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.42  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.41  18-Mar-2013  plunky branches: 1.41.6;
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.40  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.39  13-Mar-2012  elad branches: 1.39.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.38  19-May-2011  rmind branches: 1.38.4; 1.38.8;
Remove cache_purge(9) calls from reclamation routines in the file systems,
as vclean(9) performs it for us since Lite2 merge.
 1.37  24-Jun-2010  hannken branches: 1.37.2;
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.36  30-Aug-2009  phx branches: 1.36.2; 1.36.4;
Fixed fatal warnings with ADOSFS_DIAGNOSTIC.
 1.35  03-Jul-2009  elad 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.34  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.33  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.32  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.31  16-Dec-2008  pooka branches: 1.31.2;
The great QUOTA purge of '08: get rid of those #ifdef QUOTA and
#include "opt_quota.h" which do exactly nothing. Speeds up kernel
compilation by 1.375*10^-20001 seconds. But leave the most moxious
comment in msdosfs_vfsops untouched.
 1.30  26-Nov-2008  pooka Rototill all remaining file systems to use ubc_uiomove() instead
of the ubc_alloc() - uiomove() - ubc_release() dance.
 1.29  16-May-2008  hannken branches: 1.29.4; 1.29.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.28  25-Jan-2008  ad branches: 1.28.6; 1.28.8; 1.28.10; 1.28.12;
Remove VOP_LEASE. Discussed on tech-kern.
 1.27  02-Jan-2008  ad Merge vmlocking2 to head.
 1.26  26-Nov-2007  pooka branches: 1.26.2; 1.26.6;
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.25  08-Oct-2007  ad branches: 1.25.4;
Merge brelse() changes from the vmlocking branch.
 1.24  29-Jul-2007  ad branches: 1.24.4; 1.24.6; 1.24.8; 1.24.10;
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.23  04-Mar-2007  yamt branches: 1.23.2; 1.23.10;
fix fallout from caddr_t changes.
 1.22  20-Feb-2007  ad Call genfs_node_destroy() where appropriate.
 1.21  23-Sep-2006  aymeric branches: 1.21.4;
fix adosfs_readdir() so that we can list directories on AmigaOS filesystems.
. get rid of struct adirent which didn't match struct dirent anymore
. fix cookies, move all the code handling them to the end of the function

Includes many minor changes to the code of this function.
 1.20  15-May-2006  christos branches: 1.20.8; 1.20.10;
More kauth fallout.
 1.19  14-May-2006  elad integrate kauth.
 1.18  11-Dec-2005  christos branches: 1.18.4; 1.18.6; 1.18.8; 1.18.10; 1.18.12;
merge ktrace-lwp.
 1.17  29-Nov-2005  yamt merge yamt-readahead branch.
 1.16  02-Nov-2005  yamt branches: 1.16.2;
merge yamt-vop branch. remove following VOPs.

VOP_BLKATOFF
VOP_VALLOC
VOP_BALLOC
VOP_REALLOCBLKS
VOP_VFREE
VOP_TRUNCATE
VOP_UPDATE
 1.15  26-Feb-2005  perry branches: 1.15.4; 1.15.6;
nuke trailing whitespace
 1.14  09-Jan-2005  chs branches: 1.14.2; 1.14.4;
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.13  14-Sep-2004  jdolecek rename 'sp' variable to 'ap' in adosfs_pathconf(), so that it matches other
filesystems and avoid silly pastos
 1.12  14-Sep-2004  skrll Fix typos/pastos.
 1.11  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.10  04-May-2004  jrf Remove caddr_t inlines. Approved by christos@NetBSD.org.
 1.9  21-Apr-2004  christos Replace the statfs() family of system calls with statvfs().
Retain binary compatibility.
 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  29-Jun-2003  fvdl branches: 1.6.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.5  29-Jun-2003  thorpej Fix problems with the ktrace/lwp changes.
 1.4  27-Jan-2003  lonewolf Fix compiler warnings after 64bit daddr_t change.
 1.3  24-Jan-2003  fvdl Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
 1.2  09-Jan-2003  lonewolf Don't scale file block numbers. Fixes mmap() and UBCified read() problems.
Reviewed by Ignatios.
 1.1  23-Dec-2002  jdolecek branches: 1.1.2;
move adosfs files from sys/adosfs to sys/fs/adosfs
 1.1.2.3  15-Jan-2003  thorpej Sync with HEAD.
 1.1.2.2  29-Dec-2002  thorpej With with HEAD.
 1.1.2.1  23-Dec-2002  thorpej file advnops.c was added on branch nathanw_sa on 2002-12-29 19:55:29 +0000
 1.6.2.10  11-Dec-2005  christos Sync with head.
 1.6.2.9  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.6.2.8  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.6.2.7  17-Jan-2005  skrll Sync with HEAD.
 1.6.2.6  27-Oct-2004  skrll Fix various comments that describe the argument structures
 1.6.2.5  21-Sep-2004  skrll Fix the sync with head I botched.
 1.6.2.4  18-Sep-2004  skrll Sync with HEAD.
 1.6.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.6.2.2  03-Aug-2004  skrll Sync with HEAD
 1.6.2.1  03-Jul-2003  wrstuden LWP-ify adosfs. Also remove unused variable size from adosfs_mount().

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.
 1.14.4.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.14.2.1  29-Apr-2005  kent sync with -current
 1.15.6.1  20-Oct-2005  yamt adapt adosfs.
 1.15.4.8  04-Feb-2008  yamt sync with head.
 1.15.4.7  21-Jan-2008  yamt sync with head
 1.15.4.6  07-Dec-2007  yamt sync with head
 1.15.4.5  27-Oct-2007  yamt sync with head.
 1.15.4.4  03-Sep-2007  yamt sync with head.
 1.15.4.3  26-Feb-2007  yamt sync with head.
 1.15.4.2  30-Dec-2006  yamt sync with head.
 1.15.4.1  21-Jun-2006  yamt sync with head.
 1.16.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.16.2.2  18-Nov-2005  yamt - associate read-ahead context to vnode, rather than file.
- revert VOP_READ prototype.
 1.16.2.1  15-Nov-2005  yamt adapt the rest of filesystems which use genfs_getpages.
 1.18.12.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.18.10.1  08-Mar-2006  elad Adapt to kernel authorization KPI.
 1.18.8.1  24-May-2006  yamt sync with head.
 1.18.6.1  01-Jun-2006  kardel Sync with head.
 1.18.4.1  09-Sep-2006  rpaulo sync with head
 1.20.10.1  22-Oct-2006  yamt sync with head
 1.20.8.1  18-Nov-2006  ad Sync with head.
 1.21.4.2  12-Mar-2007  rmind Sync with HEAD.
 1.21.4.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.23.10.1  15-Aug-2007  skrll Sync with HEAD.
 1.23.2.3  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.23.2.2  20-Aug-2007  ad Sync with HEAD.
 1.23.2.1  19-Aug-2007  ad - Back out the biodone() changes.
- Eliminate B_ERROR (from HEAD).
 1.24.10.2  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.24.10.1  29-Jul-2007  ad file advnops.c was added on branch matt-mips64 on 2007-07-29 12:15:46 +0000
 1.24.8.1  14-Oct-2007  yamt sync with head.
 1.24.6.3  23-Mar-2008  matt sync with HEAD
 1.24.6.2  09-Jan-2008  matt sync with HEAD
 1.24.6.1  06-Nov-2007  matt sync with HEAD
 1.24.4.2  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.24.4.1  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.25.4.2  18-Feb-2008  mjf Sync with HEAD.
 1.25.4.1  08-Dec-2007  mjf Sync with HEAD.
 1.26.6.1  02-Jan-2008  bouyer Sync with HEAD
 1.26.2.1  04-Dec-2007  ad Pull the vmlocking changes into a new branch.
 1.28.12.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.28.10.4  11-Aug-2010  yamt sync with head.
 1.28.10.3  16-Sep-2009  yamt sync with head
 1.28.10.2  18-Jul-2009  yamt sync with head.
 1.28.10.1  04-May-2009  yamt sync with head.
 1.28.8.1  18-May-2008  yamt sync with head.
 1.28.6.2  17-Jan-2009  mjf Sync with HEAD.
 1.28.6.1  02-Jun-2008  mjf Sync with HEAD.
 1.29.6.2  28-Apr-2009  skrll Sync with HEAD.
 1.29.6.1  19-Jan-2009  skrll Sync with HEAD.
 1.29.4.1  13-Dec-2008  haad Update haad-dm branch to haad-dm-base2.
 1.31.2.2  23-Jul-2009  jym Sync with HEAD.
 1.31.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.36.4.2  31-May-2011  rmind sync with head
 1.36.4.1  03-Jul-2010  rmind sync with head
 1.36.2.1  17-Aug-2010  uebayasi Sync with HEAD.
 1.37.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.38.8.1  05-Apr-2012  mrg sync to latest -current.
 1.38.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.38.4.2  23-Jan-2013  yamt sync with head
 1.38.4.1  17-Apr-2012  yamt sync with head
 1.39.2.4  03-Dec-2017  jdolecek update from HEAD
 1.39.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.39.2.2  23-Jun-2013  tls resync from head
 1.39.2.1  25-Feb-2013  tls resync with head
 1.41.6.1  18-May-2014  rmind sync with head
 1.43.2.1  10-Aug-2014  tls Rebase.
 1.45.4.4  28-Aug-2017  skrll Sync with HEAD
 1.45.4.3  05-Oct-2016  skrll Sync with HEAD
 1.45.4.2  06-Jun-2015  skrll Sync with HEAD
 1.45.4.1  06-Apr-2015  skrll Sync with HEAD
 1.47.2.1  26-Apr-2017  pgoyette Sync with HEAD
 1.48.2.1  21-Apr-2017  bouyer Sync with HEAD
 1.50.16.1  17-Jan-2020  ad Sync with head.
 1.50.10.1  08-Apr-2020  martin Merge changes from current as of 20200406
 1.51.4.1  25-Apr-2020  bouyer Sync with bouyer-xenpvh-base2 (HEAD)
 1.55.6.1  01-Aug-2021  thorpej Sync with HEAD.

RSS XML Feed