Home | History | Annotate | Download | only in libsa
History log of /src/sys/lib/libsa/ustarfs.c
RevisionDateAuthorComments
 1.37  21-Nov-2019  mrg apply the strncmp hack only to !clang. requested by tnn.
 1.36  21-Nov-2019  mrg from the new comment:

* XXX Hack alert. GCC 8.3 mis-compiles this function and calls
* strncmp() with the wrong second pointer, as seen in PR#54703.
*
* Until the real cause is located, work around it by using -O1
* for this function.

this hack is restricted to i386.
 1.35  20-Mar-2014  christos branches: 1.35.30;
reduce size by 1K by sharing the ls code.
 1.34  25-Dec-2011  tsutsui branches: 1.34.6; 1.34.10;
Apply the following patch submitted by Evgeniy Ivanov:
http://mail-index.NetBSD.org/tech-kern/2011/12/15/msg012226.html
http://mail-index.NetBSD.org/tech-kern/2011/12/17/msg012229.html

- add 'ls' op to struct fs_ops to support ls command on each fs,
enabled by -DLIBSA_ENABLE_LS_OP and SAMISCMAKEFLAGS+="SA_ENABLE_LS_OP=yes"
in libsa
- split sys/lib/libsa/ufs_ls.c into UFS specific part and MI part (ls.c)
that opens the target fs and calls fs-depedent XXX_ls() functions
- add a ls op for ext2fs
(all other fs than ufs and ext2fs don't have actual ls ops yet)
- replace existing MD ufs_ls() calls with this new MI ls()

The original patch was written for i386 and ext2fs.
zaurus zboot has been tested by nonaka@.
ews4800mips and x68k loaders have been tested by me (with several fixes).
landisk might be okay since it was almost copied from i386.

XXX1: "ls" op in fs_ops looks a bit inconsistent, but we will be able to
replace it with real fs ops like readdir if it's really worth
XXX2: someone might have to check sys/arch/ia64/stand/efi/libefi/efifs_ls.c
 1.33  16-Jun-2011  joerg branches: 1.33.2; 1.33.6;
Add an optional MD calling convention flag for use in libsa when space
optimisation is critical. Use this on i386 to switch to register passing
calling convention for the file system entry points and most assembler
call backs that have to preserve at least 3 registers.
 1.32  17-Jan-2009  tsutsui branches: 1.32.12;
Remove __P().
 1.31  24-Nov-2007  isaki branches: 1.31.18; 1.31.26;
style, indent, and ANSI-fy.
 1.30  11-Nov-2007  isaki x68k's floppy is 8*2 sect/cyl, not 18*2 sect/cyl.
 1.29  05-Mar-2007  he branches: 1.29.14; 1.29.16; 1.29.20; 1.29.22;
We need char* for pointer arithmetic.
 1.28  04-Mar-2007  christos Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.27  27-Jan-2006  uwe branches: 1.27.24;
Don't omit int arguments in the K&R style function definitions.
 1.26  25-Jan-2006  christos free -> dealloc
 1.25  11-Dec-2005  christos branches: 1.25.2;
merge ktrace-lwp.
 1.24  26-Feb-2005  perry branches: 1.24.4;
nuke trailing whitespace
 1.23  31-Aug-2003  fvdl branches: 1.23.8; 1.23.10;
Fix signed/unsigned warnings.
 1.22  18-Aug-2003  dsl make 'path' argument to ufs_open 'const char *' and fix the fallout.
 1.21  18-Mar-2003  mycroft branches: 1.21.2;
Move some stuff into .rodata.
 1.20  11-Mar-2003  jmmv After the "insert disk <number>, and press return..." message, check only
for the return keypress.
 1.19  10-May-2002  lukem fix comment
 1.18  30-Mar-2002  matt Add a 1byte pad to make the ustar_t word aligned so the uas_1cyl after it
will also be word aligned. This makes the VAX VMB bootrom happy since it
doesn't support odd-aligned buffers.
 1.17  22-Feb-2002  lukem fix spelos
 1.16  28-Sep-2001  minoura Add changedisk_hook().
Machine-dependent code can eject the floppy to prompt the next volume in it.
(Or add another method in devsw?)
 1.15  02-Oct-2000  lukem branches: 1.15.2; 1.15.4; 1.15.6;
show "press return" instead of "type return", since it's a key name and
not the actual word...
 1.14  13-Nov-1999  thorpej branches: 1.14.4;
Backout my libsa changes.
 1.13  11-Nov-1999  thorpej Update for the improvements to libsa, and don't reference libkern.h.
 1.12  20-Sep-1999  ross branches: 1.12.2; 1.12.4; 1.12.8;
Fix error flow that was broken 10 days ago in the previous commit.
Fixes the broken i386 boot blocks and closes port-i386/8432.
 1.11  10-Sep-1999  ross * Fix the volume zero recognition bug; it was interacting with a
feature to avoid rereads (which was added to work around bugs in
old SRM versions that wouldn't rewind DATs, but would return no
error on rewind callbacks)
* Initialize the volzero signature in ustarfs_open(), rather than as a
side effect of the first read.
* Centralize error retry.
 1.10  01-Sep-1999  ross Fix read retry error case. Closes kern/8300.
While here, add automatic error retry up to 3 times.
 1.9  22-Jun-1999  christos bring back my friend the twiddle.
 1.8  31-Mar-1999  cgd branches: 1.8.4;
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.7  26-Mar-1999  dbj Changes to compile the next68k bootblocks with
egcs -Wpointer-arith -Wstrict-prototypes
This closes pr 6653
 1.6  19-Dec-1998  he Retry ustarfs_cylinder_read after disk change, apparently required on i386.
 1.5  30-Oct-1998  matt Conditionalize include of <lib/libkern/libkern.h> with _STANDALONE (like
libsa/nfs.c does). Fixes VAX libsa build problem.
 1.4  15-Oct-1998  bad Work around gcc warning.
 1.3  15-Oct-1998  ross 1. Avoid snarfing label areas unless necessary; read with monotonically
increasing block numbers and don't reread cylinder 0.

2. Recognize the USTAR.... meta-info file...kind of like a super-block,
it makes the volume size and label info programmable.
 1.2  05-Oct-1998  ross Reserve an 8K label area on every disk, not just the first. Rewrite the block
addressing and disk changing code. Separate disk addressing into three layers.
(virtual: ustar format space spanning volumes, logical: format space relative
to current volume, and physical: standard meaning). Compute a checksum of the
disk 0 8k label area, and define a label for disk 2, 3.... Detect incorrect
disk changing order and attempt to recognize our disk 0 from its checksum.
 1.1  24-Sep-1998  ross tfs -> ustarfs
 1.8.4.1  01-Jul-1999  thorpej Sync w/ -current.
 1.12.8.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.12.4.1  15-Nov-1999  fvdl Sync with -current
 1.12.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.14.4.1  03-Oct-2000  lukem pull up rev 1.15 (approved by thorpej):
fix a prompt to say `press return' instead of `type return'
 1.15.6.1  01-Oct-2001  fvdl Catch up with -current.
 1.15.4.3  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.15.4.2  16-Mar-2002  jdolecek Catch up with -current.
 1.15.4.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.15.2.4  20-Jun-2002  nathanw Catch up to -current.
 1.15.2.3  17-Apr-2002  nathanw Catch up to -current.
 1.15.2.2  28-Feb-2002  nathanw Catch up to -current.
 1.15.2.1  08-Oct-2001  nathanw Catch up to -current.
 1.21.2.4  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.21.2.3  21-Sep-2004  skrll Fix the sync with head I botched.
 1.21.2.2  18-Sep-2004  skrll Sync with HEAD.
 1.21.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.4  07-Dec-2007  yamt sync with head
 1.24.4.3  15-Nov-2007  yamt sync with head.
 1.24.4.2  03-Sep-2007  yamt sync with head.
 1.24.4.1  21-Jun-2006  yamt sync with head.
 1.25.2.1  01-Feb-2006  yamt sync with head.
 1.27.24.1  12-Mar-2007  rmind Sync with HEAD.
 1.29.22.2  08-Dec-2007  mjf Sync with HEAD.
 1.29.22.1  19-Nov-2007  mjf Sync with HEAD.
 1.29.20.1  13-Nov-2007  bouyer Sync with HEAD
 1.29.16.1  09-Jan-2008  matt sync with HEAD
 1.29.14.2  27-Nov-2007  joerg Sync with HEAD. amd64 Xen support needs testing.
 1.29.14.1  11-Nov-2007  joerg Sync with HEAD.
 1.31.26.1  19-Jan-2009  skrll Sync with HEAD.
 1.31.18.1  04-May-2009  yamt sync with head.
 1.32.12.1  23-Jun-2011  cherry Catchup with rmind-uvmplock merge.
 1.33.6.1  18-Feb-2012  mrg merge to -current.
 1.33.2.2  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.33.2.1  17-Apr-2012  yamt sync with head
 1.34.10.1  18-May-2014  rmind sync with head
 1.34.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.35.30.1  08-Apr-2020  martin Merge changes from current as of 20200406

RSS XML Feed