History log of /openbsd-current/sys/ufs/ext2fs/ext2fs_lookup.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.46 11-Jan-2022 jsg

spelling
ok jmc@


Revision tags: OPENBSD_6_9_BASE OPENBSD_7_0_BASE
# 1.45 11-Mar-2021 jsg

spelling


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.44 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.43 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_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.42 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.41 14-Mar-2016 krw

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

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.40 16-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.39 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.38 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


Revision tags: OPENBSD_5_6_BASE
# 1.37 13-Jul-2014 pelikan

kill fs2hXX/h2fsXX macros with letohXX/htoleXX

The reason being that ext2 structures are little-endian but JBD2 journal
is big-endian. Don't confuse readers by talking about "file system endian".

Some KNF while there.

ok guenther


# 1.36 13-Jul-2014 pelikan

fill in proper sizes in free(9)


# 1.35 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


# 1.34 12-Jul-2014 pelikan

pull dirblock search code from ext2fs_lookup() like FreeBSD has done

ok tedu


# 1.33 11-Jul-2014 pelikan

separate searchslot variables into a structure like FreeBSD

ok guenther


# 1.32 10-Jul-2014 pelikan

prepare for upcoming ext4 read support

Parts of the on-disk inode changed their meaning in order to support bigger
sizes. More flags & prettification. No functional change.

ok guenther


# 1.31 27-May-2014 krw

Zap a bunch of trailing whitespace.


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

replace old bcopy/bzero with standard functions. ok kettenis


# 1.29 13-Aug-2013 guenther

Switch time_t, ino_t, clock_t, and struct kevent's ident and data
members to 64bit types. Assign new syscall numbers for (almost
all) the syscalls that involve the affected types, including anything
with time_t, timeval, itimerval, timespec, rusage, dirent, stat,
or kevent arguments. Add a d_off member to struct dirent and replace
getdirentries() with getdents(), thus immensely simplifying and
accelerating telldir/seekdir. Build perl with -DBIG_TIME.

Bump the major on every single base library: the compat bits included
here are only good enough to make the transition; the T32 compat
option will be burned as soon as we've reached the new world are
are happy with the snapshots for all architectures.

DANGER: ABI incompatibility. Updating to this kernel requires extra
work or you won't be able to login: install a snapshot instead.

Much assistance in fixing userland issues from deraadt@ and tedu@
and build assistance from todd@ and otto@


Revision tags: OPENBSD_5_4_BASE
# 1.28 30-May-2013 guenther

UFS does't do inode numbers >2^32, so use a smaller type internally,
only using ino_t in the VFS layer APIs: vget, readdir, getattr.

otto wrote the original diff for libsa to keep bootblock from overflowing
ok deraadt@ kettenis@


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.27 18-Nov-2010 miod

Make sure readdir cookies are actually allocated with the correct size
(in case eventually we change their type from u_long to something else),
and do not truncate them to 32 bits in the ntfs code.
ok tedu@


# 1.26 23-Sep-2010 oga

The only sensible argument for VOP_* calls that take a struct proc pointer is
curproc. A bunch of callers were passing in 0 (not even NULL, 0) as this
pointer, which was fine until the called vnode function tried to do
something with it. Typically, this code was then copy/pasted to various
parts of the tree.

Accept the facts of life and switch all of these over to passing curproc
for now until the argument can be removed.

Discovered by stsp trying to create a softraid on top of a vnd, which
crashed with a NULL deref in vndioctl.

softraid bits tested by mikeb and jsing. raidframe bits tested by pea,
matthieu and naddy. The rest tested by at least thib, jsing and myself.

ok thib@, jsing@.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.25 09-Jul-2009 thib

Remove the VREF() macro and replaces all instances with a call to verf(),
which is exactly what the macro does.

Macro's that are nothing more then:
#define FUNCTION(arg) function(arg)
are almost always pointless and should go away.

