History log of /freebsd-11-stable/stand/libsa/open.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 344291 19-Feb-2019 kevans

MFC r335125-r335127, r335148, r335224

r335125:
libsa: cstyle cleanup for open/close/read/write sources

r335126:
libsa: f_rabuf could be NULL

It is possible that we will not get RA buffer from open(), therefore
we must validate RA.

r335127:
libsa: remobe unneeded check before free()

free() is checking for NULL, remove duplicate check.

r335148:
libsa: open() should use NULL instead of typecasted 0

r335224:
Remove empty directory


# 344289 19-Feb-2019 kevans

MFC r335069-r335071, r335110, r335116: stand housecleaning

r335069:
Remove fail: label. It's unused.

r335070:
Remove unused variables.

[kevans@: removed ufs.c modifications; those depend on ufs rewrite bits]

r335071:
Initialize variables we later free so they aren't used
uninitialized in the error path.
Remove unused variables.

r335110:
Remove redundant defs.mk includes. They aren't needed.

r335116:
Use bool for vargood, since it's a boolean.


# 329145 12-Feb-2018 kevans

MFC r325834,r325997,326502: Move sys/boot to stand/

This is effectively a direct commit to stable/11, due to differences between
stable/11 and head. Changes to DTS in sys/boot/fdt/dts were often
accompanied by kernel changes. Many of these were also risc-v updates that
likely had many more dependencies to MFC.

Because of this, sys/boot/fdt/dts remains as-is while everything else in
sys/boot relocates to stand/.

r325834: Move sys/boot to stand. Fix all references to new location

r325997: Remove empty directories.

