From f2ca301bd741e3e3f076cd3f72fcd377bcef2a1a Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Thu, 26 Jan 2017 16:45:51 +0100 Subject: refcount: typecast function for calling on free All of the functions called to free the refcounted structure are doing a typecast from (void*) to their own type taht is being free'd. This really is not needed and the refcount interface is made a little simpler without the requirement of typecasting. With this small improvement in the API, all callers are updated too. Change-Id: I32473b6d1799f62861d4b2d78ea30c09e6c80ab1 BUG: 1416889 Signed-off-by: Niels de Vos Reviewed-on: https://review.gluster.org/16471 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Xavier Hernandez CentOS-regression: Gluster Build System Reviewed-by: Kaleb KEITHLEY --- xlators/features/marker/src/marker-quota-helper.c | 6 ++---- xlators/features/marker/src/marker-quota-helper.h | 3 --- 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'xlators/features') diff --git a/xlators/features/marker/src/marker-quota-helper.c b/xlators/features/marker/src/marker-quota-helper.c index 1fed9df6d6a..e3e218f8af5 100644 --- a/xlators/features/marker/src/marker-quota-helper.c +++ b/xlators/features/marker/src/marker-quota-helper.c @@ -146,11 +146,9 @@ out: return ctx; } -void -mq_contri_fini (void *data) +static void +mq_contri_fini (inode_contribution_t *contri) { - inode_contribution_t *contri = data; - LOCK_DESTROY (&contri->lock); GF_FREE (contri); } diff --git a/xlators/features/marker/src/marker-quota-helper.h b/xlators/features/marker/src/marker-quota-helper.h index bf417aa8241..444ba7ca71e 100644 --- a/xlators/features/marker/src/marker-quota-helper.h +++ b/xlators/features/marker/src/marker-quota-helper.h @@ -66,9 +66,6 @@ mq_local_ref (quota_local_t *); int32_t mq_local_unref (xlator_t *, quota_local_t *); -void -mq_contri_fini (void *data); - inode_contribution_t* mq_contri_init (inode_t *inode); -- cgit