OK blambert@
Agreed by many.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.24 09-Oct-2007 krw

MALLOC+memset(,0,) -> malloc+M_ZERO. Don't forget FREE->free this time.


Revision tags: OPENBSD_4_2_BASE
# 1.23 17-Jun-2007 jasper

ansify/de-register.
no binary change


# 1.22 01-Jun-2007 deraadt

pedro ok'd this ~3500 line diff which removes the vop argument
"ap = v" comments in under 8 seconds, so it must be ok. and it compiles
too.


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.21 28-Dec-2005 pedro

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


# 1.20 16-Dec-2005 pedro

Fix unsigned < 0 check in ext2fs_readdir(), okay krw@


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.


# 1.18 30-Apr-2005 niallo

Add support for large files (> 4GB).

Automatically converts old filesystems to use this if they are already at
revision 1 (like Linux). Revision 0 filesystems don't get converted (unlike
Linux).

From NetBSD


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE SMP_SYNC_A SMP_SYNC_B
# 1.17 06-Dec-2003 grange

u_int8_t variable can't be > 255; pointed out by Mr. GCC3.
ok millert@


Revision tags: OPENBSD_3_4_BASE
# 1.16 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_3_BASE UBC_SYNC_A
# 1.15 31-Jan-2003 art

File system locking fixups, mostly from NetBSD:
- cache_lookup
move common code from various fs's here
always return with vnode and parent locked
adjust return codes
- PDIRUNLOCK - new flag set if lookup couldn't lock parent vnode
- kernfs and procfs
lock vnode in get_root
don't unlock (again) in kernfs_freevp
fix memory leak in procfs

From tedu@stanford.edu
deraadt@ and various other ok


Revision tags: UBC_SYNC_B
# 1.14 12-Oct-2002 krw

Remove more '\n's from panic() statements. Both trailing and leading.

Diff generated by Chris Kuethe.


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

First round of __P removal in sys


# 1.12 22-Feb-2002 drahn

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


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.11 18-Sep-2001 art

branches: 1.11.4;
More of cleanups, reliability and endianness fixes from NetBSD.


# 1.10 23-Jun-2001 csapuntz

Privatize several vnode operations that are not used by the generic code.


Revision tags: OPENBSD_2_9_BASE
# 1.9 06-Apr-2001 csapuntz

Free the right variable on error


# 1.8 25-Mar-2001 csapuntz

Free the right variable. Thanks to Dawson and team.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.7 26-Apr-2000 jasoni

Support for ext2fs rev. 1 (from NetBSD)


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.6 11-Jan-1999 millert

branches: 1.6.6;
panic prints a newline for you, don't do it in the panic string


Revision tags: OPENBSD_2_4_BASE
# 1.5 28-Jul-1998 millert

Return EINVAL when msg_iovlen or iovcnt <= 0; Make uio_resid unsigned (size_t) and don't return EINVAL if it is < 0 in sys_{read,write}. Remove check for uio_resid < 0 uiomove() now that uio_resid is unsigned and brack remaining panics with #ifdef DIAGNOSTIC. vn_rdwr() must now take a size_t * as its 9th argument so change that and clean up uses of vn_rdwr(). Fixes 549 + more


Revision tags: OPENBSD_2_3_BASE
# 1.4 12-Jan-1998 csapuntz

Free cookies correctly in case of error


# 1.3 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.2 12-Jun-1997 downsj

Sync with NetBSD, mostly cosmetic.


# 1.1 30-May-1997 downsj

branches: 1.1.1;
Initial revision


# 1.45 11-Mar-2021 jsg

spelling


Revision tags: OPENBSD_6_4_BASE OPENBSD_6_5_BASE OPENBSD_6_6_BASE OPENBSD_6_7_BASE OPENBSD_6_8_BASE
# 1.44 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.43 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_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.42 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.41 14-Mar-2016 krw

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

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.40 16-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.39 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.38 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


