diff options
author | Christophe Varoqui <root@xa-s05.(none)> | 2006-02-13 11:33:31 +0100 |
---|---|---|
committer | Christophe Varoqui <root@xa-s05.(none)> | 2006-02-13 11:33:31 +0100 |
commit | 970c72eee2297c2e53fed3998e8e937e560f9903 (patch) | |
tree | 1a31515eb9e5d7e8981123e8db711d5a6078eaa3 /libmultipath/blacklist.c | |
parent | fc9d721620d70938b378dfb9d820ce5be63c6ba7 (diff) | |
download | multipath-tools-970c72eee2297c2e53fed3998e8e937e560f9903.tar.gz multipath-tools-970c72eee2297c2e53fed3998e8e937e560f9903.tar.bz2 multipath-tools-970c72eee2297c2e53fed3998e8e937e560f9903.zip |
[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.
Diffstat (limited to 'libmultipath/blacklist.c')
-rw-r--r-- | libmultipath/blacklist.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libmultipath/blacklist.c b/libmultipath/blacklist.c index 1bb7277..92ab876 100644 --- a/libmultipath/blacklist.c +++ b/libmultipath/blacklist.c @@ -3,6 +3,8 @@ */ #include <stdio.h> +#include <checkers.h> + #include "memory.h" #include "vector.h" #include "util.h" |