History log of /openbsd-current/sys/ufs/ufs/ufs_quota.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.47 24-Jun-2020 cheloha

kernel: use gettime(9)/getuptime(9) in lieu of time_second(9)/time_uptime(9)

time_second(9) and time_uptime(9) are widely used in the kernel to
quickly get the system UTC or system uptime as a time_t. However,
time_t is 64-bit everywhere, so it is not generally safe to use them
on 32-bit platforms: you have a split-read problem if your hardware
cannot perform atomic 64-bit reads.

This patch replaces time_second(9) with gettime(9), a safer successor
interface, throughout the kernel. Similarly, time_uptime(9) is replaced
with getuptime(9).

There is a performance cost on 32-bit platforms in exchange for
eliminating the split-read problem: instead of two register reads you
now have a lockless read loop to pull the values from the timehands.
This is really not *too* bad in the grand scheme of things, but
compared to what we were doing before it is several times slower.

There is no performance cost on 64-bit (__LP64__) platforms.

With input from visa@, dlg@, and tedu@.

Several bugs squashed by visa@.

ok kettenis@


Revision tags: OPENBSD_6_7_BASE
# 1.46 25-Nov-2019 mpi

Convert infinite sleeps to tsleep_nsec(9).

ok bluhm@, cheloha@


Revision tags: OPENBSD_6_6_BASE
# 1.45 06-Oct-2019 beck

Fix vn_open to require an op of 0, and 0 or KERNELPATH only as flags.

sweep tree to correct NDIINT op and flags ahead of time. document
the requirement. This allows KERNELPATH to be used to bypass
unveil for crash dumps with nosuidcoredump=2 or 3

ok visa@ deraadt@ florian@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.44 27-May-2018 visa

Drop unnecessary `p' parameter from vget(9).

OK mpi@


# 1.43 02-May-2018 visa

Remove proc from the parameters of vn_lock(). The parameter is
unnecessary because curproc always does the locking.

OK mpi@


# 1.42 28-Apr-2018 visa

Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is always
curproc that does the locking or unlocking, so the proc parameter
is pointless and can be dropped.

OK mpi@, deraadt@


Revision tags: OPENBSD_6_3_BASE
# 1.41 19-Feb-2018 mpi

Remove almost unused `flags' argument of suser().

The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.

No objection from millert@, ok tedu@, bluhm@


# 1.40 30-Dec-2017 guenther

Don't pull in <sys/file.h> just to get fcntl.h

ok deraadt@ krw@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.39 19-Mar-2016 natano

Remove the unused flags argument from VOP_UNLOCK().

torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt


# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.37 09-Jan-2015 tedu

rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadt


# 1.36 18-Nov-2014 dlg

use siphash for key lookups in all the filesystem hashes.

ok deraadt@ tedu@


# 1.35 13-Oct-2014 guenther

Add dumping of struct dqblk done by quotactl(2)

ok millert@


# 1.34 13-Oct-2014 guenther

Calling quotactl(QCMD(Q_QUOTAON)) twice with the same filesystem,
type, and path shouldn't leak vnode or ucred references.

ok millert@


Revision tags: OPENBSD_5_6_BASE
# 1.33 30-Mar-2014 guenther

Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred

Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.

ok matthew@


Revision tags: OPENBSD_5_5_BASE
# 1.32 12-Dec-2013 tedu

replace old bcopy/bzero with standard functions. ok kettenis


Revision tags: OPENBSD_5_4_BASE
# 1.31 11-Jun-2013 deraadt

final removal of daddr64_t. daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.30 05-Jan-2008 otto

Make the ffs code 64-bit disk block number clean. Based on a diff
from Pedro Martelleto. Two things remain: the on-disk quota
structures are still 32-bit and statfs does not do 64-bit numbers
yet. ok deraadt@


# 1.29 01-Oct-2007 krw

Last of the really easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'
where obvious.


Revision tags: OPENBSD_4_2_BASE
# 1.28 03-Aug-2007 millert

Increase dq_cnt in struct dquot from 16 to 32bits. OK deraadt@


# 1.27 21-Mar-2007 thib