Revision tags: OPENBSD_5_6_BASE
# 1.37 13-Jul-2014 pelikan

kill fs2hXX/h2fsXX macros with letohXX/htoleXX

The reason being that ext2 structures are little-endian but JBD2 journal
is big-endian. Don't confuse readers by talking about "file system endian".

Some KNF while there.

ok guenther


# 1.36 13-Jul-2014 pelikan

fill in proper sizes in free(9)


# 1.35 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


# 1.34 12-Jul-2014 pelikan

pull dirblock search code from ext2fs_lookup() like FreeBSD has done

ok tedu


# 1.33 11-Jul-2014 pelikan

separate searchslot variables into a structure like FreeBSD

ok guenther


# 1.32 10-Jul-2014 pelikan

prepare for upcoming ext4 read support

Parts of the on-disk inode changed their meaning in order to support bigger
sizes. More flags & prettification. No functional change.

ok guenther


# 1.31 27-May-2014 krw

Zap a bunch of trailing whitespace.


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

replace old bcopy/bzero with standard functions. ok kettenis


# 1.29 13-Aug-2013 guenther

Switch time_t, ino_t, clock_t, and struct kevent's ident and data
members to 64bit types. Assign new syscall numbers for (almost
all) the syscalls that involve the affected types, including anything
with time_t, timeval, itimerval, timespec, rusage, dirent, stat,
or kevent arguments. Add a d_off member to struct dirent and replace
getdirentries() with getdents(), thus immensely simplifying and
accelerating telldir/seekdir. Build perl with -DBIG_TIME.

Bump the major on every single base library: the compat bits included
here are only good enough to make the transition; the T32 compat
option will be burned as soon as we've reached the new world are
are happy with the snapshots for all architectures.

DANGER: ABI incompatibility. Updating to this kernel requires extra
work or you won't be able to login: install a snapshot instead.

Much assistance in fixing userland issues from deraadt@ and tedu@
and build assistance from todd@ and otto@


Revision tags: OPENBSD_5_4_BASE
# 1.28 30-May-2013 guenther

UFS does't do inode numbers >2^32, so use a smaller type internally,
only using ino_t in the VFS layer APIs: vget, readdir, getattr.

otto wrote the original diff for libsa to keep bootblock from overflowing
ok deraadt@ kettenis@


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.27 18-Nov-2010 miod

Make sure readdir cookies are actually allocated with the correct size
(in case eventually we change their type from u_long to something else),
and do not truncate them to 32 bits in the ntfs code.
ok tedu@


# 1.26 23-Sep-2010 oga

The only sensible argument for VOP_* calls that take a struct proc pointer is
curproc. A bunch of callers were passing in 0 (not even NULL, 0) as this
pointer, which was fine until the called vnode function tried to do
something with it. Typically, this code was then copy/pasted to various
parts of the tree.

Accept the facts of life and switch all of these over to passing curproc
for now until the argument can be removed.

Discovered by stsp trying to create a softraid on top of a vnd, which
crashed with a NULL deref in vndioctl.

softraid bits tested by mikeb and jsing. raidframe bits tested by pea,
matthieu and naddy. The rest tested by at least thib, jsing and myself.

ok thib@, jsing@.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.25 09-Jul-2009 thib

Remove the VREF() macro and replaces all instances with a call to verf(),
which is exactly what the macro does.

Macro's that are nothing more then:
#define FUNCTION(arg) function(arg)
are almost always pointless and should go away.

OK blambert@
Agreed by many.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.24 09-Oct-2007 krw

MALLOC+memset(,0,) -> malloc+M_ZERO. Don't forget FREE->free this time.


Revision tags: OPENBSD_4_2_BASE
# 1.23 17-Jun-2007 jasper

ansify/de-register.
no binary change


# 1.22 01-Jun-2007 deraadt

