Commit Graph

16 Commits

Author SHA1 Message Date
Tom Marshall 2fab692cdf Implement cbd tune plus some cleanup and rearranging
Still need to implement cbd tune --repack.
2019-11-18 00:47:10 +01:00
Tom Marshall b169a0fbcc Add zone lazy init and do more cleanup
* Add lazy init logic to cb format.  Override with --full-init.
 * Make cbd check lazy init aware.
 * Fix up a bunch of size calculation errors.
 * Add pblk validity check in lbd_flush, lbd_read.
2019-11-16 18:39:03 +01:00
Tom Marshall 6e92d5071a Fix variable pblk len, cleanup, rearrange
This is tested with the performance profile and works.

Lots of cleanup and rearranging also.
2019-11-13 15:36:33 -08:00
Tom Marshall 8229ef90bd Make pblk len variable, add format profiles, and cleanup 2019-11-12 23:49:36 +01:00
Tom Marshall efc83e0dc2 Rename [pl]blk_alloc to [pl]blk_used
Also a bit of minor cleanup.
2019-11-12 14:57:06 +01:00
Tom Marshall ceb0eb3230 Make cbd check actually do a check and do some cleanup
* cbd check now works (ish).
 * Added full-check arg to cbd check, link with liblz4, libz.
 * Added libcbd/util.c with goodies like verbose, ask_user_bool.
 * Rework kernel side params, stats to separate from user space.
 * Lock kernel stats when updating.
 * Add lblk_used to stats.

... and probably some other forgotten things.
2019-11-11 20:48:46 +01:00
Tom Marshall f37155f527 Add flags to header
Initial flag definition includes dirty flag.

Also remove unused pblk_read().

Also add pbat-len arg to format.
2019-11-04 11:36:12 -08:00
Tom Marshall 7a743a7e65 Rewrite lbatview_elem_realloc
* Only touch the data we need to touch.
 * Handle failure gracefully by reverting to old data.
 * Adjust libcbd check_one_lblk to ignore unused allocs.
2019-11-03 08:15:43 -08:00
Tom Marshall f8361d1e2e First fully working version 2019-10-25 10:03:00 -07:00
Tom Marshall 495d191d16 checkpoint: Mostly working
This seems to work except for I/O timing.  Reads are sync and
writes are async, so this sequence fails:
  - Object x flushes
  - Object x is reused as y
  - Another object is taken as x
  - New object x reads
  -> Stale data is read

Two potential solutions from here:

1. Implement async reads.

2. Hold ref to object until write completes.

(1) is complicated, but more correct.  Writes may stay in buffers for
quite some time (typically 5 seconds), during which time the dm-compress
object cannot be released.
2019-10-21 19:39:27 -07:00
Tom Marshall 8ff29f0262 Rename [pl]blk_alloc to [pl]bat 2019-10-11 08:28:37 -07:00
Tom Marshall 07f4221a5f Fix a bunch of things
* Fix command line handling.
* Move option/parameter validation to libcbd.
* Make resize argument the logical size.
* Make blkdev_pblk_* take dm_compress instead of block_device.
* Reinstate dm_compress.io_failed.
* Other misc stuff.
2019-10-10 13:27:37 -07:00
Tom Marshall b675fe573a Pass buffer to elem rather than alloc in lblk_alloc_elem_{get,put}
This will assist in {read,writ}ing only the needed lblk alloc pages.
2019-10-09 11:57:57 -07:00
Tom Marshall 6dfb8997a8 libcbd/check.c: Rename alloc to elem 2019-10-09 11:45:30 -07:00
Tom Marshall 0ca9fc789f Rename some stuff and limit LBLK_SHIFT_MAX 2019-10-09 11:32:36 -07:00
Tom Marshall 2e18584af3 Initial working version
Slow but seems functional.
2019-10-09 11:04:40 -07:00