glusterfs
1/*
2Copyright (c) 2018 Red Hat, Inc. <http://www.redhat.com>
3This file is part of GlusterFS.
4
5This file is licensed to you under your choice of the GNU Lesser
6General Public License, version 3 or any later version (LGPLv3 or
7later), or the GNU General Public License, version 2 (GPLv2), in all
8cases as published by the Free Software Foundation.
9*/
10
11#include "cloudsync-common.h"12
13void
14cs_xattrinfo_wipe(cs_local_t *local)15{
16if (local->xattrinfo.lxattr) {17if (local->xattrinfo.lxattr->file_path)18GF_FREE(local->xattrinfo.lxattr->file_path);19
20if (local->xattrinfo.lxattr->volname)21GF_FREE(local->xattrinfo.lxattr->volname);22
23GF_FREE(local->xattrinfo.lxattr);24}25}
26
27void
28cs_local_wipe(xlator_t *this, cs_local_t *local)29{
30if (!local)31return;32
33loc_wipe(&local->loc);34
35if (local->fd) {36fd_unref(local->fd);37local->fd = NULL;38}39
40if (local->stub) {41call_stub_destroy(local->stub);42local->stub = NULL;43}44
45if (local->xattr_req)46dict_unref(local->xattr_req);47
48if (local->xattr_rsp)49dict_unref(local->xattr_rsp);50
51if (local->dlfd)52fd_unref(local->dlfd);53
54if (local->remotepath)55GF_FREE(local->remotepath);56
57cs_xattrinfo_wipe(local);58
59mem_put(local);60}
61