pedro ok'd this ~3500 line diff which removes the vop argument
"ap = v" comments in under 8 seconds, so it must be ok. and it compiles
too.


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.21 28-Dec-2005 pedro

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


# 1.20 16-Dec-2005 pedro

Fix unsigned < 0 check in ext2fs_readdir(), okay krw@


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.


# 1.18 30-Apr-2005 niallo

Add support for large files (> 4GB).

Automatically converts old filesystems to use this if they are already at
revision 1 (like Linux). Revision 0 filesystems don't get converted (unlike
Linux).

From NetBSD


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE SMP_SYNC_A SMP_SYNC_B
# 1.17 06-Dec-2003 grange

u_int8_t variable can't be > 255; pointed out by Mr. GCC3.
ok millert@


Revision tags: OPENBSD_3_4_BASE
# 1.16 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_3_BASE UBC_SYNC_A
# 1.15 31-Jan-2003 art

File system locking fixups, mostly from NetBSD:
- cache_lookup
move common code from various fs's here
always return with vnode and parent locked
adjust return codes
- PDIRUNLOCK - new flag set if lookup couldn't lock parent vnode
- kernfs and procfs
lock vnode in get_root
don't unlock (again) in kernfs_freevp
fix memory leak in procfs

From tedu@stanford.edu
deraadt@ and various other ok


Revision tags: UBC_SYNC_B
# 1.14 12-Oct-2002 krw

Remove more '\n's from panic() statements. Both trailing and leading.

Diff generated by Chris Kuethe.


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

First round of __P removal in sys


# 1.12 22-Feb-2002 drahn

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


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.11 18-Sep-2001 art

branches: 1.11.4;
More of cleanups, reliability and endianness fixes from NetBSD.


# 1.10 23-Jun-2001 csapuntz

Privatize several vnode operations that are not used by the generic code.


Revision tags: OPENBSD_2_9_BASE
# 1.9 06-Apr-2001 csapuntz

Free the right variable on error


# 1.8 25-Mar-2001 csapuntz

Free the right variable. Thanks to Dawson and team.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.7 26-Apr-2000 jasoni

Support for ext2fs rev. 1 (from NetBSD)


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.6 11-Jan-1999 millert

branches: 1.6.6;
panic prints a newline for you, don't do it in the panic string


Revision tags: OPENBSD_2_4_BASE
# 1.5 28-Jul-1998 millert

Return EINVAL when msg_iovlen or iovcnt <= 0; Make uio_resid unsigned (size_t) and don't return EINVAL if it is < 0 in sys_{read,write}. Remove check for uio_resid < 0 uiomove() now that uio_resid is unsigned and brack remaining panics with #ifdef DIAGNOSTIC. vn_rdwr() must now take a size_t * as its 9th argument so change that and clean up uses of vn_rdwr(). Fixes 549 + more


Revision tags: OPENBSD_2_3_BASE
# 1.4 12-Jan-1998 csapuntz

Free cookies correctly in case of error


# 1.3 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.2 12-Jun-1997 downsj

Sync with NetBSD, mostly cosmetic.


# 1.1 30-May-1997 downsj

branches: 1.1.1;
Initial revision


# 1.44 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.43 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_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE OPENBSD_6_3_BASE
# 1.42 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.41 14-Mar-2016 krw

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

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.40 16-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.39 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.38 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


Revision tags: OPENBSD_5_6_BASE
# 1.37 13-Jul-2014 pelikan

kill fs2hXX/h2fsXX macros with letohXX/htoleXX

The reason being that ext2 structures are little-endian but JBD2 journal
is big-endian. Don't confuse readers by talking about "file system endian".

Some KNF while there.

ok guenther


# 1.36 13-Jul-2014 pelikan

fill in proper sizes in free(9)


# 1.35 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


# 1.34 12-Jul-2014 pelikan

pull dirblock search code from ext2fs_lookup() like FreeBSD has done

ok tedu


