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 --- api/src/glfs.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'api') diff --git a/api/src/glfs.c b/api/src/glfs.c index 94a12c0be31..a1c8f6f54cb 100644 --- a/api/src/glfs.c +++ b/api/src/glfs.c @@ -583,16 +583,12 @@ pub_glfs_from_glfd (struct glfs_fd *glfd) GFAPI_SYMVER_PUBLIC_DEFAULT(glfs_from_glfd, 3.4.0); -void -glfs_fd_destroy (void *data) +static void +glfs_fd_destroy (struct glfs_fd *glfd) { - struct glfs_fd *glfd = NULL; - - if (!data) + if (!glfd) return; - glfd = (struct glfs_fd *)data; - glfs_lock (glfd->fs, _gf_true); { list_del_init (&glfd->openfds); -- cgit