r326502: Document the sys/boot -> stand move in hier.7 and the top-level README.


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/Makefile.inc1
/freebsd-11-stable/README
/freebsd-11-stable/lib/libefivar/Makefile
/freebsd-11-stable/release/powerpc/generate-hfs.sh
/freebsd-11-stable/release/tools/vmimage.subr
/freebsd-11-stable/share/examples/bootforth/README
/freebsd-11-stable/share/examples/etc/make.conf
/freebsd-11-stable/share/man/man5/make.conf.5
/freebsd-11-stable/share/man/man7/hier.7
/freebsd-11-stable/share/man/man8/diskless.8
/freebsd-11-stable/stand
/freebsd-11-stable/stand/Makefile
/freebsd-11-stable/stand/Makefile.amd64
/freebsd-11-stable/stand/Makefile.arm
/freebsd-11-stable/stand/Makefile.arm64
/freebsd-11-stable/stand/Makefile.i386
/freebsd-11-stable/stand/Makefile.inc
/freebsd-11-stable/stand/Makefile.mips
/freebsd-11-stable/stand/Makefile.pc98
/freebsd-11-stable/stand/Makefile.powerpc
/freebsd-11-stable/stand/Makefile.sparc64
/freebsd-11-stable/stand/arm
/freebsd-11-stable/stand/arm64
/freebsd-11-stable/stand/common
/freebsd-11-stable/stand/defs.mk
/freebsd-11-stable/stand/efi
/freebsd-11-stable/stand/fdt
/freebsd-11-stable/stand/fdt.mk
/freebsd-11-stable/stand/fdt/Makefile
/freebsd-11-stable/stand/fdt/Makefile.depend
/freebsd-11-stable/stand/fdt/fdt_loader_cmd.c
/freebsd-11-stable/stand/fdt/fdt_platform.h
/freebsd-11-stable/stand/fdt/help.fdt
/freebsd-11-stable/stand/ficl
/freebsd-11-stable/stand/ficl.mk
/freebsd-11-stable/stand/ficl32
/freebsd-11-stable/stand/forth
/freebsd-11-stable/stand/forth/pnp.4th
/freebsd-11-stable/stand/forth/support.4th
/freebsd-11-stable/stand/geli
/freebsd-11-stable/stand/i386
/freebsd-11-stable/stand/i386/Makefile.inc
/freebsd-11-stable/stand/kshim
/freebsd-11-stable/stand/libsa
/freebsd-11-stable/stand/libsa32
/freebsd-11-stable/stand/loader.mk
/freebsd-11-stable/stand/man
/freebsd-11-stable/stand/mips
/freebsd-11-stable/stand/ofw
/freebsd-11-stable/stand/pc98
/freebsd-11-stable/stand/pc98/Makefile.inc
/freebsd-11-stable/stand/powerpc
/freebsd-11-stable/stand/sparc64
/freebsd-11-stable/stand/uboot
/freebsd-11-stable/stand/uboot.mk
/freebsd-11-stable/stand/usb
/freebsd-11-stable/stand/userboot
/freebsd-11-stable/stand/userboot/ficl
/freebsd-11-stable/stand/userboot/libstand
/freebsd-11-stable/stand/userboot/zfs
/freebsd-11-stable/stand/zfs
/freebsd-11-stable/stand/zfs32
/freebsd-11-stable/sys/Makefile
/freebsd-11-stable/sys/boot/Makefile
/freebsd-11-stable/sys/boot/Makefile.amd64
/freebsd-11-stable/sys/boot/Makefile.arm
/freebsd-11-stable/sys/boot/Makefile.arm64
/freebsd-11-stable/sys/boot/Makefile.i386
/freebsd-11-stable/sys/boot/Makefile.inc
/freebsd-11-stable/sys/boot/Makefile.mips
/freebsd-11-stable/sys/boot/Makefile.pc98
/freebsd-11-stable/sys/boot/Makefile.powerpc
/freebsd-11-stable/sys/boot/Makefile.sparc64
/freebsd-11-stable/sys/boot/arm
/freebsd-11-stable/sys/boot/arm64
/freebsd-11-stable/sys/boot/common
/freebsd-11-stable/sys/boot/defs.mk
/freebsd-11-stable/sys/boot/efi
/freebsd-11-stable/sys/boot/fdt.mk
/freebsd-11-stable/sys/boot/fdt/Makefile
/freebsd-11-stable/sys/boot/fdt/Makefile.depend
/freebsd-11-stable/sys/boot/fdt/fdt_loader_cmd.c
/freebsd-11-stable/sys/boot/fdt/fdt_platform.h
/freebsd-11-stable/sys/boot/fdt/help.fdt
/freebsd-11-stable/sys/boot/ficl
/freebsd-11-stable/sys/boot/ficl.mk
/freebsd-11-stable/sys/boot/ficl32
/freebsd-11-stable/sys/boot/forth
/freebsd-11-stable/sys/boot/geli
/freebsd-11-stable/sys/boot/i386
/freebsd-11-stable/sys/boot/kshim
/freebsd-11-stable/sys/boot/libsa
/freebsd-11-stable/sys/boot/libsa32
/freebsd-11-stable/sys/boot/loader.mk
/freebsd-11-stable/sys/boot/man
/freebsd-11-stable/sys/boot/mips
/freebsd-11-stable/sys/boot/ofw
/freebsd-11-stable/sys/boot/pc98
/freebsd-11-stable/sys/boot/powerpc
/freebsd-11-stable/sys/boot/sparc64
/freebsd-11-stable/sys/boot/uboot
/freebsd-11-stable/sys/boot/uboot.mk
/freebsd-11-stable/sys/boot/usb
/freebsd-11-stable/sys/boot/userboot
/freebsd-11-stable/sys/boot/zfs
/freebsd-11-stable/sys/boot/zfs32
/freebsd-11-stable/sys/contrib/dev/acpica/acpica_prep.sh
/freebsd-11-stable/tools/boot/universe.sh
/freebsd-11-stable/tools/tools/bootparttest/Makefile
/freebsd-11-stable/tools/tools/zfsboottest/Makefile
/freebsd-11-stable/usr.sbin/bhyveload/Makefile
# 329132 11-Feb-2018 kevans

MFC r324551: Move lib/libstand to sys/boot/libsa