# 1.33 11-Jul-2014 pelikan

separate searchslot variables into a structure like FreeBSD

ok guenther


# 1.32 10-Jul-2014 pelikan

prepare for upcoming ext4 read support

Parts of the on-disk inode changed their meaning in order to support bigger
sizes. More flags & prettification. No functional change.

ok guenther


# 1.31 27-May-2014 krw

Zap a bunch of trailing whitespace.


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

replace old bcopy/bzero with standard functions. ok kettenis


# 1.29 13-Aug-2013 guenther

Switch time_t, ino_t, clock_t, and struct kevent's ident and data
members to 64bit types. Assign new syscall numbers for (almost
all) the syscalls that involve the affected types, including anything
with time_t, timeval, itimerval, timespec, rusage, dirent, stat,
or kevent arguments. Add a d_off member to struct dirent and replace
getdirentries() with getdents(), thus immensely simplifying and
accelerating telldir/seekdir. Build perl with -DBIG_TIME.

Bump the major on every single base library: the compat bits included
here are only good enough to make the transition; the T32 compat
option will be burned as soon as we've reached the new world are
are happy with the snapshots for all architectures.

DANGER: ABI incompatibility. Updating to this kernel requires extra
work or you won't be able to login: install a snapshot instead.

Much assistance in fixing userland issues from deraadt@ and tedu@
and build assistance from todd@ and otto@


Revision tags: OPENBSD_5_4_BASE
# 1.28 30-May-2013 guenther

UFS does't do inode numbers >2^32, so use a smaller type internally,
only using ino_t in the VFS layer APIs: vget, readdir, getattr.

otto wrote the original diff for libsa to keep bootblock from overflowing
ok deraadt@ kettenis@


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.27 18-Nov-2010 miod

Make sure readdir cookies are actually allocated with the correct size
(in case eventually we change their type from u_long to something else),
and do not truncate them to 32 bits in the ntfs code.
ok tedu@


# 1.26 23-Sep-2010 oga

The only sensible argument for VOP_* calls that take a struct proc pointer is
curproc. A bunch of callers were passing in 0 (not even NULL, 0) as this
pointer, which was fine until the called vnode function tried to do
something with it. Typically, this code was then copy/pasted to various
parts of the tree.

Accept the facts of life and switch all of these over to passing curproc
for now until the argument can be removed.

Discovered by stsp trying to create a softraid on top of a vnd, which
crashed with a NULL deref in vndioctl.

softraid bits tested by mikeb and jsing. raidframe bits tested by pea,
matthieu and naddy. The rest tested by at least thib, jsing and myself.

ok thib@, jsing@.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.25 09-Jul-2009 thib

Remove the VREF() macro and replaces all instances with a call to verf(),
which is exactly what the macro does.

Macro's that are nothing more then:
#define FUNCTION(arg) function(arg)
are almost always pointless and should go away.

OK blambert@
Agreed by many.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.24 09-Oct-2007 krw

MALLOC+memset(,0,) -> malloc+M_ZERO. Don't forget FREE->free this time.


Revision tags: OPENBSD_4_2_BASE
# 1.23 17-Jun-2007 jasper

ansify/de-register.
no binary change


# 1.22 01-Jun-2007 deraadt

pedro ok'd this ~3500 line diff which removes the vop argument
"ap = v" comments in under 8 seconds, so it must be ok. and it compiles
too.


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.21 28-Dec-2005 pedro

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


# 1.20 16-Dec-2005 pedro

Fix unsigned < 0 check in ext2fs_readdir(), okay krw@


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.


# 1.18 30-Apr-2005 niallo

Add support for large files (> 4GB).

Automatically converts old filesystems to use this if they are already at
revision 1 (like Linux). Revision 0 filesystems don't get converted (unlike
Linux).

From NetBSD


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE SMP_SYNC_A SMP_SYNC_B
# 1.17 06-Dec-2003 grange

