[PATCH v2 03/19] libmultipath: checkers: move checker_class definition to checkers.h
Martin Wilck <[email protected]>
| Newsgroups | dev.linux.lists.dm-devel |
|---|---|
| Message-ID | <[email protected]> |
Make the contents of struct checker_class accessible to other code. Signed-off-by: Martin Wilck <[email protected]> Reviewed-by: Benjamin Marzinski <[email protected]> --- libmultipath/checkers.c | 18 ------------------ libmultipath/checkers.h | 20 +++++++++++++++++++- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/libmultipath/checkers.c b/libmultipath/checkers.c index 8a90ade..8f18ca6 100644 --- a/libmultipath/checkers.c +++ b/libmultipath/checkers.c @@ -14,24 +14,6 @@ static const char * const checker_dir = MULTIPATH_DIR; -struct checker_class { - struct list_head node; - void *handle; - int refcount; - int sync; - char name[CHECKER_NAME_LEN]; - int (*check)(struct checker *); - int (*init)(struct checker *); /* to allocate the context */ - int (*mp_init)(struct checker *); /* to allocate the mpcontext */ - void (*free)(struct checker *); /* to free the context */ - void (*reset)(void); /* to reset the global variables */ - void *(*thread)(void *); /* async thread entry point */ - int (*pending)(struct checker *); /* to recheck pending paths */ - bool (*need_wait)(struct checker *); /* checker needs waiting for */ - const char **msgtable; - short msgtable_size; -}; - static const char *checker_state_names[PATH_MAX_STATE] = { [PATH_WILD] = "wild", [PATH_UNCHECKED] = "unchecked", diff --git a/libmultipath/checkers.h b/libmultipath/checkers.h index 2317cd1..694dfa3 100644 --- a/libmultipath/checkers.h +++ b/libmultipath/checkers.h @@ -131,7 +131,25 @@ enum { CHECKER_MSGTABLE_SIZE = 100, /* max msg table size for checkers */ }; -struct checker_class; +struct checker; +struct checker_class { + struct list_head node; + void *handle; + int refcount; + int sync; + char name[CHECKER_NAME_LEN]; + int (*check)(struct checker *); + int (*init)(struct checker *); /* to allocate the context */ + int (*mp_init)(struct checker *); /* to allocate the mpcontext */ + void (*free)(struct checker *); /* to free the context */ + void (*reset)(void); /* to reset the global variables */ + void *(*thread)(void *); /* async thread entry point */ + int (*pending)(struct checker *); /* to recheck pending paths */ + bool (*need_wait)(struct checker *); /* checker needs waiting for */ + const char **msgtable; + short msgtable_size; +}; + struct checker { struct checker_class *cls; int fd; -- 2.54.0