/freebsd-11-stable/lib/libstand
/freebsd-11-stable/sys/boot/libsa/Makefile
/freebsd-11-stable/sys/boot/libsa/Makefile.depend
/freebsd-11-stable/sys/boot/libsa/__main.c
/freebsd-11-stable/sys/boot/libsa/amd64
/freebsd-11-stable/sys/boot/libsa/arp.c
/freebsd-11-stable/sys/boot/libsa/assert.c
/freebsd-11-stable/sys/boot/libsa/bcd.c
/freebsd-11-stable/sys/boot/libsa/bootp.c
/freebsd-11-stable/sys/boot/libsa/bootp.h
/freebsd-11-stable/sys/boot/libsa/bootparam.c
/freebsd-11-stable/sys/boot/libsa/bootparam.h
/freebsd-11-stable/sys/boot/libsa/bzipfs.c
/freebsd-11-stable/sys/boot/libsa/cd9660.c
/freebsd-11-stable/sys/boot/libsa/close.c
/freebsd-11-stable/sys/boot/libsa/closeall.c
/freebsd-11-stable/sys/boot/libsa/dev.c
/freebsd-11-stable/sys/boot/libsa/dosfs.c
/freebsd-11-stable/sys/boot/libsa/dosfs.h
/freebsd-11-stable/sys/boot/libsa/environment.c
/freebsd-11-stable/sys/boot/libsa/ether.c
/freebsd-11-stable/sys/boot/libsa/ext2fs.c
/freebsd-11-stable/sys/boot/libsa/fstat.c
/freebsd-11-stable/sys/boot/libsa/getopt.c
/freebsd-11-stable/sys/boot/libsa/gets.c
/freebsd-11-stable/sys/boot/libsa/globals.c
/freebsd-11-stable/sys/boot/libsa/gzipfs.c
/freebsd-11-stable/sys/boot/libsa/i386
/freebsd-11-stable/sys/boot/libsa/in_cksum.c
/freebsd-11-stable/sys/boot/libsa/inet_ntoa.c
/freebsd-11-stable/sys/boot/libsa/ioctl.c
/freebsd-11-stable/sys/boot/libsa/iodesc.h
/freebsd-11-stable/sys/boot/libsa/ip.c
/freebsd-11-stable/sys/boot/libsa/libstand.3
/freebsd-11-stable/sys/boot/libsa/lseek.c
/freebsd-11-stable/sys/boot/libsa/mips
/freebsd-11-stable/sys/boot/libsa/nandfs.c
/freebsd-11-stable/sys/boot/libsa/net.c
/freebsd-11-stable/sys/boot/libsa/net.h
/freebsd-11-stable/sys/boot/libsa/netif.c
/freebsd-11-stable/sys/boot/libsa/netif.h
/freebsd-11-stable/sys/boot/libsa/nfs.c
/freebsd-11-stable/sys/boot/libsa/nfsv2.h
/freebsd-11-stable/sys/boot/libsa/nullfs.c
/freebsd-11-stable/sys/boot/libsa/open.c
/freebsd-11-stable/sys/boot/libsa/pager.c
/freebsd-11-stable/sys/boot/libsa/pkgfs.c
/freebsd-11-stable/sys/boot/libsa/powerpc
/freebsd-11-stable/sys/boot/libsa/printf.c
/freebsd-11-stable/sys/boot/libsa/qdivrem.c
/freebsd-11-stable/sys/boot/libsa/quad.h
/freebsd-11-stable/sys/boot/libsa/random.c
/freebsd-11-stable/sys/boot/libsa/rarp.c
/freebsd-11-stable/sys/boot/libsa/read.c
/freebsd-11-stable/sys/boot/libsa/readdir.c
/freebsd-11-stable/sys/boot/libsa/rpc.c
/freebsd-11-stable/sys/boot/libsa/rpc.h
/freebsd-11-stable/sys/boot/libsa/rpcv2.h
/freebsd-11-stable/sys/boot/libsa/saioctl.h
/freebsd-11-stable/sys/boot/libsa/sbrk.c
/freebsd-11-stable/sys/boot/libsa/sparc64
/freebsd-11-stable/sys/boot/libsa/splitfs.c
/freebsd-11-stable/sys/boot/libsa/stand.h
/freebsd-11-stable/sys/boot/libsa/stat.c
/freebsd-11-stable/sys/boot/libsa/strcasecmp.c
/freebsd-11-stable/sys/boot/libsa/strdup.c
/freebsd-11-stable/sys/boot/libsa/strerror.c
/freebsd-11-stable/sys/boot/libsa/strtol.c
/freebsd-11-stable/sys/boot/libsa/strtoul.c
/freebsd-11-stable/sys/boot/libsa/tftp.c
/freebsd-11-stable/sys/boot/libsa/tftp.h
/freebsd-11-stable/sys/boot/libsa/twiddle.c
/freebsd-11-stable/sys/boot/libsa/udp.c
/freebsd-11-stable/sys/boot/libsa/ufs.c
/freebsd-11-stable/sys/boot/libsa/uuid_from_string.c
/freebsd-11-stable/sys/boot/libsa/uuid_to_string.c
/freebsd-11-stable/sys/boot/libsa/write.c
/freebsd-11-stable/sys/boot/libsa/zalloc.c
/freebsd-11-stable/sys/boot/libsa/zalloc_defs.h
/freebsd-11-stable/sys/boot/libsa/zalloc_malloc.c
/freebsd-11-stable/sys/boot/libsa/zalloc_mem.h
/freebsd-11-stable/sys/boot/libsa/zalloc_protos.h
# 302408 08-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 289044 08-Oct-2015 marcel