u_int8_t variable can't be > 255; pointed out by Mr. GCC3.
ok millert@


Revision tags: OPENBSD_3_4_BASE
# 1.16 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_3_BASE UBC_SYNC_A
# 1.15 31-Jan-2003 art

File system locking fixups, mostly from NetBSD:
- cache_lookup
move common code from various fs's here
always return with vnode and parent locked
adjust return codes
- PDIRUNLOCK - new flag set if lookup couldn't lock parent vnode
- kernfs and procfs
lock vnode in get_root
don't unlock (again) in kernfs_freevp
fix memory leak in procfs

From tedu@stanford.edu
deraadt@ and various other ok


Revision tags: UBC_SYNC_B
# 1.14 12-Oct-2002 krw

Remove more '\n's from panic() statements. Both trailing and leading.

Diff generated by Chris Kuethe.


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

First round of __P removal in sys


# 1.12 22-Feb-2002 drahn

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


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.11 18-Sep-2001 art

branches: 1.11.4;
More of cleanups, reliability and endianness fixes from NetBSD.


# 1.10 23-Jun-2001 csapuntz

Privatize several vnode operations that are not used by the generic code.


Revision tags: OPENBSD_2_9_BASE
# 1.9 06-Apr-2001 csapuntz

Free the right variable on error


# 1.8 25-Mar-2001 csapuntz

Free the right variable. Thanks to Dawson and team.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.7 26-Apr-2000 jasoni

Support for ext2fs rev. 1 (from NetBSD)


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.6 11-Jan-1999 millert

branches: 1.6.6;
panic prints a newline for you, don't do it in the panic string


Revision tags: OPENBSD_2_4_BASE
# 1.5 28-Jul-1998 millert

Return EINVAL when msg_iovlen or iovcnt <= 0; Make uio_resid unsigned (size_t) and don't return EINVAL if it is < 0 in sys_{read,write}. Remove check for uio_resid < 0 uiomove() now that uio_resid is unsigned and brack remaining panics with #ifdef DIAGNOSTIC. vn_rdwr() must now take a size_t * as its 9th argument so change that and clean up uses of vn_rdwr(). Fixes 549 + more


Revision tags: OPENBSD_2_3_BASE
# 1.4 12-Jan-1998 csapuntz

Free cookies correctly in case of error


# 1.3 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.2 12-Jun-1997 downsj

Sync with NetBSD, mostly cosmetic.


# 1.1 30-May-1997 downsj

branches: 1.1.1;
Initial revision


Revision tags: OPENBSD_6_0_BASE OPENBSD_6_1_BASE OPENBSD_6_2_BASE
# 1.42 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.41 14-Mar-2016 krw

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

ok beck@ deraadt@


Revision tags: OPENBSD_5_9_BASE
# 1.40 16-Feb-2016 stefan

Convert to uiomove. From Martin Natano.


Revision tags: OPENBSD_5_8_BASE
# 1.39 14-Mar-2015 jsg

Remove some includes include-what-you-use claims don't
have any direct symbols used. Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@


Revision tags: OPENBSD_5_7_BASE
# 1.38 10-Feb-2015 miod

First step towards making uiomove() take a size_t size argument:
- rename uiomove() to uiomovei() and update all its users.
- introduce uiomove(), which is similar to uiomovei() but with a size_t.
- rewrite uiomovei() as an uiomove() wrapper.
ok kettenis@


Revision tags: OPENBSD_5_6_BASE
# 1.37 13-Jul-2014 pelikan

kill fs2hXX/h2fsXX macros with letohXX/htoleXX

The reason being that ext2 structures are little-endian but JBD2 journal
is big-endian. Don't confuse readers by talking about "file system endian".

Some KNF while there.

ok guenther


# 1.36 13-Jul-2014 pelikan

fill in proper sizes in free(9)


# 1.35 12-Jul-2014 tedu

