From 4ac1f95a3b5311d40947b4b7d8bb5035c81af318 Mon Sep 17 00:00:00 2001 From: jcl Date: Tue, 12 Feb 2013 10:25:32 +0100 Subject: [PATCH] LU-3025 hsm-llapi: bad type cast in llapi_hsm_copytool_fini() Correct a wrong type cast in llapi_hsm_copytool_fini() Signed-off-by: JC Lafoucriere Change-Id: Iebe4a36178afdfad8b99140efd6b3afc8b9eb942 Reviewed-on: http://review.whamcloud.com/5837 Reviewed-by: John Hammond Reviewed-by: James Nunez Tested-by: Hudson Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/include/lustre/lustreapi.h | 10 ++++++---- lustre/tests/copytool.c | 2 +- lustre/utils/liblustreapi_hsm.c | 16 +++++++--------- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lustre/include/lustre/lustreapi.h b/lustre/include/lustre/lustreapi.h index c500965..80954c8 100644 --- a/lustre/include/lustre/lustreapi.h +++ b/lustre/include/lustre/lustreapi.h @@ -280,11 +280,13 @@ extern int llapi_changelog_clear(const char *mdtname, const char *idstr, /* HSM copytool interface. * priv is private state, managed internally by these functions */ -extern int llapi_hsm_copytool_start(void **priv, char *fsname, int flags, +struct hsm_copytool_private; +extern int llapi_hsm_copytool_start(struct hsm_copytool_private **priv, + char *fsname, int flags, int archive_count, int *archives); -extern int llapi_hsm_copytool_fini(void **priv); -extern int llapi_hsm_copytool_recv(void *priv, struct hsm_action_list **hal, - int *msgsize); +extern int llapi_hsm_copytool_fini(struct hsm_copytool_private **priv); +extern int llapi_hsm_copytool_recv(struct hsm_copytool_private *priv, + struct hsm_action_list **hal, int *msgsize); extern int llapi_hsm_copytool_free(struct hsm_action_list **hal); extern int llapi_hsm_copy_start(char *mnt, struct hsm_copy *copy, const struct hsm_action_item *hai); diff --git a/lustre/tests/copytool.c b/lustre/tests/copytool.c index 9f66168..b877e5b 100644 --- a/lustre/tests/copytool.c +++ b/lustre/tests/copytool.c @@ -55,7 +55,7 @@ #include #include -void *ctdata; +struct hsm_copytool_private *ctdata; void handler(int signal ) { psignal(signal, "exiting"); diff --git a/lustre/utils/liblustreapi_hsm.c b/lustre/utils/liblustreapi_hsm.c index 814ab2c..4d32588 100644 --- a/lustre/utils/liblustreapi_hsm.c +++ b/lustre/utils/liblustreapi_hsm.c @@ -76,8 +76,8 @@ struct hsm_copytool_private { * \param archive_count * \param archives Which archive numbers this copytool is responsible for */ -int llapi_hsm_copytool_start(void **priv, char *fsname, int flags, - int archive_count, int *archives) +int llapi_hsm_copytool_start(struct hsm_copytool_private **priv, char *fsname, + int flags, int archive_count, int *archives) { struct hsm_copytool_private *ct; int rc; @@ -152,11 +152,11 @@ out_err: * killed), the libcfs module will be referenced and unremovable, * even after Lustre services stop. */ -int llapi_hsm_copytool_fini(void **priv) +int llapi_hsm_copytool_fini(struct hsm_copytool_private **priv) { struct hsm_copytool_private *ct; - ct = (struct hsm_copytool_private *)priv; + ct = *priv; if (!ct || (ct->magic != CT_PRIV_MAGIC)) return -EINVAL; @@ -174,21 +174,19 @@ int llapi_hsm_copytool_fini(void **priv) } /** Wait for the next hsm_action_list - * \param priv Opaque private control structure + * \param ct Opaque private control structure * \param halh Action list handle, will be allocated here * \param msgsize Number of bytes in the message, will be set here * \return 0 valid message received; halh and msgsize are set * <0 error code */ -int llapi_hsm_copytool_recv(void *priv, struct hsm_action_list **halh, - int *msgsize) +int llapi_hsm_copytool_recv(struct hsm_copytool_private *ct, + struct hsm_action_list **halh, int *msgsize) { - struct hsm_copytool_private *ct; struct kuc_hdr *kuch; struct hsm_action_list *hal; int rc = 0; - ct = (struct hsm_copytool_private *)priv; if (!ct || (ct->magic != CT_PRIV_MAGIC)) return -EINVAL; if (halh == NULL || msgsize == NULL) -- 1.8.3.1