Commit Graph

31 Commits

Author SHA1 Message Date
agc 276d62f603 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22308, verified by myself.
2003-08-07 10:04:22 +00:00
itojun 8ff221767c asprintf is easier. plug memory leak 2003-07-13 07:44:33 +00:00
jdolecek 1edd42a9d2 move getmntopts(3) to libutil, build and install also it's manpage
bump libutil minor
adjust individual mount_*/Makefile to use libutil getmntopts(3)
2003-03-22 12:43:57 +00:00
jdolecek 899bce0921 use <> rather than "" for #include mntopts.h 2003-03-22 11:15:45 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
jdolecek e0ef9a798d add 'noatime' to list of supported mount options
fixes PR bin/20411 by KOIE Hidetaka
2003-02-18 13:16:48 +00:00
christos 9f9ee29713 MNT_GETARGS support 2002-09-21 18:43:31 +00:00
lukem 7360d7b6ae Use ${NETBSDSRCDIR}/some/path instead of ${.CURDIR}/../../some/path 2002-08-19 10:16:51 +00:00
wiz f61ef32241 Add -b to getopt argument. Patch from DHOYASHIKI Shinichi in bin/15742. 2002-02-26 15:57:13 +00:00
wiz 73f545bb5b Drop arguments of .Os. 2001-06-05 11:22:41 +00:00
perseant 9683b76b99 Try to prevent running more than one active cleaner on a filesystem at a time.
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.
2000-11-13 22:12:49 +00:00
hubertf cf64122954 xref dump_lfs(8), newfs_lfs(8) in SEE ALSO 2000-11-08 19:40:04 +00:00
jdolecek debb6d80a3 make the code includable into other programs:
* 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
2000-10-30 20:56:57 +00:00
perseant 9c7f8050f4 Various bug-fixes to LFS, to wit:
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.]
2000-09-09 04:49:54 +00:00
perseant e0a29d2563 Read-only mounts should not start cleaning processes. Make it so. 1999-12-08 22:39:25 +00:00
perseant 8847804fc3 Regularize error reporting of mount_* commands for failure of mount(2)
to the form:

	mount_xxx: dev on dir: reason for failure
1999-06-25 19:28:35 +00:00
mycroft f6590b22cd Clean up SYNOPSIS formatting. 1999-03-07 11:02:05 +00:00
fvdl e5bc90f40c Merge with Lite2 + local changes 1998-03-01 02:20:01 +00:00
perry 34a98169f0 macroize BSD, NetBSD, FreeBSD and misc cleanup 1998-02-06 05:54:12 +00:00
christos e230a48b57 CFLAGS->CPPFLAGS 1997-10-10 19:47:50 +00:00
lukem 0b2c959ebd resolve conflicts from lite-2 merge 1997-09-16 12:26:56 +00:00
lukem 313de58d06 * update for WARNS=1
* getopt returns -1 not EOF
* fix .Nm usage
1997-09-15 04:47:17 +00:00
cgd c917dfb5b2 Fix broken uses of Dd. Both the mdoc and mdoc.samples pages agree:
.Dd is supposed to be invoked like:
	.Dd month day, year
e.g. ".Dd January 25, 1989", rather than:
	.Dd "month day, year"
which is what these pages did.
1997-05-29 01:48:05 +00:00
gwr 10e180cc49 Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
1997-05-08 21:11:01 +00:00
gwr 012e528f2e Use .PATH.c: ... 1997-05-06 20:44:56 +00:00
cgd c3877d120c 'const struct' not 'struct const' 1996-04-13 05:35:39 +00:00
jtc 6397db2ddd Add const qualifier to mopts table 1996-04-13 01:30:59 +00:00
cgd 0114e805ce convert to new RCS Id conventions; reduce my headache 1995-03-18 14:54:19 +00:00
cgd 06e2955ff1 specify man pages the new way. 1994-12-22 10:44:04 +00:00
mycroft 0924c7ec2d Import 4.4-Lite version. 1994-06-13 22:50:46 +00:00
mycroft ccfa3742b5 Update from 4.4-Lite, with local changes. 1994-06-08 18:57:30 +00:00