this fixes a problem where elf_mod_sizes() would report size which would
be different (smaller) that the actual size of LKM code to be loaded in some
cases
Reviewed by: Johan Danielsson
-w write in-core label if changed
-r update on-disk as well as in-core label (with -w)
-f force update (-w), even if there's been no change
-r behaviour suggested by matt green. what used to be `-f' is now `-wrf'
gotten bitten by mbrlabel trashing my incore disklabel to a point where
the machine wasn't usable, so I reworked it:
* only update the incore (and on-disk) label if `-f' is given. by default,
the proposed disklabel will be printed but no changes will occur
* add -q, to make the default operation a bit more quiet.
* leave existing `used' in-core partition slots alone, and only add entries
to the incore label if:
- there's not an existing partition of the same size and offset
(even of a different type)
- there's a free partition slot (`unused', with size == 0)
* use DIOCWDINFO instead of DIOCSDINFO, to update the incore as well as
the on-disk label
* use showpartitions() from ../disklabel/printlabel.c
this should make mbrlabel a *lot* more useful.
__CONCAT("foo","bar");
actually works to concantate strings, it's because the preprocessor expands
it into "foo""bar" as separate strings, and then ANSI string concatenation
is performed on that. It's more straightforward to just use ANSI string
concatenation directly, and newer GCCs complain (rightly) about misuse
of token pasting.
effectively an MBR with it's own partition table which contains another
4 `slots', each of which can be another extended partition...
This involved reworking some of the internal functions.
* Use off_t appropriately (so we can manipulate sectors past 4GB).
* Tweak to compile with WARNS=2
authentication for Phase 1 per dratf-ietf-ipsec-isakmp-gss-auth-06.txt.
This work was done by Frank van der Linden of Wasabi Systems, Inc.
under contract from Zembu Labs, Inc.
If sysctl supports it, try to get the kernel name with CPU_BOOTED_KERNEL.
Get current kernels version string in all cases.
Adapt some error messages to the correct kernel name.
Reviewed by Simon Burge.
bandwidth and seek time of the disk, using the "4 * bandwidth * seek
time" formula from Neefe-Matthews' 1997 paper. An RZ25 disk with this
option gets 200K segments. Reference the paper in the manual page.
Don't try to subtract the address of "acg.cg_firstfield" from
"acg.cg_nextfreeoff", as it's already relative to the start of "&acg".
This always worked because the result of the subtraction was
always negative, thus could never be > "sblock.fs_cgsize" ...
Let lfs_cleanerd record its pid in /var/run like other daemons. Make
mount_lfs not start another cleaner when updating the mount, unless it is
being upgraded from read-only to read-write; when downgrading to read-only,
kill the cleaner using the recorded pids.
created and used. Some ramdisks compile individual mount_* commands
directly and hence need the obj dirs setup in order to allow shared
source tree.
Noted in private mail by Andrew Brown <atatat@atatdot.net>.
- keep the case consistent between the actual name and what's referenced.
e.g, if it's `foo', don't use '.Nm Foo' at the start of a sentence.
- remove unnecessary `.Nm foo' after the first occurrence (except for
using `.Nm ""' if there's stuff following, or for the 2nd and so on
occurrences in a SYNOPSIS
- use Sx, Ic, Li, Em, Sq, and Xr as appropriate
- don't warn. It's just too verbose when we know there is
no disklabel and want to use the default filesystem type.
- close the file descriptor so that further mount success.
mount_mfs(8); the mount_*(8) are hardlinked to mount (appropriate mount routine
is called depending on program name) - this saves approx. 1.7MB of /sbin
space
mount.c: make all local symbols static
* make static all symbols which do not need to be exported
* rename main() to mount_FOO()
* new main() now just calls mount_FOO(), main() is only compiled in if
MOUNT_NOMAIN is not defined
* a_gid(), a_uid() and a_mask() were put into ../mount/fattr.[ch], local
versions removed
"component1" and "raidctl -A yes"
- add a note about how to build a RAID set with a limited number of disks
(thanks to Simon Burge for suggestions)
- improve layout of 'raidctl -i' discussion (thanks to Hubert Feyrer)
- add a (small) section on Performance Tuning
for the disklabel if the given device fails with EBUSY. Also make disklabel
errors non fatal (just fall back to ffs as per pre-autofilesystem behaviour)
Based on further discussion with Launey Thomas <ljt@alum.mit.edu>
you need KAME tree to compile this (point the top by ${KAMEROOT}
in Makefile.inc).
XXX maybe too big for /sbin...869K with certificate support, and 574K without
certificate support (i386, stripped, static-link)
Also, change the segment size report to include the total size of the disk,
similar to newfs, e.g.
newfs_lfs -N -F -B 65536 /dev/rsd0b
272.7MB in 4363 segments of size 65536
super-block backups (for fsck -b #) at:
16, 55824, 111632, 167440, 223248, 279056, 334864, 390672, 446480, 502288
Kernel:
* Add runtime quantity lfs_ravail, the number of disk-blocks reserved
for writing. Writes to the filesystem first reserve a maximum amount
of blocks before their write is allowed to proceed; after the blocks
are allocated the reserved total is reduced by a corresponding amount.
If the lfs_reserve function cannot immediately reserve the requested
number of blocks, the inode is unlocked, and the thread sleeps until
the cleaner has made enough space available for the blocks to be
reserved. In this way large files can be written to the filesystem
(or, smaller files can be written to a nearly-full but thoroughly
clean filesystem) and the cleaner can still function properly.
* Remove explicit switching on dlfs_minfreeseg from the kernel code; it
is now merely a fs-creation parameter used to compute dlfs_avail and
dlfs_bfree (and used by fsck_lfs(8) to check their accuracy). Its
former role is better assumed by a properly computed dlfs_avail.
* Bounds-check inode numbers submitted through lfs_bmapv and lfs_markv.
This prevents a panic, but, if the cleaner is feeding the filesystem
the wrong data, you are still in a world of hurt.
* Cleanup: remove explicit references of DEV_BSIZE in favor of
btodb()/dbtob().
lfs_cleanerd:
* Make -n mean "send N segments' blocks through a single call to
lfs_markv". Previously it had meant "clean N segments though N calls
to lfs_markv, before looking again to see if more need to be cleaned".
The new behavior gives better packing of direct data on disk with as
little metadata as possible, largely alleviating the problem that the
cleaner can consume more disk through inefficient use of metadata than
it frees by moving dirty data away from clean "holes" to produce
entirely clean segments.
* Make -b mean "read as many segments as necessary to write N segments
of dirty data back to disk", rather than its former meaning of "read
as many segments as necessary to free N segments worth of space". The
new meaning, combined with the new -n behavior described above,
further aids in cleaning storage efficiency as entire segments can be
written at once, using as few blocks as possible for segment summaries
and inode blocks.
* Make the cleaner take note of segments which could not be cleaned due
to error, and not attempt to clean them until they are entirely free
of dirty blocks. This prevents the case in which a cleanerd running
with -n 1 and without -b (formerly the default) would spin trying
repeatedly to clean a corrupt segment, while the remaining space
filled and deadlocked the filesystem.
* Update the lfs_cleanerd manual page to describe all the options,
including the changes mentioned here (in particular, the -b and -n
flags were previously undocumented).
fsck_lfs:
* Check, and optionally fix, lfs_avail (to an exact figure) and
lfs_bfree (within a margin of error) in pass 5.
newfs_lfs:
* Reduce the default dlfs_minfreeseg to 1/20 of the total segments.
* Add a warning if the sgs disklabel field is 16 (the default for FFS'
cpg, but not usually desirable for LFS' sgs: 5--8 is a better range).
* Change the calculation of lfs_avail and lfs_bfree, corresponding to
the kernel changes mentioned above.
mount_lfs:
* Add -N and -b options to pass corresponding -n and -b options to
lfs_cleanerd.
* Default to calling lfs_cleanerd with "-b -n 4".
[All of these changes were largely tested in the 1.5 branch, with the
idea that they (along with previous un-pulled-up work) could be applied
to the branch while it was still in ALPHA2; however my test system has
experienced corruption on another filesystem (/dev/console has gone
missing :^), and, while I believe this unrelated to the LFS changes, I
cannot with good conscience request that the changes be pulled up.]
searchs (amongst others) are case insensitive.
* in interactive mode (-i), when editing entries display supported disk types
and filesystem types when given `?' (when ``[?]'' appears in the prompt
this feature is supported for the question).
* support `m' as a suffix equivalent to `M'
* in interactive mode, be a bit more sensible about handling errors and EOF
* implement dumpnames(), which takes a char ** and size, and displays
as per ls -F (sorted, listed vertically) but indented by one tab
* don't assume d_typename and d_packname are NUL terminated
* fix up some comments and some warning messages (bad cut & pastos :)
* deprecate deffstypename() and getfstypename()
* be consistent when using sizeof()