Home | History | Annotate | Download | only in libsa
History log of /src/sys/lib/libsa/open.c
RevisionDateAuthorComments
 1.26  24-Nov-2007  isaki style, indent, and ANSI-fy.
 1.25  11-Dec-2005  christos branches: 1.25.44; 1.25.46; 1.25.52;
merge ktrace-lwp.
 1.24  26-Feb-2005  perry branches: 1.24.4;
nuke trailing whitespace
 1.23  07-Aug-2003  agc branches: 1.23.8; 1.23.10;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.22  01-Feb-2003  dsl branches: 1.22.2;
Beautify a little
 1.21  23-Feb-2002  thorpej Move files[] from open.c to globals.c, so that it's possible to
use libsa in an application where there are no file systems or
devices.
 1.20  30-Mar-2000  augustss branches: 1.20.6; 1.20.8;
Kill some more register declarations.
 1.19  31-Mar-1999  cgd branches: 1.19.8;
Make a bunch of backward-compatible changes to the boot blocks which allow
size to be reduced substantially. (backward compatibility verified
by compiling one of the alpha boot blocks which uses all of the code
before and after, diffing the object files, and manually verifying that
the differences were 'correct'. some differences were "unavoidable,"
it wanting to avoid a double-commit, because e.g. local variables which
were previously used were no longer used.) a README which describes
supported options (or at least the ones mentioned below) is forthcoming.

add support for the preprocessor macro LIBSA_NO_TWIDDLE, which
causes calls to twiddle() to be omitted if it's defined.
add support for the preprocessor macros:
LIBSA_NO_FS_CLOSE
LIBSA_NO_FS_WRITE
LIBSA_NO_FS_SEEK
which, if defined, cause the corresponding file system operations
in the individual file system implementations to be omitted. (note
that all of those macros are not supported by all file systems at
this point. comments were added to individual file system files
to indicate lack of support, and should be cleaned up later. Backward
compatibility options e.g. UFS_NOCLOSE, etc., are supported.)
add support for the preprocessor macro LIBSA_NO_FS_SYMLINK, which
removes support for symbolic links from the file system support
functions. (same notes as for the macros above apply.)
add support for the preprocessor macro LIBSA_FS_SINGLECOMPONENT which
removes all subdirectory and symlink support from the file system
support functions. (same notes as for the macros above apply.)
add support for the preprocessor macro LIBSA_NO_FD_CHECKING, which
causes code relating to libsa file descriptor checks (e.g. range
checking and checking that a file descriptor is valid) to be
omitted if it's defined.
add support for the preprocessor macro LIBSA_NO_RAW_ACCESS, which
causes code relating to raw device access to be omitted if it's
defined.
change some structure copies to use bcopy() instead. that way
use of bcopy vs. memcpy() can easily be selected by
LIBSA_USE_MEMCPY. (without changes like these, you could end up
having both bcopy() and memcpy() included. eventually, all
calls to bcopy should be changed to calls to memcpy() or memmove()
as appropriate -- hopefully never the latter -- with an option to
use bcopy instead.)
add support for the preprocessor macro LIBSA_NO_DISKLABEL_MSGS, which
causes disklabel() to return '1' as msg rather than a string. Can
be used if the boot blocks don't care about the string, and need to
save the space.
add support for the preprocessor macro LIBSA_SINGLE_FILESYSTEM, which
if defined causes all of the file system switch code to be removed.
Its value should be the name of the file system supported by the
boot block, e.g. "ufs" for the FFS file system. calls to the
file system functions open, close, etc., which were previously
done through a function switch are then done via direct invocation
of <fs>_open, <fs>_close, etc. (e.g. ufs_open, ...).
add support for the preprocessor macro LIBSA_SINGLE_DEVICE, which
does the equivalent of LIBSA_SINGLE_FILESYSTEM but for the device
switch table. Device entry pointes are expected to be named
<dev>foo, e.g. the 'strategy' routine used when LIBSA_SINGLE_DEVICE
is set to 'disk' is diskstrategy.
make ufs.c f_nindir array be unsigned ints. the fact that it was signed
caused ufs.c to require signed division routines (which were otherwise
unnecessary for a small boot block).
 1.18  26-Mar-1999  simonb Don't call f_dev->dv_close if it's a null pointer when an open() call