add a size argument to free. will be used soon, but for now default to 0.
after discussions with beck deraadt kettenis.


# 1.34 12-Jul-2014 pelikan

pull dirblock search code from ext2fs_lookup() like FreeBSD has done

ok tedu


# 1.33 11-Jul-2014 pelikan

separate searchslot variables into a structure like FreeBSD

ok guenther


# 1.32 10-Jul-2014 pelikan

prepare for upcoming ext4 read support

Parts of the on-disk inode changed their meaning in order to support bigger
sizes. More flags & prettification. No functional change.

ok guenther


# 1.31 27-May-2014 krw

Zap a bunch of trailing whitespace.


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

replace old bcopy/bzero with standard functions. ok kettenis


# 1.29 13-Aug-2013 guenther

Switch time_t, ino_t, clock_t, and struct kevent's ident and data
members to 64bit types. Assign new syscall numbers for (almost
all) the syscalls that involve the affected types, including anything
with time_t, timeval, itimerval, timespec, rusage, dirent, stat,
or kevent arguments. Add a d_off member to struct dirent and replace
getdirentries() with getdents(), thus immensely simplifying and
accelerating telldir/seekdir. Build perl with -DBIG_TIME.

Bump the major on every single base library: the compat bits included
here are only good enough to make the transition; the T32 compat
option will be burned as soon as we've reached the new world are
are happy with the snapshots for all architectures.

DANGER: ABI incompatibility. Updating to this kernel requires extra
work or you won't be able to login: install a snapshot instead.

Much assistance in fixing userland issues from deraadt@ and tedu@
and build assistance from todd@ and otto@


Revision tags: OPENBSD_5_4_BASE
# 1.28 30-May-2013 guenther

UFS does't do inode numbers >2^32, so use a smaller type internally,
only using ino_t in the VFS layer APIs: vget, readdir, getattr.

otto wrote the original diff for libsa to keep bootblock from overflowing
ok deraadt@ kettenis@


Revision tags: OPENBSD_4_9_BASE OPENBSD_5_0_BASE OPENBSD_5_1_BASE OPENBSD_5_2_BASE OPENBSD_5_3_BASE
# 1.27 18-Nov-2010 miod

Make sure readdir cookies are actually allocated with the correct size
(in case eventually we change their type from u_long to something else),
and do not truncate them to 32 bits in the ntfs code.
ok tedu@


# 1.26 23-Sep-2010 oga

The only sensible argument for VOP_* calls that take a struct proc pointer is
curproc. A bunch of callers were passing in 0 (not even NULL, 0) as this
pointer, which was fine until the called vnode function tried to do
something with it. Typically, this code was then copy/pasted to various
parts of the tree.

Accept the facts of life and switch all of these over to passing curproc
for now until the argument can be removed.

Discovered by stsp trying to create a softraid on top of a vnd, which
crashed with a NULL deref in vndioctl.

softraid bits tested by mikeb and jsing. raidframe bits tested by pea,
matthieu and naddy. The rest tested by at least thib, jsing and myself.

ok thib@, jsing@.


Revision tags: OPENBSD_4_7_BASE OPENBSD_4_8_BASE
# 1.25 09-Jul-2009 thib

Remove the VREF() macro and replaces all instances with a call to verf(),
which is exactly what the macro does.

Macro's that are nothing more then:
#define FUNCTION(arg) function(arg)
are almost always pointless and should go away.

OK blambert@
Agreed by many.


Revision tags: OPENBSD_4_3_BASE OPENBSD_4_4_BASE OPENBSD_4_5_BASE OPENBSD_4_6_BASE
# 1.24 09-Oct-2007 krw

MALLOC+memset(,0,) -> malloc+M_ZERO. Don't forget FREE->free this time.


Revision tags: OPENBSD_4_2_BASE
# 1.23 17-Jun-2007 jasper

ansify/de-register.
no binary change


