Correct a wrong type cast in llapi_hsm_copytool_fini()
Signed-off-by: JC Lafoucriere <jacques-charles.lafoucriere@cea.fr>
Change-Id: Iebe4a36178afdfad8b99140efd6b3afc8b9eb942
Reviewed-on: http://review.whamcloud.com/5837
Reviewed-by: John Hammond <johnlockwoodhammond@gmail.com>
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
/* HSM copytool interface.
* priv is private state, managed internally by these functions
*/
/* 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);
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);
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);
#include <libcfs/libcfs.h>
#include <lustre/lustreapi.h>
#include <libcfs/libcfs.h>
#include <lustre/lustreapi.h>
+struct hsm_copytool_private *ctdata;
void handler(int signal ) {
psignal(signal, "exiting");
void handler(int signal ) {
psignal(signal, "exiting");
* \param archive_count
* \param archives Which archive numbers this copytool is responsible for
*/
* \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;
{
struct hsm_copytool_private *ct;
int rc;
* killed), the libcfs module will be referenced and unremovable,
* even after Lustre services stop.
*/
* 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;
{
struct hsm_copytool_private *ct;
- ct = (struct hsm_copytool_private *)priv;
if (!ct || (ct->magic != CT_PRIV_MAGIC))
return -EINVAL;
if (!ct || (ct->magic != CT_PRIV_MAGIC))
return -EINVAL;
}
/** Wait for the next hsm_action_list
}
/** 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
*/
* \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;
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)
if (!ct || (ct->magic != CT_PRIV_MAGIC))
return -EINVAL;
if (halh == NULL || msgsize == NULL)