fails.
 1.17  22-Sep-1998  ross Make sure ctags(1) indexes oopen().
 1.16  28-Jan-1997  pk Initialize `f_offset'.
 1.15  25-Jan-1997  cgd Change file system file-open semantics slightly: if file system returns
EINVAL, that error code is ignored, leaving whatever other meaningful
error code that might have previously been returned intact. Stand-alone
file system implementations return EINVAL typically when the file system
is not recognized (i.e. cd9660_open on a UFS file system, ufs_open on a
cd9660 file system, etc.). This meant that if you had multiple file
systems in a file system switch, the first returned ENOENT (because
it recognized the file system type, but the file wasn't there) and
the second returned EINVAL (because it didn't recognize the file system
type), errno would be set to EINVAL. Now it'll be set to ENOENT.

It would probably make sense to have file systems return a special
error code to indicate "this file system is unrecognized," which
could then be special-cased, but that's a fair bit more invasive.
 1.14  22-Jan-1997  cgd define these functions with an 'o' prepended to their names if
__INTERNAL_LIBSA_CREAD is defined (so that they can be used by the
compressed-read code).
 1.13  17-Jan-1997  cgd only call the device close routine on a (fall-through) error if
F_NODEV isn't set in the file flags for the file being opened.
Pointed out by Matthias Drochner in PR 3122. (fix equivalent to
the one he included, but stylistically different.)
 1.12  30-Sep-1996  ws Add support for booting from cd9660 fs
Support directory traversal and symbolic links for nfs booting
Close device when file opening failed
Plug memory leak in ufs code
 1.11  21-Jun-1996  pk Return useful file descriptor when opening a raw device.
 1.10  13-Jan-1996  leo Some files containing more than one function are split. This reduces the
size of the resulting loader. The read_inode() function now returns the
result of the strategy function instead of success in all cases (ufs.c).
Fixes pr#1817
 1.9  19-Sep-1995  thorpej Assume that if devopen() points `file' at a NULL that a raw device was
opened (as opposed to only checking to see if `file' itself is NULL).
 1.8  14-Sep-1995  pk Clear up some size_t/ssize_t confusion.
 1.7  06-Sep-1995  pk Avoid calling device-close routine when open() not completed. Otherwise you
lose if this sequence occurs: open()->devopen()->...->panic()->closeall().
 1.6  22-Apr-1995  cgd various attribute poisoning, don't be as quick to specify size of files[]
 1.5  26-Oct-1994  cgd new RCS ID format.
 1.4  18-Jul-1994  pk branches: 1.4.2;
Avoid descriptor leakage.
 1.3  08-May-1994  brezak branches: 1.3.2;
Standalone networking for network boot loaders.
 1.2  01-Mar-1994  pk set errno.
 1.1  26-Jan-1994  brezak CMU/4.4 stand-alone library
 1.3.2.1  27-Jul-1994  cgd update from trunk.
 1.4.2.2  18-Jul-1994  pk Avoid descriptor leakage.
 1.4.2.1  18-Jul-1994  pk file open.c was added on branch netbsd-1-0 on 1994-07-18 18:41:13 +0000
 1.19.8.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.20.8.1  16-Mar-2002  jdolecek Catch up with -current.
 1.20.6.1  28-Feb-2002  nathanw Catch up to -current.
 1.22.2.4  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.22.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.22.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.22.2.1  03-Aug-2004  skrll Sync with HEAD
 1.23.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.23.8.1  29-Apr-2005  kent sync with -current
 1.24.4.1  07-Dec-2007  yamt sync with head
 1.25.52.1  08-Dec-2007  mjf Sync with HEAD.
 1.25.46.1  09-Jan-2008  matt sync with HEAD
 1.25.44.1  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.

RSS XML Feed