[checkers] API rewrite
authorChristophe Varoqui <root@xa-s05.(none)>
Mon, 13 Feb 2006 10:33:31 +0000 (11:33 +0100)
committerChristophe Varoqui <root@xa-s05.(none)>
Mon, 13 Feb 2006 10:33:31 +0000 (11:33 +0100)
commit970c72eee2297c2e53fed3998e8e937e560f9903
tree1a31515eb9e5d7e8981123e8db711d5a6078eaa3
parentfc9d721620d70938b378dfb9d820ce5be63c6ba7
[checkers] API rewrite

The context handling and the layering were poor, so rewrite.

The users now need to :

- alloc a "struct checker"
- select a checker by name : checker_lookup()
- init own checker instance : checker_get()
- set the path file descriptor to check : checker_set_fd()
- use : checker_check()
- release : checker_put()

Checkers now are asked to provide 3 functions :

- foo_init : alloc and initialize the checker context
- foo_free : free the context
- foo      : the checking function proper

These 3 are registered in a static checkers array, along with the checker
name. Lookups are based on checker name.

The users are all updated :

- checker_get is folded into path (re)discovery
- checker_put is folded into path free/orphan

Additional gains :

- directio is updated to use a context to avoid computations upon each
  check
- checkers code is leaner

Please test and report.
38 files changed:
libcheckers/Makefile
libcheckers/checkers.c [new file with mode: 0644]
libcheckers/checkers.h
libcheckers/directio.c
libcheckers/directio.h [new file with mode: 0644]
libcheckers/emc_clariion.c
libcheckers/emc_clariion.h [new file with mode: 0644]
libcheckers/hp_sw.c
libcheckers/hp_sw.h [new file with mode: 0644]
libcheckers/path_state.h [deleted file]
libcheckers/readsector0.c
libcheckers/readsector0.h [new file with mode: 0644]
libcheckers/selector.c [deleted file]
libcheckers/tur.c
libcheckers/tur.h [new file with mode: 0644]
libmultipath/Makefile
libmultipath/blacklist.c
libmultipath/callout.c
libmultipath/config.c
libmultipath/config.h
libmultipath/configure.c
libmultipath/devmapper.c
libmultipath/dict.c
libmultipath/discovery.c
libmultipath/dmparser.c
libmultipath/hwtable.c
libmultipath/pgpolicies.c
libmultipath/print.c
libmultipath/propsel.c
libmultipath/propsel.h
libmultipath/structs.c
libmultipath/structs.h
libmultipath/structs_vec.c
libmultipath/switchgroup.c
multipath/main.c
multipathd/cli_handlers.c
multipathd/main.c
multipathd/uxlsnr.c