# 1.22 01-Jun-2007 deraadt

pedro ok'd this ~3500 line diff which removes the vop argument
"ap = v" comments in under 8 seconds, so it must be ok. and it compiles
too.


Revision tags: OPENBSD_3_9_BASE OPENBSD_4_0_BASE OPENBSD_4_1_BASE
# 1.21 28-Dec-2005 pedro

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


# 1.20 16-Dec-2005 pedro

Fix unsigned < 0 check in ext2fs_readdir(), okay krw@


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.


# 1.18 30-Apr-2005 niallo

Add support for large files (> 4GB).

Automatically converts old filesystems to use this if they are already at
revision 1 (like Linux). Revision 0 filesystems don't get converted (unlike
Linux).

From NetBSD


Revision tags: OPENBSD_3_5_BASE OPENBSD_3_6_BASE OPENBSD_3_7_BASE SMP_SYNC_A SMP_SYNC_B
# 1.17 06-Dec-2003 grange

u_int8_t variable can't be > 255; pointed out by Mr. GCC3.
ok millert@


Revision tags: OPENBSD_3_4_BASE
# 1.16 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_3_BASE UBC_SYNC_A
# 1.15 31-Jan-2003 art

File system locking fixups, mostly from NetBSD:
- cache_lookup
move common code from various fs's here
always return with vnode and parent locked
adjust return codes
- PDIRUNLOCK - new flag set if lookup couldn't lock parent vnode
- kernfs and procfs
lock vnode in get_root
don't unlock (again) in kernfs_freevp
fix memory leak in procfs

From tedu@stanford.edu
deraadt@ and various other ok


Revision tags: UBC_SYNC_B
# 1.14 12-Oct-2002 krw

Remove more '\n's from panic() statements. Both trailing and leading.

Diff generated by Chris Kuethe.


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

First round of __P removal in sys


# 1.12 22-Feb-2002 drahn

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


Revision tags: OPENBSD_3_0_BASE UBC_BASE
# 1.11 18-Sep-2001 art

branches: 1.11.4;
More of cleanups, reliability and endianness fixes from NetBSD.


# 1.10 23-Jun-2001 csapuntz

Privatize several vnode operations that are not used by the generic code.


Revision tags: OPENBSD_2_9_BASE
# 1.9 06-Apr-2001 csapuntz

Free the right variable on error


# 1.8 25-Mar-2001 csapuntz

Free the right variable. Thanks to Dawson and team.


Revision tags: OPENBSD_2_7_BASE OPENBSD_2_8_BASE
# 1.7 26-Apr-2000 jasoni

Support for ext2fs rev. 1 (from NetBSD)


Revision tags: OPENBSD_2_5_BASE OPENBSD_2_6_BASE SMP_BASE kame_19991208
# 1.6 11-Jan-1999 millert

branches: 1.6.6;
panic prints a newline for you, don't do it in the panic string


Revision tags: OPENBSD_2_4_BASE
# 1.5 28-Jul-1998 millert

Return EINVAL when msg_iovlen or iovcnt <= 0; Make uio_resid unsigned (size_t) and don't return EINVAL if it is < 0 in sys_{read,write}. Remove check for uio_resid < 0 uiomove() now that uio_resid is unsigned and brack remaining panics with #ifdef DIAGNOSTIC. vn_rdwr() must now take a size_t * as its 9th argument so change that and clean up uses of vn_rdwr(). Fixes 549 + more


Revision tags: OPENBSD_2_3_BASE
# 1.4 12-Jan-1998 csapuntz

Free cookies correctly in case of error


# 1.3 06-Nov-1997 csapuntz

Updates for VFS Lite 2 + soft update.


Revision tags: OPENBSD_2_2_BASE
# 1.2 12-Jun-1997 downsj

Sync with NetBSD, mostly cosmetic.


# 1.1 30-May-1997 downsj

branches: 1.1.1;
Initial revision