Commit Graph

796 Commits

Author SHA1 Message Date
perseant d51fdbef63 Make sure we hold the uobjlock when checking for dirty pages, in lfs_vflush.
Note that pages can become dirty without our knowing it, anyway; don't
panic if that happens.
2003-03-04 19:19:43 +00:00
perseant 003cfbd545 Don't add dirty blocks to the ifile in lfs_segunlock, if we're trying to
unmount the filesystem.  This avoids a "dirty blocks" panic.
2003-03-04 19:15:26 +00:00
perseant 958a4c008c Don't force all truncations to be synchronous 2003-03-04 19:10:35 +00:00
perseant 9192f047ac Account SEGUSE_ACTIVE correctly so that the automatic segment cleaning
actually happens.

Add a new fcntl call that will write the minimum necessary to checkpoint
(i.e., for on-disk directory structure to be consistent, not including
updates to file data) so that the cleaner can clean segments more quickly
without sacrificing three-way commit for cleaning.
2003-03-02 04:34:30 +00:00
yamt 32a79f1dd0 use pid_t for pid. 2003-03-01 11:20:21 +00:00
perseant cfc73a5fa9 Be careful to always zero pages on truncation/fragment extension,
in the case where the filesystem block size is larger than PAGE_SIZE.
2003-03-01 05:07:51 +00:00
perseant daeb6c37d1 Make lfs_truncate handle file extension correctly, in the LFS_UBC case. 2003-02-28 07:37:56 +00:00
perseant c418e0c4d6 Fix a clrbuf() on an uninitialized pointer. 2003-02-28 07:36:32 +00:00
perseant a94f9407dc Quell a hasty panic in lfs_truncate: on-inode disk addresses can be
different between the beginning and end of the call.
2003-02-28 04:37:07 +00:00
perseant 0b114d4e21 Do roundup and offset arithmetic in 64 bits, to allow >=2G files. 2003-02-27 07:10:27 +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
thorpej eb14e86676 Add a new BUF_INIT() macro which initializes b_dep and b_interlock, and
use it.  This fixes a few places where either b_dep or b_interlock were
not properly initialized.
2003-02-25 20:35:31 +00:00
yamt 2bad134129 fix simplelocks 2003-02-25 13:47:44 +00:00
perseant 95137c8477 Add lfs_ioctl vnode op, with ioctls to take over cleaner system call
functionality (not including segment clean, since that is now done
automatically as checkpoints happen).
2003-02-24 08:42:49 +00:00
simonb 2a4457bd46 Remove assigned-to but not used variable. 2003-02-23 03:32:55 +00:00
perseant 3ab94fed93 Fix a buffer overflow bug in the LFS_UBC case that manifested itself
either as a mysterious UVM error or as "panic: dirty bufs".  Verify
maximum size in lfs_malloc.

Teach lfs_updatemeta and lfs_shellsort about oversized cluster blocks from
lfs_gop_write.

When unwiring pages in lfs_gop_write, deactivate them, under the theory
that the pagedaemon wanted to free them last we knew.
2003-02-23 00:22:33 +00:00
yamt 1dd4645db4 fix simple_lock/unlock mismatches. 2003-02-22 01:52:25 +00:00
perseant fdf4bfe002 Tabify, and fix some comment alignment problems. 2003-02-20 04:27:23 +00:00
yamt 5f444770aa add debug code to lfs_free. 2003-02-19 12:58:53 +00:00
yamt 65fda8e404 workaround for "another flush is..." infinity loop in writerd.
if we're writerd, sleep in lfs_flush until another writer goes away
instead of busy loop in writed.
2003-02-19 12:49:10 +00:00
yamt d9a4f81d1c wire the pages instead of just dequeue'ing them.
advised by Chuck Silvers.
2003-02-19 12:22:51 +00:00
yamt 18e00c1196 init b_interlock. 2003-02-19 12:18:59 +00:00
yamt 2be86f2ff8 acquire v_interlock before calling VOP_PUTPAGES. 2003-02-19 12:02:38 +00:00
yamt 0ad89cf93e init b_interlock. 2003-02-19 12:01:17 +00:00
soren 3291a4522e Make libsa compile again. 2003-02-18 14:58:31 +00:00
perseant e61877243d Make it compile again, grr.... 2003-02-18 02:00:08 +00:00
perseant b397c875ae Add code to UBCify LFS. This is still behind "#ifdef LFS_UBC" for now
(there are still some details to work out) but expect that to go
away soon.  To support these basic changes (creation of lfs_putpages,
lfs_gop_write, mods to lfs_balloc) several other changes were made, to
wit:

* Create a writer daemon kernel thread whose purpose is to handle page
  writes for the pagedaemon, but which also takes over some of the
  functions of lfs_check().  This thread is started the first time an
  LFS is mounted.

