Commit Graph

18 Commits

Author SHA1 Message Date
pooka 709a4d5bb6 Define syscalls of lfs userspace tools (cleaner, mainly) through
a struct called kernelops, which contains standard system calls
for the normal case and rump system calls for the rump case.

Make it possible to run the lfs cleaner in a library fashion (taking
the quick route with the implementation).
2009-08-06 00:51:55 +00:00
lukem bb15c5ac36 fix WARNS=3 issues;
* sprinkle const
* avoid tests < 0 on unsigned types
* test fwrite() returns nmemb not <0
2009-03-16 00:08:10 +00:00
hannken 5d2bff060a Make sure all cached buffers with valid, not yet written data have been
run through copy-on-write.  Call fscow_run() with valid data where possible.

The LP_UFSCOW hack is no longer needed to protect ffs_copyonwrite() against
endless recursion.

- Add a flag B_MODIFY to bread(), breada() and breadn().  If set the caller
  intends to modify the buffer returned.

- Always run copy-on-write on buffers returned from ffs_balloc().

- Add new function ffs_getblk() that gets a buffer, assigns a new blkno,
  may clear the buffer and runs copy-on-write.  Process possible errors
  from getblk() or fscow_run().  Part of PR kern/38664.

Welcome to 4.99.63

Reviewed by: YAMAMOTO Takashi <yamt@netbsd.org>
2008-05-16 09:21:59 +00:00
martin ce099b4099 Remove clause 3 and 4 from TNF licenses 2008-04-28 20:22:51 +00:00
ad 9c5739f1c6 brelse() now takes two arguments. 2007-10-08 21:41:12 +00:00
perseant 45dc123d6e Be more careful about checking return value of {m,re}alloc().
In determining when to stop reading segments when counting bytes (-b flag),
total the sizes of the blocks we're actually writing instead of assuming
they are all full blocks: many could be fragments or inode blocks.  This
increases the number of segments per Ifile write, markedly improving the
efficiency of the cleaner in the small file case.
2006-05-12 19:33:02 +00:00
christos bfe8a650d3 Coverity CID 2792: Fix memory leaks 2006-04-01 23:53:11 +00:00
perseant 9c75397609 A new version of the cleaner. In general, works about as well as the old
cleaner, but with more legible code.

Includes code for reading and writing to the raw disk device (so that an
unmounted fs could be cleaned), for the use of a single daemon to clean
multiple filesystems to save on resources, and for recording the old
contents of cleaned segments to offline storage for regression testing of
the LFS system as a whole; though these new features are not properly
tested at this point.
2006-03-30 19:10:13 +00:00
christos d05efd58f3 64 bit inode changes. 2005-08-19 02:06:29 +00:00
fvdl 42614ed3f3 Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.
2003-04-02 10:39:19 +00:00
perseant 6f5626d112 Make fs-specific fcntl macros take three arguments (approved wrstuden).
Let LFS use fcntl for cleaner functions.
2003-02-25 23:12:06 +00:00
perseant d5bdd23d68 Convert lfs_cleanerd over to use the new ioctl calls instead of the
lfs syscalls.
2003-02-24 08:48:17 +00:00
fvdl a3ff3a3038 Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.
2003-01-24 21:55:02 +00:00
yamt c2484eff3b - fix memory leak.
- add more error checks.
- spaces -> tab
2002-12-15 08:38:17 +00:00
yamt 84677ad64e fix calculation bugs that prevents coalescing from working properly.
PR 19133.
2002-11-24 08:47:28 +00:00
perseant f4fea25c9f Note each type of failure in clean_inode and provide statistics on
failures as well as successes when a run of clean_all_inodes completes.

Explicitly cast to off_t in get_dinode and get_rawblock, to make sure we
read the right block.
2002-06-14 05:21:21 +00:00
perseant d6e1fa2b25 Don't try to coalesce files that have fewer than NDADDR blocks, due to
a potential problem with cleaning fragments at all.

Better sanity checks when selecting files to coalesce; in particular don't
shift too far left when comparing the number of discontinuities to the log2
of the number of total blocks.

Better log messages: note beginning of coalescing correctly; also take
the log message from add_segment out of "if (debug)" for symmetry with the
"finished segment" message.

Use lfs_bmapv to find the inode, rather than looking it up manually in
the ifile; this should give more up-to-date information, since trolling
through every inode in the fs could take some time.
2002-06-14 00:58:39 +00:00
perseant 8abab7cfc8 First stab at file coalescing. When the cleaner detects that it might
be digging itself deeper into a hole, it forks off a subprocess
that locates files with too many discontinuities and rewrites them, if
there is enough room.

Optionally the user can manually coaleasce files by running with "-c".

The recent change to lfs_markv is required for the coalescer to do anything.

All of "digging itself deeper", "too many discontinuities", and "enough room"
need to be better defined.
2002-06-06 00:56:49 +00:00