If we can't open the file, skip devclose() for the exclusive_file_system
case. We never called devopen(), so we know there's nothing to close.


# 269308 30-Jul-2014 marcel

Provide a means for loaders to control which file system to use. This
to counteract the default behaviour of always trying each and every
file system until one succeeds, or the open fails. The problem with the
loader is that we've implemented features based on this behavior. The
handling of compressed files is a good example of this. However, it is
in general highly undesirable to not have a one-time probe (or taste
in the geom lingo), followed by something similar to a mount whenever
we (first) read from a device. Everytime we go to the same device, we
can reasonably assume it (still) has the same file system. For file
systems that need to do far more that a trivial read of a super block,
not having something similar to a mount operation is disastrous from
a performance (and thus usability) perspective.

But, again, since we've implemented features based on this stateless
approach, things can get complicated quickly if and when we want to
change this. And yet, we sometimes do need stateful behaviour.

For this reason, this change simply introduces exclusive_file_system.
When set to the fsops of the file system to use, the open call will
only try this file system. Setting it to NULL restores the default
behaviour. It's a low-cost (low-brow?) approach to provide enough
control without re-implementing the guts of the loader.

A good example of when this is useful is when we're trying to load
files out of a container (say, a software packaga) that itself lives
on a file system or is fetched over the network. While opening the
container can be done in the normal stateless manner, once it is
opened, subsequent opens should only consider the container.

Obtained from: Juniper Networks, Inc.


# 198542 28-Oct-2009 brueffer

Initialize f_rabuf in the raw device case. A subsequent close()
later on would try to free it, leading to a crash.

PR: 93998
Submitted by: neel
MFC after: 1 week


# 165906 09-Jan-2007 imp

Remove California Regent's clause 3, per letter


# 84221 30-Sep-2001 dillon

Add __FBSDID()s to libstand


# 65655 10-Sep-2000 ps

Backout last commit. It was wrong.. *sigh*


# 65654 10-Sep-2000 ps

include string.h to silence a warning.


# 65470 05-Sep-2000 msmith

Implement readahead buffering for non-raw files. This drastically improves
the efficiency of byte-by-byte read operations on filesystems not already
supported by the block cache (especially NFS).

This should be a welcome change for users booting via PXE, as the loader
now reads its startup files almost instantly, instead of taking tens of
seconds.


# 39672 26-Sep-1998 dfr

* Enable old UFS compatibility code for booting from Digital Unix formatted
disks.
* Fix a whole raft of warnings, printf and otherwise.
* Make zalloc work for alpha (just a case of using the right typedef).
* Add some (disabled) malloc debug printing to stand.h.


# 38452 20-Aug-1998 msmith

This commit was generated by cvs2svn to compensate for changes in r38451,
which included commits to RCS files with non-trunk default branches.


# 38451 20-Aug-1998 msmith

This is libstand; a support library for standalone executables (eg. bootstrap
modules).
Obtained from: NetBSD, with some architectural changes and many additions.