dm - Modularize it fully
authorAlex Hornung <ahornung@gmail.com>
Wed, 1 Dec 2010 10:17:55 +0000 (10:17 +0000)
committerAlex Hornung <ahornung@gmail.com>
Wed, 1 Dec 2010 11:40:34 +0000 (11:40 +0000)
commit7115a22b2de523133512d25500721a982187e9eb
treea0040b5f274eacaec260f08e89e162b661ad322e
parent6e0998369185231d66fce4e99b4a37078bd34d7f
dm - Modularize it fully

* Move each of the targets (except error and zero) into a subdirectory
  in targets/.

* Change the macro DM_TARGET_MODULE to also let the module depend on dm.

* Add a new macro DM_TARGET_BUILTIN, which must be used instead of
  DM_TARGET_MODULE for targets that are compiled into the main dm.ko
  instead of a separate module. Not doing this will prevent dm.ko from
  unloading.

* Enable automatic loading of target modules if they aren't builtin or
  loaded yet. Automatically loaded modules can be unloaded via kldunload
  safely via a little hack (see source).

* NOTE: automatic loading doesn't always work. /boot must be mounted
  already, so if you are planning on encrypting your swap or similar
  stuff, you need to *EXPLICITLY* load dm_target_crypt.ko via the
  loader.

* NOTE: PLEASE NOTE THE NOTE ABOVE!

* Fix a little issue with dm_target_crypt that would print "unloaded"
  even if it wouldn't unload.

* Change the name of dm_target_stripe to dm_target_striped, since the
  target is actually called "striped".

* Move dm.h to sys/sys/dm.h

* Get rid of files.dm, a leftover from the import
26 files changed:
sys/conf/files
sys/config/LINT
sys/dev/disk/dm/Makefile
sys/dev/disk/dm/device-mapper.c
sys/dev/disk/dm/dm_dev.c
sys/dev/disk/dm/dm_ioctl.c
sys/dev/disk/dm/dm_pdev.c
sys/dev/disk/dm/dm_table.c
sys/dev/disk/dm/dm_target.c
sys/dev/disk/dm/dm_target_error.c
sys/dev/disk/dm/dm_target_zero.c
sys/dev/disk/dm/doc/TODO [moved from sys/dev/disk/dm/TODO with 100% similarity]
sys/dev/disk/dm/files.dm [deleted file]
sys/dev/disk/dm/targets/Makefile [new file with mode: 0644]
sys/dev/disk/dm/targets/crypt/Makefile [new file with mode: 0644]
sys/dev/disk/dm/targets/crypt/dm_target_crypt.c [moved from sys/dev/disk/dm/dm_target_crypt.c with 99% similarity]
sys/dev/disk/dm/targets/dmirror/Makefile [new file with mode: 0644]
sys/dev/disk/dm/targets/dmirror/dm_target_dmirror.c [moved from sys/dev/disk/dm/dm_target_dmirror.c with 99% similarity]
sys/dev/disk/dm/targets/dmirror/dmirror_notes.txt [moved from sys/dev/disk/dm/dmirror_notes.txt with 100% similarity]
sys/dev/disk/dm/targets/linear/Makefile [new file with mode: 0644]
sys/dev/disk/dm/targets/linear/dm_target_linear.c [moved from sys/dev/disk/dm/dm_target_linear.c with 99% similarity]
sys/dev/disk/dm/targets/mirror/dm_target_mirror.c [moved from sys/dev/disk/dm/dm_target_mirror.c with 100% similarity]
sys/dev/disk/dm/targets/snapshot/dm_target_snapshot.c [moved from sys/dev/disk/dm/dm_target_snapshot.c with 100% similarity]
sys/dev/disk/dm/targets/striped/Makefile [new file with mode: 0644]
sys/dev/disk/dm/targets/striped/dm_target_striped.c [moved from sys/dev/disk/dm/dm_target_stripe.c with 99% similarity]
sys/sys/dm.h [moved from sys/dev/disk/dm/dm.h with 95% similarity]