Home | History | Annotate | Download | only in libsa
History log of /src/sys/lib/libsa/cread.c
RevisionDateAuthorComments
 1.29  14-Jun-2023  rin Add /* FALLTHROUGH */ comment for sure.
 1.28  17-Jan-2016  tsutsui Add an option (LIBSA_CREAD_NOCRC) to disable gunzip CRC32 calculation.

No obvious sideeffect on booting i386 GENERIC kernels (without the option).
Closes PR/50638 (Extreme slowness on loading gzipped kernels on old CPUs).
 1.27  25-Jul-2015  isaki white space -> tab.
 1.26  13-Oct-2013  joerg branches: 1.26.6;
Let's not use uninitialized variables to write to random memory
locations, shall we?
 1.25  11-Oct-2013  pgoyette Rework previous (1.24) change. Rather than depending on the
file's flags to decide if decompress cleanup is needed, just
check to see if the open() allocated the 'struct sd *' used for
decompression.

This fixes recent problem where presence of a "load=ffs" command
in my /boot.cfg resulted in a "heap full" error at boot time.

OK martin@
 1.24  14-Apr-2013  martin branches: 1.24.4;
Make the check in close() for a non-deflatable file mode symetric to
the one in open().
Avoids dealloc() calls on NULL.
 1.23  25-Mar-2009  tls branches: 1.23.12; 1.23.22;
Fix build problems caused by crc32 addition to libkern. Also, this makes
the i386 bootblocks about 2K smaller than they were before we monkeyed
with crc32 at all.
 1.22  17-Jan-2009  tsutsui branches: 1.22.2;
Remove __P().
 1.21  25-Mar-2008  christos branches: 1.21.4; 1.21.12; 1.21.14; 1.21.20;
- use mem* instead of b* routines, and kill the b* routines.
- use the mem* routines from libc.
XXX: There will be some lossage, but I am fixing it.
 1.20  02-Dec-2007  tsutsui branches: 1.20.14;
unsigned -> unsigned int
 1.19  24-Nov-2007  isaki style, indent, and ANSI-fy.
 1.18  25-Jan-2006  christos branches: 1.18.42; 1.18.44; 1.18.50;
free -> dealloc
 1.17  14-Jan-2006  christos Don't include zlib.h directly; redirect through libz.h; this mirrors how
libkern is done and let's us abstract where the real zlib.h is kept.
 1.16  11-Dec-2005  christos branches: 1.16.2;
merge ktrace-lwp.
 1.15  24-Mar-2004  drochner branches: 1.15.16;
remove license clauses 3 and 4 from my cpoyright notices
 1.14  18-Mar-2003  mycroft branches: 1.14.2;
Move some stuff into .rodata.
 1.13  26-Nov-2000  simonb Fix tyop in comment.
 1.12  03-Feb-2000  drochner cosmetics: remove double semicolon, whitespace
 1.11  13-Nov-1999  thorpej Backout my libsa changes.
 1.10  11-Nov-1999  thorpej Update for the improvements to libsa, and don't reference libkern.h.
 1.9  31-Mar-1999  cgd branches: 1.9.8; 1.9.10; 1.9.14;
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.8  12-Feb-1999  drochner That got broken in KNFifying.
 1.7  11-Feb-1999  pk Add missing prototypes and KNF the lot.
 1.6  18-Oct-1997  cjs Change sd.transparent to sd.compressed, so that we default to non-
compressed mode when we zero out the structure. Check_header() now
does not force us to uncompressed mode if we read no data (EOF);
it leaves the default, so that if we check at the end of a file,
we don't set the file to uncompressed mode and blow up later lseeks
on it.
 1.5  04-Jul-1997  drochner Catch errors from underlying reads, ie where oread() returns -1.
(Original code used fread() which never returns -1, so this case was
not handled.)
 1.4  26-Jun-1997  drochner Avoid user space headers for standalone programs.
Don't use sys/lib/libkern or sys/lib/libz if not standalone
(ie, user space test programs).
 1.3  13-Jun-1997  drochner Bring prototypes into scope.
 1.2  04-Feb-1997  thorpej In close(), if the file descriptor was used for writing, don't free
data structures that weren't allocated. Fix sanity-checked
by Matthias Drochner.
 1.1  22-Jan-1997  cgd code to open/close/read/lseek gzipped files, from Matthias Drochner.
 1.9.14.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.9.10.1  15-Nov-1999  fvdl Sync with -current
 1.9.8.2  08-Dec-2000  bouyer Sync with HEAD.
 1.9.8.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.14.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.14.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.14.2.1  03-Aug-2004  skrll Sync with HEAD
 1.15.16.2  07-Dec-2007  yamt sync with head
 1.15.16.1  21-Jun-2006  yamt sync with head.
 1.16.2.2  01-Feb-2006  yamt sync with head.
 1.16.2.1  15-Jan-2006  yamt sync with head.
 1.18.50.1  08-Dec-2007  mjf Sync with HEAD.
 1.18.44.1  09-Jan-2008  matt sync with HEAD
 1.18.42.2  03-Dec-2007  joerg Sync with HEAD.
 1.18.42.1  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.20.14.1  03-Apr-2008  mjf Sync with HEAD.
 1.21.20.1  21-Apr-2010  matt sync to netbsd-5
 1.21.14.1  03-May-2009  snj Pull up following revision(s) (requested by tls in ticket #611):
common/dist/zlib/zlib.h: revision 1.3
sys/lib/libkern/crc32.c: revision 1.2
sys/lib/libkern/libkern.h: revision 1.90 via patch
sys/lib/libsa/cread.c: revision 1.23
sys/lib/libz/Makefile: revision 1.16
Fix build problems caused by crc32 addition to libkern. Also, this makes
the i386 bootblocks about 2K smaller than they were before we monkeyed
with crc32 at all.
 1.21.12.2  28-Apr-2009  skrll Sync with HEAD.
 1.21.12.1  19-Jan-2009  skrll Sync with HEAD.
 1.21.4.1  04-May-2009  yamt sync with head.
 1.22.2.1  13-May-2009  jym Sync with HEAD.

Commit is split, to avoid a "too many arguments" protocol error.
 1.23.22.3  03-Dec-2017  jdolecek update from HEAD
 1.23.22.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.23.22.1  23-Jun-2013  tls resync from head
 1.23.12.1  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.24.4.1  18-May-2014  rmind sync with head
 1.26.6.2  19-Mar-2016  skrll Sync with HEAD
 1.26.6.1  22-Sep-2015  skrll Sync with HEAD

RSS XML Feed