Remove the v_interlock simplelock from the vnode structure.
Zap all calls to simple_lock/unlock() on it (those calls are
#defined away though). Remove the LK_INTERLOCK from the calls
to vn_lock() and cleanup the filesystems wich implement VOP_LOCK().
(by remvoing the v_interlock from there calls to lockmgr()).

ok pedro@, art@, tedu@


Revision tags: OPENBSD_4_1_BASE
# 1.26 14-Feb-2007 jsg

Consistently spell FALLTHROUGH to appease lint.
ok kettenis@ cloder@ tom@ henning@


Revision tags: OPENBSD_4_0_BASE
# 1.25 25-Jun-2006 sturm

rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAIT

requested by and ok pedro


# 1.24 14-Jun-2006 sturm

move vfs_busy() to rwlocks and properly hide the locking api from vfs

ok tedu, pedro


# 1.23 30-Apr-2006 sturm

remove the simplelock argument from vfs_busy() which is currently not
used and will never be used this way in VFS

requested by and ok pedro, ok krw, biorn


Revision tags: OPENBSD_3_9_BASE
# 1.22 28-Dec-2005 pedro

Use the DIP macros to uniformly access fields from UFS1 and UFS2 dinodes.
No functional change, okay tedu@.


# 1.21 30-Nov-2005 pedro

No need for vfs_busy() and vfs_unbusy() to take a process pointer
anymore. Testing by jolan@, thanks.


# 1.20 11-Nov-2005 pedro

Use ANSI function declarations and deregister, no binary change.
Diff from Rui Reis <rui@rui.cx>, thanks.


Revision tags: OPENBSD_3_8_BASE
# 1.19 03-Jul-2005 drahn

Extended Attributes was a piece to get to ACLs, however ACLs have not
been worked on, so EA is pointless. Also the code is not enabled
in GENERIC so it is not being tested or maintained.


Revision tags: OPENBSD_3_7_BASE
# 1.18 26-Dec-2004 miod

Use list and queue macros where applicable to make the code easier to read;
no change in compiler assembly output.


Revision tags: OPENBSD_3_6_BASE
# 1.17 21-Jun-2004 tholo

First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.

ok art@ niklas@ nordin@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.16 20-Jan-2004 tedu

some pieces of ufs2. help testing otto sturm


Revision tags: OPENBSD_3_4_BASE
# 1.15 15-Aug-2003 tedu

change arguments to suser. suser now takes the process, and a flags
argument. old cred only calls user suser_ucred. this will allow future
work to more flexibly implement the idea of a root process. looks like
something i saw in freebsd, but a little different.
use of suser_ucred vs suser in file system code should be looked at again,
for the moment semantics remain unchanged.
review and input from art@ testing and further review miod@


# 1.14 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.13 14-Mar-2002 millert

First round of __P removal in sys


# 1.12 12-Mar-2002 csapuntz

Credentials now freed on re-use of dq structure.


# 1.11 22-Feb-2002 drahn

Extended Attribute support from FreeBSD/TrustedBSD ok art@, deraadt@


# 1.10 20-Feb-2002 csapuntz

Don't rely on vp for anything in dqsync as it can be null


Revision tags: UBC_BASE
# 1.9 22-Nov-2001 csapuntz

branches: 1.9.2;


Changes to allow two partitions to share a quota file


# 1.8 21-Nov-2001 csapuntz

Don't use #define QUOTA - use stub file instead

Pass over the quota code in ufs/. Make code paths clearer. Clean up some names.
Move all code that manipulates quotas directly into ufs_quota.c

Use vfs_mount_foreach_vnode to traverse list of vnodes in mountpoint.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE SMP_BASE kame_19991208
# 1.7 28-Apr-1999 art

branches: 1.7.4;
zap the newhashinit hack.
Add an extra flag to hashinit telling if it should wait in malloc.
update all calls to hashinit.


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.6 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.5 06-Oct-1997 deraadt

back out vfs lite2 till after 2.2


# 1.4 06-Oct-1997 csapuntz

VFS Lite2 Changes


# 1.3 30-May-1997 downsj

Integrate new ext2fs, reverting ufs support for the old one.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.2 27-Feb-1996 niklas

From NetBSD: update to 960217 sources


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.46 25-Nov-2019 mpi

Convert infinite sleeps to tsleep_nsec(9).

ok bluhm@, cheloha@


Revision tags: OPENBSD_6_6_BASE
# 1.45 06-Oct-2019 beck

Fix vn_open to require an op of 0, and 0 or KERNELPATH only as flags.

sweep tree to correct NDIINT op and flags ahead of time. document
the requirement. This allows KERNELPATH to be used to bypass
unveil for crash dumps with nosuidcoredump=2 or 3

ok visa@ deraadt@ florian@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.44 27-May-2018 visa

Drop unnecessary `p' parameter from vget(9).

OK mpi@


# 1.43 02-May-2018 visa

Remove proc from the parameters of vn_lock(). The parameter is
unnecessary because curproc always does the locking.

OK mpi@


# 1.42 28-Apr-2018 visa

Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is always
curproc that does the locking or unlocking, so the proc parameter
is pointless and can be dropped.

OK mpi@, deraadt@


Revision tags: OPENBSD_6_3_BASE
# 1.41 19-Feb-2018 mpi

Remove almost unused `flags' argument of suser().

The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.

No objection from millert@, ok tedu@, bluhm@


# 1.40 30-Dec-2017 guenther

Don't pull in <sys/file.h> just to get fcntl.h

ok deraadt@ krw@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.39 19-Mar-2016 natano

Remove the unused flags argument from VOP_UNLOCK().

torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt


# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.37 09-Jan-2015 tedu

rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadt


# 1.36 18-Nov-2014 dlg

use siphash for key lookups in all the filesystem hashes.

ok deraadt@ tedu@


# 1.35 13-Oct-2014 guenther

Add dumping of struct dqblk done by quotactl(2)

ok millert@


# 1.34 13-Oct-2014 guenther

Calling quotactl(QCMD(Q_QUOTAON)) twice with the same filesystem,
type, and path shouldn't leak vnode or ucred references.

ok millert@


Revision tags: OPENBSD_5_6_BASE
# 1.33 30-Mar-2014 guenther

Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred

Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.

ok matthew@


Revision tags: OPENBSD_5_5_BASE
# 1.32 12-Dec-2013 tedu

replace old bcopy/bzero with standard functions. ok kettenis


Revision tags: OPENBSD_5_4_BASE
# 1.31 11-Jun-2013 deraadt

final removal of daddr64_t. daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.30 05-Jan-2008 otto

Make the ffs code 64-bit disk block number clean. Based on a diff
from Pedro Martelleto. Two things remain: the on-disk quota
structures are still 32-bit and statfs does not do 64-bit numbers
yet. ok deraadt@


# 1.29 01-Oct-2007 krw

Last of the really easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'
where obvious.


Revision tags: OPENBSD_4_2_BASE
# 1.28 03-Aug-2007 millert

Increase dq_cnt in struct dquot from 16 to 32bits. OK deraadt@


# 1.27 21-Mar-2007 thib

Remove the v_interlock simplelock from the vnode structure.
Zap all calls to simple_lock/unlock() on it (those calls are
#defined away though). Remove the LK_INTERLOCK from the calls
to vn_lock() and cleanup the filesystems wich implement VOP_LOCK().
(by remvoing the v_interlock from there calls to lockmgr()).

ok pedro@, art@, tedu@


Revision tags: OPENBSD_4_1_BASE
# 1.26 14-Feb-2007 jsg

Consistently spell FALLTHROUGH to appease lint.
ok kettenis@ cloder@ tom@ henning@


Revision tags: OPENBSD_4_0_BASE
# 1.25 25-Jun-2006 sturm

rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAIT

requested by and ok pedro


# 1.24 14-Jun-2006 sturm

move vfs_busy() to rwlocks and properly hide the locking api from vfs

ok tedu, pedro


# 1.23 30-Apr-2006 sturm

remove the simplelock argument from vfs_busy() which is currently not
used and will never be used this way in VFS

requested by and ok pedro, ok krw, biorn


Revision tags: OPENBSD_3_9_BASE
# 1.22 28-Dec-2005 pedro

Use the DIP macros to uniformly access fields from UFS1 and UFS2 dinodes.
No functional change, okay tedu@.


# 1.21 30-Nov-2005 pedro

No need for vfs_busy() and vfs_unbusy() to take a process pointer
anymore. Testing by jolan@, thanks.


# 1.20 11-Nov-2005 pedro

Use ANSI function declarations and deregister, no binary change.
Diff from Rui Reis <rui@rui.cx>, thanks.


Revision tags: OPENBSD_3_8_BASE
# 1.19 03-Jul-2005 drahn

Extended Attributes was a piece to get to ACLs, however ACLs have not
been worked on, so EA is pointless. Also the code is not enabled
in GENERIC so it is not being tested or maintained.


Revision tags: OPENBSD_3_7_BASE
# 1.18 26-Dec-2004 miod

Use list and queue macros where applicable to make the code easier to read;
no change in compiler assembly output.


Revision tags: OPENBSD_3_6_BASE
# 1.17 21-Jun-2004 tholo

First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.

ok art@ niklas@ nordin@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.16 20-Jan-2004 tedu

some pieces of ufs2. help testing otto sturm


Revision tags: OPENBSD_3_4_BASE
# 1.15 15-Aug-2003 tedu

change arguments to suser. suser now takes the process, and a flags
argument. old cred only calls user suser_ucred. this will allow future
work to more flexibly implement the idea of a root process. looks like
something i saw in freebsd, but a little different.
use of suser_ucred vs suser in file system code should be looked at again,
for the moment semantics remain unchanged.
review and input from art@ testing and further review miod@


# 1.14 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.13 14-Mar-2002 millert

First round of __P removal in sys


# 1.12 12-Mar-2002 csapuntz

Credentials now freed on re-use of dq structure.


# 1.11 22-Feb-2002 drahn

Extended Attribute support from FreeBSD/TrustedBSD ok art@, deraadt@


# 1.10 20-Feb-2002 csapuntz

Don't rely on vp for anything in dqsync as it can be null


Revision tags: UBC_BASE
# 1.9 22-Nov-2001 csapuntz

branches: 1.9.2;


Changes to allow two partitions to share a quota file


# 1.8 21-Nov-2001 csapuntz

Don't use #define QUOTA - use stub file instead

Pass over the quota code in ufs/. Make code paths clearer. Clean up some names.
Move all code that manipulates quotas directly into ufs_quota.c

Use vfs_mount_foreach_vnode to traverse list of vnodes in mountpoint.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE SMP_BASE kame_19991208
# 1.7 28-Apr-1999 art

branches: 1.7.4;
zap the newhashinit hack.
Add an extra flag to hashinit telling if it should wait in malloc.
update all calls to hashinit.


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.6 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.5 06-Oct-1997 deraadt

back out vfs lite2 till after 2.2


# 1.4 06-Oct-1997 csapuntz

VFS Lite2 Changes


# 1.3 30-May-1997 downsj

Integrate new ext2fs, reverting ufs support for the old one.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.2 27-Feb-1996 niklas

From NetBSD: update to 960217 sources


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.45 06-Oct-2019 beck

Fix vn_open to require an op of 0, and 0 or KERNELPATH only as flags.

sweep tree to correct NDIINT op and flags ahead of time. document
the requirement. This allows KERNELPATH to be used to bypass
unveil for crash dumps with nosuidcoredump=2 or 3

ok visa@ deraadt@ florian@


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE
# 1.44 27-May-2018 visa

Drop unnecessary `p' parameter from vget(9).

OK mpi@


# 1.43 02-May-2018 visa

Remove proc from the parameters of vn_lock(). The parameter is
unnecessary because curproc always does the locking.

OK mpi@


# 1.42 28-Apr-2018 visa

Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is always
curproc that does the locking or unlocking, so the proc parameter
is pointless and can be dropped.

OK mpi@, deraadt@


Revision tags: OPENBSD_6_3_BASE
# 1.41 19-Feb-2018 mpi

Remove almost unused `flags' argument of suser().

The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.

No objection from millert@, ok tedu@, bluhm@


# 1.40 30-Dec-2017 guenther

Don't pull in <sys/file.h> just to get fcntl.h

ok deraadt@ krw@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.39 19-Mar-2016 natano

Remove the unused flags argument from VOP_UNLOCK().

torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt


# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.37 09-Jan-2015 tedu

rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadt


# 1.36 18-Nov-2014 dlg

use siphash for key lookups in all the filesystem hashes.

ok deraadt@ tedu@


# 1.35 13-Oct-2014 guenther

Add dumping of struct dqblk done by quotactl(2)

ok millert@


# 1.34 13-Oct-2014 guenther

Calling quotactl(QCMD(Q_QUOTAON)) twice with the same filesystem,
type, and path shouldn't leak vnode or ucred references.

ok millert@


Revision tags: OPENBSD_5_6_BASE
# 1.33 30-Mar-2014 guenther

Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred

Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.

ok matthew@


Revision tags: OPENBSD_5_5_BASE
# 1.32 12-Dec-2013 tedu

replace old bcopy/bzero with standard functions. ok kettenis


Revision tags: OPENBSD_5_4_BASE
# 1.31 11-Jun-2013 deraadt

final removal of daddr64_t. daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.30 05-Jan-2008 otto

Make the ffs code 64-bit disk block number clean. Based on a diff
from Pedro Martelleto. Two things remain: the on-disk quota
structures are still 32-bit and statfs does not do 64-bit numbers
yet. ok deraadt@


# 1.29 01-Oct-2007 krw

Last of the really easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'
where obvious.


Revision tags: OPENBSD_4_2_BASE
# 1.28 03-Aug-2007 millert

Increase dq_cnt in struct dquot from 16 to 32bits. OK deraadt@


# 1.27 21-Mar-2007 thib

Remove the v_interlock simplelock from the vnode structure.
Zap all calls to simple_lock/unlock() on it (those calls are
#defined away though). Remove the LK_INTERLOCK from the calls
to vn_lock() and cleanup the filesystems wich implement VOP_LOCK().
(by remvoing the v_interlock from there calls to lockmgr()).

ok pedro@, art@, tedu@


Revision tags: OPENBSD_4_1_BASE
# 1.26 14-Feb-2007 jsg

Consistently spell FALLTHROUGH to appease lint.
ok kettenis@ cloder@ tom@ henning@


Revision tags: OPENBSD_4_0_BASE
# 1.25 25-Jun-2006 sturm

rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAIT

requested by and ok pedro


# 1.24 14-Jun-2006 sturm

move vfs_busy() to rwlocks and properly hide the locking api from vfs

ok tedu, pedro


# 1.23 30-Apr-2006 sturm

remove the simplelock argument from vfs_busy() which is currently not
used and will never be used this way in VFS

requested by and ok pedro, ok krw, biorn


Revision tags: OPENBSD_3_9_BASE
# 1.22 28-Dec-2005 pedro

Use the DIP macros to uniformly access fields from UFS1 and UFS2 dinodes.
No functional change, okay tedu@.


# 1.21 30-Nov-2005 pedro

No need for vfs_busy() and vfs_unbusy() to take a process pointer
anymore. Testing by jolan@, thanks.


# 1.20 11-Nov-2005 pedro

Use ANSI function declarations and deregister, no binary change.
Diff from Rui Reis <rui@rui.cx>, thanks.


Revision tags: OPENBSD_3_8_BASE
# 1.19 03-Jul-2005 drahn

Extended Attributes was a piece to get to ACLs, however ACLs have not
been worked on, so EA is pointless. Also the code is not enabled
in GENERIC so it is not being tested or maintained.


Revision tags: OPENBSD_3_7_BASE
# 1.18 26-Dec-2004 miod

Use list and queue macros where applicable to make the code easier to read;
no change in compiler assembly output.


Revision tags: OPENBSD_3_6_BASE
# 1.17 21-Jun-2004 tholo

First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.

ok art@ niklas@ nordin@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.16 20-Jan-2004 tedu

some pieces of ufs2. help testing otto sturm


Revision tags: OPENBSD_3_4_BASE
# 1.15 15-Aug-2003 tedu

change arguments to suser. suser now takes the process, and a flags
argument. old cred only calls user suser_ucred. this will allow future
work to more flexibly implement the idea of a root process. looks like
something i saw in freebsd, but a little different.
use of suser_ucred vs suser in file system code should be looked at again,
for the moment semantics remain unchanged.
review and input from art@ testing and further review miod@


# 1.14 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.13 14-Mar-2002 millert

First round of __P removal in sys


# 1.12 12-Mar-2002 csapuntz

Credentials now freed on re-use of dq structure.


# 1.11 22-Feb-2002 drahn

Extended Attribute support from FreeBSD/TrustedBSD ok art@, deraadt@


# 1.10 20-Feb-2002 csapuntz

Don't rely on vp for anything in dqsync as it can be null


Revision tags: UBC_BASE
# 1.9 22-Nov-2001 csapuntz

branches: 1.9.2;


Changes to allow two partitions to share a quota file


# 1.8 21-Nov-2001 csapuntz

Don't use #define QUOTA - use stub file instead

Pass over the quota code in ufs/. Make code paths clearer. Clean up some names.
Move all code that manipulates quotas directly into ufs_quota.c

Use vfs_mount_foreach_vnode to traverse list of vnodes in mountpoint.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE SMP_BASE kame_19991208
# 1.7 28-Apr-1999 art

branches: 1.7.4;
zap the newhashinit hack.
Add an extra flag to hashinit telling if it should wait in malloc.
update all calls to hashinit.


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.6 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.5 06-Oct-1997 deraadt

back out vfs lite2 till after 2.2


# 1.4 06-Oct-1997 csapuntz

VFS Lite2 Changes


# 1.3 30-May-1997 downsj

Integrate new ext2fs, reverting ufs support for the old one.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.2 27-Feb-1996 niklas

From NetBSD: update to 960217 sources


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.44 27-May-2018 visa

Drop unnecessary `p' parameter from vget(9).

OK mpi@


# 1.43 02-May-2018 visa

Remove proc from the parameters of vn_lock(). The parameter is
unnecessary because curproc always does the locking.

OK mpi@


# 1.42 28-Apr-2018 visa

Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is always
curproc that does the locking or unlocking, so the proc parameter
is pointless and can be dropped.

OK mpi@, deraadt@


Revision tags: OPENBSD_6_3_BASE
# 1.41 19-Feb-2018 mpi

Remove almost unused `flags' argument of suser().

The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.

No objection from millert@, ok tedu@, bluhm@


# 1.40 30-Dec-2017 guenther

Don't pull in <sys/file.h> just to get fcntl.h

ok deraadt@ krw@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.39 19-Mar-2016 natano

Remove the unused flags argument from VOP_UNLOCK().

torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt


# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.37 09-Jan-2015 tedu

rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadt


# 1.36 18-Nov-2014 dlg

use siphash for key lookups in all the filesystem hashes.

ok deraadt@ tedu@


# 1.35 13-Oct-2014 guenther

Add dumping of struct dqblk done by quotactl(2)

ok millert@


# 1.34 13-Oct-2014 guenther

Calling quotactl(QCMD(Q_QUOTAON)) twice with the same filesystem,
type, and path shouldn't leak vnode or ucred references.

ok millert@


Revision tags: OPENBSD_5_6_BASE
# 1.33 30-Mar-2014 guenther

Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred

Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.

ok matthew@


Revision tags: OPENBSD_5_5_BASE
# 1.32 12-Dec-2013 tedu

replace old bcopy/bzero with standard functions. ok kettenis


Revision tags: OPENBSD_5_4_BASE
# 1.31 11-Jun-2013 deraadt

final removal of daddr64_t. daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.30 05-Jan-2008 otto

Make the ffs code 64-bit disk block number clean. Based on a diff
from Pedro Martelleto. Two things remain: the on-disk quota
structures are still 32-bit and statfs does not do 64-bit numbers
yet. ok deraadt@


# 1.29 01-Oct-2007 krw

Last of the really easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'
where obvious.


Revision tags: OPENBSD_4_2_BASE
# 1.28 03-Aug-2007 millert

Increase dq_cnt in struct dquot from 16 to 32bits. OK deraadt@


# 1.27 21-Mar-2007 thib

Remove the v_interlock simplelock from the vnode structure.
Zap all calls to simple_lock/unlock() on it (those calls are
#defined away though). Remove the LK_INTERLOCK from the calls
to vn_lock() and cleanup the filesystems wich implement VOP_LOCK().
(by remvoing the v_interlock from there calls to lockmgr()).

ok pedro@, art@, tedu@


Revision tags: OPENBSD_4_1_BASE
# 1.26 14-Feb-2007 jsg

Consistently spell FALLTHROUGH to appease lint.
ok kettenis@ cloder@ tom@ henning@


Revision tags: OPENBSD_4_0_BASE
# 1.25 25-Jun-2006 sturm

rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAIT

requested by and ok pedro


# 1.24 14-Jun-2006 sturm

move vfs_busy() to rwlocks and properly hide the locking api from vfs

ok tedu, pedro


# 1.23 30-Apr-2006 sturm

remove the simplelock argument from vfs_busy() which is currently not
used and will never be used this way in VFS

requested by and ok pedro, ok krw, biorn


Revision tags: OPENBSD_3_9_BASE
# 1.22 28-Dec-2005 pedro

Use the DIP macros to uniformly access fields from UFS1 and UFS2 dinodes.
No functional change, okay tedu@.


# 1.21 30-Nov-2005 pedro

No need for vfs_busy() and vfs_unbusy() to take a process pointer
anymore. Testing by jolan@, thanks.


# 1.20 11-Nov-2005 pedro

Use ANSI function declarations and deregister, no binary change.
Diff from Rui Reis <rui@rui.cx>, thanks.


Revision tags: OPENBSD_3_8_BASE
# 1.19 03-Jul-2005 drahn

Extended Attributes was a piece to get to ACLs, however ACLs have not
been worked on, so EA is pointless. Also the code is not enabled
in GENERIC so it is not being tested or maintained.


Revision tags: OPENBSD_3_7_BASE
# 1.18 26-Dec-2004 miod

Use list and queue macros where applicable to make the code easier to read;
no change in compiler assembly output.


Revision tags: OPENBSD_3_6_BASE
# 1.17 21-Jun-2004 tholo

First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.

ok art@ niklas@ nordin@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.16 20-Jan-2004 tedu

some pieces of ufs2. help testing otto sturm


Revision tags: OPENBSD_3_4_BASE
# 1.15 15-Aug-2003 tedu

change arguments to suser. suser now takes the process, and a flags
argument. old cred only calls user suser_ucred. this will allow future
work to more flexibly implement the idea of a root process. looks like
something i saw in freebsd, but a little different.
use of suser_ucred vs suser in file system code should be looked at again,
for the moment semantics remain unchanged.
review and input from art@ testing and further review miod@


# 1.14 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.13 14-Mar-2002 millert

First round of __P removal in sys


# 1.12 12-Mar-2002 csapuntz

Credentials now freed on re-use of dq structure.


# 1.11 22-Feb-2002 drahn

Extended Attribute support from FreeBSD/TrustedBSD ok art@, deraadt@


# 1.10 20-Feb-2002 csapuntz

Don't rely on vp for anything in dqsync as it can be null


Revision tags: UBC_BASE
# 1.9 22-Nov-2001 csapuntz

branches: 1.9.2;


Changes to allow two partitions to share a quota file


# 1.8 21-Nov-2001 csapuntz

Don't use #define QUOTA - use stub file instead

Pass over the quota code in ufs/. Make code paths clearer. Clean up some names.
Move all code that manipulates quotas directly into ufs_quota.c

Use vfs_mount_foreach_vnode to traverse list of vnodes in mountpoint.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE SMP_BASE kame_19991208
# 1.7 28-Apr-1999 art

branches: 1.7.4;
zap the newhashinit hack.
Add an extra flag to hashinit telling if it should wait in malloc.
update all calls to hashinit.


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.6 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.5 06-Oct-1997 deraadt

back out vfs lite2 till after 2.2


# 1.4 06-Oct-1997 csapuntz

VFS Lite2 Changes


# 1.3 30-May-1997 downsj

Integrate new ext2fs, reverting ufs support for the old one.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.2 27-Feb-1996 niklas

From NetBSD: update to 960217 sources


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.43 02-May-2018 visa

Remove proc from the parameters of vn_lock(). The parameter is
unnecessary because curproc always does the locking.

OK mpi@


# 1.42 28-Apr-2018 visa

Clean up the parameters of VOP_LOCK() and VOP_UNLOCK(). It is always
curproc that does the locking or unlocking, so the proc parameter
is pointless and can be dropped.

OK mpi@, deraadt@


Revision tags: OPENBSD_6_3_BASE
# 1.41 19-Feb-2018 mpi

Remove almost unused `flags' argument of suser().

The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.

No objection from millert@, ok tedu@, bluhm@


# 1.40 30-Dec-2017 guenther

Don't pull in <sys/file.h> just to get fcntl.h

ok deraadt@ krw@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.39 19-Mar-2016 natano

Remove the unused flags argument from VOP_UNLOCK().

torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt


# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.37 09-Jan-2015 tedu

rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadt


# 1.36 18-Nov-2014 dlg

use siphash for key lookups in all the filesystem hashes.

ok deraadt@ tedu@


# 1.35 13-Oct-2014 guenther

Add dumping of struct dqblk done by quotactl(2)

ok millert@


# 1.34 13-Oct-2014 guenther

Calling quotactl(QCMD(Q_QUOTAON)) twice with the same filesystem,
type, and path shouldn't leak vnode or ucred references.

ok millert@


Revision tags: OPENBSD_5_6_BASE
# 1.33 30-Mar-2014 guenther

Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred

Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.

ok matthew@


Revision tags: OPENBSD_5_5_BASE
# 1.32 12-Dec-2013 tedu

replace old bcopy/bzero with standard functions. ok kettenis


Revision tags: OPENBSD_5_4_BASE
# 1.31 11-Jun-2013 deraadt

final removal of daddr64_t. daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.30 05-Jan-2008 otto

Make the ffs code 64-bit disk block number clean. Based on a diff
from Pedro Martelleto. Two things remain: the on-disk quota
structures are still 32-bit and statfs does not do 64-bit numbers
yet. ok deraadt@


# 1.29 01-Oct-2007 krw

Last of the really easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'
where obvious.


Revision tags: OPENBSD_4_2_BASE
# 1.28 03-Aug-2007 millert

Increase dq_cnt in struct dquot from 16 to 32bits. OK deraadt@


# 1.27 21-Mar-2007 thib

Remove the v_interlock simplelock from the vnode structure.
Zap all calls to simple_lock/unlock() on it (those calls are
#defined away though). Remove the LK_INTERLOCK from the calls
to vn_lock() and cleanup the filesystems wich implement VOP_LOCK().
(by remvoing the v_interlock from there calls to lockmgr()).

ok pedro@, art@, tedu@


Revision tags: OPENBSD_4_1_BASE
# 1.26 14-Feb-2007 jsg

Consistently spell FALLTHROUGH to appease lint.
ok kettenis@ cloder@ tom@ henning@


Revision tags: OPENBSD_4_0_BASE
# 1.25 25-Jun-2006 sturm

rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAIT

requested by and ok pedro


# 1.24 14-Jun-2006 sturm

move vfs_busy() to rwlocks and properly hide the locking api from vfs

ok tedu, pedro


# 1.23 30-Apr-2006 sturm

remove the simplelock argument from vfs_busy() which is currently not
used and will never be used this way in VFS

requested by and ok pedro, ok krw, biorn


Revision tags: OPENBSD_3_9_BASE
# 1.22 28-Dec-2005 pedro

Use the DIP macros to uniformly access fields from UFS1 and UFS2 dinodes.
No functional change, okay tedu@.


# 1.21 30-Nov-2005 pedro

No need for vfs_busy() and vfs_unbusy() to take a process pointer
anymore. Testing by jolan@, thanks.


# 1.20 11-Nov-2005 pedro

Use ANSI function declarations and deregister, no binary change.
Diff from Rui Reis <rui@rui.cx>, thanks.


Revision tags: OPENBSD_3_8_BASE
# 1.19 03-Jul-2005 drahn

Extended Attributes was a piece to get to ACLs, however ACLs have not
been worked on, so EA is pointless. Also the code is not enabled
in GENERIC so it is not being tested or maintained.


Revision tags: OPENBSD_3_7_BASE
# 1.18 26-Dec-2004 miod

Use list and queue macros where applicable to make the code easier to read;
no change in compiler assembly output.


Revision tags: OPENBSD_3_6_BASE
# 1.17 21-Jun-2004 tholo

First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.

ok art@ niklas@ nordin@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.16 20-Jan-2004 tedu

some pieces of ufs2. help testing otto sturm


Revision tags: OPENBSD_3_4_BASE
# 1.15 15-Aug-2003 tedu

change arguments to suser. suser now takes the process, and a flags
argument. old cred only calls user suser_ucred. this will allow future
work to more flexibly implement the idea of a root process. looks like
something i saw in freebsd, but a little different.
use of suser_ucred vs suser in file system code should be looked at again,
for the moment semantics remain unchanged.
review and input from art@ testing and further review miod@


# 1.14 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.13 14-Mar-2002 millert

First round of __P removal in sys


# 1.12 12-Mar-2002 csapuntz

Credentials now freed on re-use of dq structure.


# 1.11 22-Feb-2002 drahn

Extended Attribute support from FreeBSD/TrustedBSD ok art@, deraadt@


# 1.10 20-Feb-2002 csapuntz

Don't rely on vp for anything in dqsync as it can be null


Revision tags: UBC_BASE
# 1.9 22-Nov-2001 csapuntz

branches: 1.9.2;


Changes to allow two partitions to share a quota file


# 1.8 21-Nov-2001 csapuntz

Don't use #define QUOTA - use stub file instead

Pass over the quota code in ufs/. Make code paths clearer. Clean up some names.
Move all code that manipulates quotas directly into ufs_quota.c

Use vfs_mount_foreach_vnode to traverse list of vnodes in mountpoint.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE SMP_BASE kame_19991208
# 1.7 28-Apr-1999 art

branches: 1.7.4;
zap the newhashinit hack.
Add an extra flag to hashinit telling if it should wait in malloc.
update all calls to hashinit.


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.6 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.5 06-Oct-1997 deraadt

back out vfs lite2 till after 2.2


# 1.4 06-Oct-1997 csapuntz

VFS Lite2 Changes


# 1.3 30-May-1997 downsj

Integrate new ext2fs, reverting ufs support for the old one.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.2 27-Feb-1996 niklas

From NetBSD: update to 960217 sources


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.41 19-Feb-2018 mpi

Remove almost unused `flags' argument of suser().

The account flag `ASU' will no longer be set but that makes suser()
mpsafe since it no longer mess with a per-process field.

No objection from millert@, ok tedu@, bluhm@


# 1.40 30-Dec-2017 guenther

Don't pull in <sys/file.h> just to get fcntl.h

ok deraadt@ krw@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.39 19-Mar-2016 natano

Remove the unused flags argument from VOP_UNLOCK().

torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt


# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.37 09-Jan-2015 tedu

rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadt


# 1.36 18-Nov-2014 dlg

use siphash for key lookups in all the filesystem hashes.

ok deraadt@ tedu@


# 1.35 13-Oct-2014 guenther

Add dumping of struct dqblk done by quotactl(2)

ok millert@


# 1.34 13-Oct-2014 guenther

Calling quotactl(QCMD(Q_QUOTAON)) twice with the same filesystem,
type, and path shouldn't leak vnode or ucred references.

ok millert@


Revision tags: OPENBSD_5_6_BASE
# 1.33 30-Mar-2014 guenther

Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred

Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.

ok matthew@


Revision tags: OPENBSD_5_5_BASE
# 1.32 12-Dec-2013 tedu

replace old bcopy/bzero with standard functions. ok kettenis


Revision tags: OPENBSD_5_4_BASE
# 1.31 11-Jun-2013 deraadt

final removal of daddr64_t. daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.30 05-Jan-2008 otto

Make the ffs code 64-bit disk block number clean. Based on a diff
from Pedro Martelleto. Two things remain: the on-disk quota
structures are still 32-bit and statfs does not do 64-bit numbers
yet. ok deraadt@


# 1.29 01-Oct-2007 krw

Last of the really easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'
where obvious.


Revision tags: OPENBSD_4_2_BASE
# 1.28 03-Aug-2007 millert

Increase dq_cnt in struct dquot from 16 to 32bits. OK deraadt@


# 1.27 21-Mar-2007 thib

Remove the v_interlock simplelock from the vnode structure.
Zap all calls to simple_lock/unlock() on it (those calls are
#defined away though). Remove the LK_INTERLOCK from the calls
to vn_lock() and cleanup the filesystems wich implement VOP_LOCK().
(by remvoing the v_interlock from there calls to lockmgr()).

ok pedro@, art@, tedu@


Revision tags: OPENBSD_4_1_BASE
# 1.26 14-Feb-2007 jsg

Consistently spell FALLTHROUGH to appease lint.
ok kettenis@ cloder@ tom@ henning@


Revision tags: OPENBSD_4_0_BASE
# 1.25 25-Jun-2006 sturm

rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAIT

requested by and ok pedro


# 1.24 14-Jun-2006 sturm

move vfs_busy() to rwlocks and properly hide the locking api from vfs

ok tedu, pedro


# 1.23 30-Apr-2006 sturm

remove the simplelock argument from vfs_busy() which is currently not
used and will never be used this way in VFS

requested by and ok pedro, ok krw, biorn


Revision tags: OPENBSD_3_9_BASE
# 1.22 28-Dec-2005 pedro

Use the DIP macros to uniformly access fields from UFS1 and UFS2 dinodes.
No functional change, okay tedu@.


# 1.21 30-Nov-2005 pedro

No need for vfs_busy() and vfs_unbusy() to take a process pointer
anymore. Testing by jolan@, thanks.


# 1.20 11-Nov-2005 pedro

Use ANSI function declarations and deregister, no binary change.
Diff from Rui Reis <rui@rui.cx>, thanks.


Revision tags: OPENBSD_3_8_BASE
# 1.19 03-Jul-2005 drahn

Extended Attributes was a piece to get to ACLs, however ACLs have not
been worked on, so EA is pointless. Also the code is not enabled
in GENERIC so it is not being tested or maintained.


Revision tags: OPENBSD_3_7_BASE
# 1.18 26-Dec-2004 miod

Use list and queue macros where applicable to make the code easier to read;
no change in compiler assembly output.


Revision tags: OPENBSD_3_6_BASE
# 1.17 21-Jun-2004 tholo

First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.

ok art@ niklas@ nordin@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.16 20-Jan-2004 tedu

some pieces of ufs2. help testing otto sturm


Revision tags: OPENBSD_3_4_BASE
# 1.15 15-Aug-2003 tedu

change arguments to suser. suser now takes the process, and a flags
argument. old cred only calls user suser_ucred. this will allow future
work to more flexibly implement the idea of a root process. looks like
something i saw in freebsd, but a little different.
use of suser_ucred vs suser in file system code should be looked at again,
for the moment semantics remain unchanged.
review and input from art@ testing and further review miod@


# 1.14 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.13 14-Mar-2002 millert

First round of __P removal in sys


# 1.12 12-Mar-2002 csapuntz

Credentials now freed on re-use of dq structure.


# 1.11 22-Feb-2002 drahn

Extended Attribute support from FreeBSD/TrustedBSD ok art@, deraadt@


# 1.10 20-Feb-2002 csapuntz

Don't rely on vp for anything in dqsync as it can be null


Revision tags: UBC_BASE
# 1.9 22-Nov-2001 csapuntz

branches: 1.9.2;


Changes to allow two partitions to share a quota file


# 1.8 21-Nov-2001 csapuntz

Don't use #define QUOTA - use stub file instead

Pass over the quota code in ufs/. Make code paths clearer. Clean up some names.
Move all code that manipulates quotas directly into ufs_quota.c

Use vfs_mount_foreach_vnode to traverse list of vnodes in mountpoint.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE SMP_BASE kame_19991208
# 1.7 28-Apr-1999 art

branches: 1.7.4;
zap the newhashinit hack.
Add an extra flag to hashinit telling if it should wait in malloc.
update all calls to hashinit.


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.6 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.5 06-Oct-1997 deraadt

back out vfs lite2 till after 2.2


# 1.4 06-Oct-1997 csapuntz

VFS Lite2 Changes


# 1.3 30-May-1997 downsj

Integrate new ext2fs, reverting ufs support for the old one.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.2 27-Feb-1996 niklas

From NetBSD: update to 960217 sources


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision


# 1.40 30-Dec-2017 guenther

Don't pull in <sys/file.h> just to get fcntl.h

ok deraadt@ krw@


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.39 19-Mar-2016 natano

Remove the unused flags argument from VOP_UNLOCK().

torture tested on amd64, i386 and macppc
ok beck mpi stefan
"the change looks right" deraadt


# 1.38 14-Mar-2016 krw

Change a bunch of (<blah> *)0 to NULL.

ok beck@ deraadt@


Revision tags: OPENBSD_5_7_BASE OPENBSD_5_8_BASE OPENBSD_5_9_BASE
# 1.37 09-Jan-2015 tedu

rename desiredvnodes to initialvnodes. less of a lie. ok beck deraadt


# 1.36 18-Nov-2014 dlg

use siphash for key lookups in all the filesystem hashes.

ok deraadt@ tedu@


# 1.35 13-Oct-2014 guenther

Add dumping of struct dqblk done by quotactl(2)

ok millert@


# 1.34 13-Oct-2014 guenther

Calling quotactl(QCMD(Q_QUOTAON)) twice with the same filesystem,
type, and path shouldn't leak vnode or ucred references.

ok millert@


Revision tags: OPENBSD_5_6_BASE
# 1.33 30-Mar-2014 guenther

Eliminates struct pcred by moving the real and saved ugids into
struct ucred; struct process then directly links to the ucred

Based on a discussion at c2k10 or so before noting that FreeBSD and
NetBSD did this too.

ok matthew@


Revision tags: OPENBSD_5_5_BASE
# 1.32 12-Dec-2013 tedu

replace old bcopy/bzero with standard functions. ok kettenis


Revision tags: OPENBSD_5_4_BASE
# 1.31 11-Jun-2013 deraadt

final removal of daddr64_t. daddr_t has been 64 bit for a long enough
test period; i think 3 years ago the last bugs fell out.
ok otto beck others


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE OPENBSD_4_7_BASE OPENBSD_4_8_BASE OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.30 05-Jan-2008 otto

Make the ffs code 64-bit disk block number clean. Based on a diff
from Pedro Martelleto. Two things remain: the on-disk quota
structures are still 32-bit and statfs does not do 64-bit numbers
yet. ok deraadt@


# 1.29 01-Oct-2007 krw

Last of the really easy bzero() -> M_ZERO. Use 'p = malloc(sizeof(*p) ...'
where obvious.


Revision tags: OPENBSD_4_2_BASE
# 1.28 03-Aug-2007 millert

Increase dq_cnt in struct dquot from 16 to 32bits. OK deraadt@


# 1.27 21-Mar-2007 thib

Remove the v_interlock simplelock from the vnode structure.
Zap all calls to simple_lock/unlock() on it (those calls are
#defined away though). Remove the LK_INTERLOCK from the calls
to vn_lock() and cleanup the filesystems wich implement VOP_LOCK().
(by remvoing the v_interlock from there calls to lockmgr()).

ok pedro@, art@, tedu@


Revision tags: OPENBSD_4_1_BASE
# 1.26 14-Feb-2007 jsg

Consistently spell FALLTHROUGH to appease lint.
ok kettenis@ cloder@ tom@ henning@


Revision tags: OPENBSD_4_0_BASE
# 1.25 25-Jun-2006 sturm

rename vfs_busy() flags VB_UMIGNORE/VB_UMWAIT to VB_NOWAIT/VB_WAIT

requested by and ok pedro


# 1.24 14-Jun-2006 sturm

move vfs_busy() to rwlocks and properly hide the locking api from vfs

ok tedu, pedro


# 1.23 30-Apr-2006 sturm

remove the simplelock argument from vfs_busy() which is currently not
used and will never be used this way in VFS

requested by and ok pedro, ok krw, biorn


Revision tags: OPENBSD_3_9_BASE
# 1.22 28-Dec-2005 pedro

Use the DIP macros to uniformly access fields from UFS1 and UFS2 dinodes.
No functional change, okay tedu@.


# 1.21 30-Nov-2005 pedro

No need for vfs_busy() and vfs_unbusy() to take a process pointer
anymore. Testing by jolan@, thanks.


# 1.20 11-Nov-2005 pedro

Use ANSI function declarations and deregister, no binary change.
Diff from Rui Reis <rui@rui.cx>, thanks.


Revision tags: OPENBSD_3_8_BASE
# 1.19 03-Jul-2005 drahn

Extended Attributes was a piece to get to ACLs, however ACLs have not
been worked on, so EA is pointless. Also the code is not enabled
in GENERIC so it is not being tested or maintained.


Revision tags: OPENBSD_3_7_BASE
# 1.18 26-Dec-2004 miod

Use list and queue macros where applicable to make the code easier to read;
no change in compiler assembly output.


Revision tags: OPENBSD_3_6_BASE
# 1.17 21-Jun-2004 tholo

First step towards more sane time handling in the kernel -- this changes
things such that code that only need a second-resolution uptime or wall
time, and used to get that from time.tv_secs or mono_time.tv_secs now get
this from separate time_t globals time_second and time_uptime.

ok art@ niklas@ nordin@


Revision tags: OPENBSD_3_5_BASE SMP_SYNC_A SMP_SYNC_B
# 1.16 20-Jan-2004 tedu

some pieces of ufs2. help testing otto sturm


Revision tags: OPENBSD_3_4_BASE
# 1.15 15-Aug-2003 tedu

change arguments to suser. suser now takes the process, and a flags
argument. old cred only calls user suser_ucred. this will allow future
work to more flexibly implement the idea of a root process. looks like
something i saw in freebsd, but a little different.
use of suser_ucred vs suser in file system code should be looked at again,
for the moment semantics remain unchanged.
review and input from art@ testing and further review miod@


# 1.14 02-Jun-2003 millert

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999. Proofed by myself and Theo.


Revision tags: OPENBSD_3_1_BASE OPENBSD_3_2_BASE OPENBSD_3_3_BASE UBC_SYNC_A UBC_SYNC_B
# 1.13 14-Mar-2002 millert

First round of __P removal in sys


# 1.12 12-Mar-2002 csapuntz

Credentials now freed on re-use of dq structure.


# 1.11 22-Feb-2002 drahn

Extended Attribute support from FreeBSD/TrustedBSD ok art@, deraadt@


# 1.10 20-Feb-2002 csapuntz

Don't rely on vp for anything in dqsync as it can be null


Revision tags: UBC_BASE
# 1.9 22-Nov-2001 csapuntz

branches: 1.9.2;


Changes to allow two partitions to share a quota file


# 1.8 21-Nov-2001 csapuntz

Don't use #define QUOTA - use stub file instead

Pass over the quota code in ufs/. Make code paths clearer. Clean up some names.
Move all code that manipulates quotas directly into ufs_quota.c

Use vfs_mount_foreach_vnode to traverse list of vnodes in mountpoint.


Revision tags: OPENBSD_2_6_BASE OPENBSD_2_7_BASE OPENBSD_2_8_BASE OPENBSD_2_9_BASE OPENBSD_3_0_BASE SMP_BASE kame_19991208
# 1.7 28-Apr-1999 art

branches: 1.7.4;
zap the newhashinit hack.
Add an extra flag to hashinit telling if it should wait in malloc.
update all calls to hashinit.


Revision tags: OPENBSD_2_3_BASE OPENBSD_2_4_BASE OPENBSD_2_5_BASE
# 1.6 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.5 06-Oct-1997 deraadt

back out vfs lite2 till after 2.2


# 1.4 06-Oct-1997 csapuntz

VFS Lite2 Changes


# 1.3 30-May-1997 downsj

Integrate new ext2fs, reverting ufs support for the old one.


Revision tags: OPENBSD_2_0_BASE OPENBSD_2_1_BASE
# 1.2 27-Feb-1996 niklas

From NetBSD: update to 960217 sources


# 1.1 18-Oct-1995 deraadt

branches: 1.1.1;
Initial revision