* Add a "flags" parameter to GOP_SIZE.  Current values are
  GOP_SIZE_READ, meaning that the call should return the size of the
  in-core version of the file, and GOP_SIZE_WRITE, meaning that it
  should return the on-disk size.  One of GOP_SIZE_READ or
  GOP_SIZE_WRITE must be specified.

* Instead of using malloc(...M_WAITOK) for everything, reserve enough
  resources to get by and use malloc(...M_NOWAIT), using the reserves if
  necessary.  Use the pool subsystem for structures small enough that
  this is feasible.  This also obsoletes LFS_THROTTLE.

And a few that are not strictly necessary:

* Moves the LFS inode extensions off onto a separately allocated
  structure; getting closer to LFS as an LKM.  "Welcome to 1.6O."

* Unified GOP_ALLOC between FFS and LFS.

* Update LFS copyright headers to correct values.

* Actually cast to unsigned in lfs_shellsort, like the comment says.

* Keep track of which segments were empty before the previous
  checkpoint; any segments that pass two checkpoints both dirty and
  empty can be summarily cleaned.  Do this.  Right now lfs_segclean
  still works, but this should be turned into an effectless
  compatibility syscall.
2003-02-17 23:48:08 +00:00
perseant 83adb24145 Allow negative values other than UNASSIGNED to be returned from ufs_bmap;
fixes a bug introduced in the 64-bit daddr_t conversion, that manifests
itself in LFS with kernels compiled with the FFS_EI option.
2003-02-09 03:26:59 +00:00
pk 338f31f581 Make the buffer cache code MP-safe. 2003-02-05 21:38:38 +00:00
perseant 14c17e57b4 Don't call a dirop within a dirop: if lfs_rename is actually deleting
a link, call lfs_remove directly before starting dirop rather than
having ufs_rename do it.
2003-02-03 00:32:35 +00:00
tron f1eeaa9020 Only use MALLOC_DECLARE() in kernel namespace. 2003-02-01 18:34:14 +00:00
thorpej b193480908 Add extensible malloc types, adapted from FreeBSD. This turns
malloc types into a structure, a pointer to which is passed around,
instead of an int constant.  Allow the limit to be adjusted when the
malloc type is defined, or with a function call, as suggested by
Jonathan Stone.
2003-02-01 06:23:35 +00:00
yamt 84d61a1dc4 there's no need to treat VOP_WHITEOUT as dirop
because it modifies only one inode.
2003-01-30 14:18:32 +00:00
yamt 53d6eb47ee don't use daddr_t for segment summary since it's an on-disk structure. 2003-01-29 13:14:33 +00:00
simonb 0adecbd12b Remove variable that is only assigned to but not referenced. 2003-01-29 03:06:40 +00:00
yamt e41d3a6f1c make these compilable with lfs debug options.
(follow daddr_t change)

XXX maybe segment number should be 64bit.
2003-01-27 23:17:56 +00:00
kleink 865868a8b1 Further printf format fixes in the wake of daddr_t.
Note that PRI?64 and long long int arguments aren't made for each other,
nor are %lld and int64_t arguments.
2003-01-27 21:45:52 +00:00
tsutsui daf84696c6 More printf format cleanup to reduce casts. 2003-01-26 06:42:31 +00:00
kleink 4e0e5333ae Fix further printf format warnings for DEBUG, in the wake of daddr_t
having changed.
2003-01-25 23:00:09 +00:00
tron 5067836b9e Use PRId64 instead of hard coding "%lld" to fix build problems under
LP64 ports.
2003-01-25 18:12:31 +00:00
fvdl a138610cac The oldblks and newblks arrays are used to store direct copies of
on-disk block pointers, so they should be int32_t. Error found
by Izumi Tsutsui.
2003-01-25 16:40:28 +00:00
tron 63dda858c6 Fix printf() format strings problems caused by "daddr_t" change. 2003-01-25 12:50:38 +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
thorpej b78f59b443 Merge the nathanw_sa branch. 2003-01-18 08:51:40 +00:00
yamt 03e1a46833 - zerofill struct lfs when allocating it.
- use M_ZERO instead of memset after malloc.
2003-01-12 13:04:52 +00:00
yamt 5f254d46cc backout wrong assertions that i added. 2003-01-08 17:16:52 +00:00
yamt 99d625b53c for lfs_remove/lfs_rmdir, keep removed vnodes marked VDIROP.
(backout parts of rev.1.40)
otherwise, directory structures can be corrupted because checkpoints can
occur via eg. lfs_vflush before parent directory is written.
2003-01-08 17:14:58 +00:00
yamt 69f1c0cb29 in set_dirop/endop, use normal vref/vrele instead of lfs versions
so that we don't miss lfs_inactivate.
2003-01-08 15:43:29 +00:00
yamt ee36fccabb add assertions. 2003-01-08 15:40:54 +00:00
yamt 49d2b56b43 use lfs_unmark_vnode instead of duplicated code fragments. 2003-01-08 15:40:04 +00:00