diff --git a/pclsync/pdownload.c b/pclsync/pdownload.c index 925caf4..62132ec 100644 --- a/pclsync/pdownload.c +++ b/pclsync/pdownload.c @@ -561,6 +561,10 @@ static int rename_and_create_local(download_task_t *dt, unsigned char *checksum, return 0; } +static void free_download_range_list(psync_range_list_t *elem) { + pmem_free(PMEM_SUBSYS_DOWNLOAD, elem); +} + static int task_download_file(download_task_t *dt) { binparam params[] = {PAPI_STR("auth", psync_my_auth), PAPI_NUM("fileid", dt->dwllist.fileid)}; diff --git a/pclsync/pfsupload.c b/pclsync/pfsupload.c index 75f6d97..20aa407 100644 --- a/pclsync/pfsupload.c +++ b/pclsync/pfsupload.c @@ -75,6 +75,10 @@ typedef struct { unsigned char status; } fsupload_task_t; +static void free_fsupload_task(fsupload_task_t *elem) { + pmem_free(PMEM_SUBSYS_UPLOAD, elem); +} + static pthread_mutex_t upload_mutex = PTHREAD_MUTEX_INITIALIZER; static pthread_cond_t upload_cond = PTHREAD_COND_INITIALIZER; static uint64_t current_upload_taskid = 0; diff --git a/pclsync/plist.c b/pclsync/plist.c index 62bd187..d893347 100644 --- a/pclsync/plist.c +++ b/pclsync/plist.c @@ -44,6 +44,18 @@ * iterating of the list to reach the half of it. */ +static void free_list_element(psync_list_element_list *elem) { + pmem_free(PMEM_SUBSYS_OTHER, elem); +} + +static void free_list_string(psync_list_string_list *elem) { + pmem_free(PMEM_SUBSYS_OTHER, elem); +} + +static void free_list_num(psync_list_num_list *elem) { + pmem_free(PMEM_SUBSYS_OTHER, elem); +} + void psync_list_sort(psync_list *l, psync_list_compare cmp) { psync_list *ls, *l1, *l2, **tail; unsigned long depth, cnt, i, l1len, l2len; diff --git a/pclsync/pnetlibs.c b/pclsync/pnetlibs.c index 5654044..ecb4457 100644 --- a/pclsync/pnetlibs.c +++ b/pclsync/pnetlibs.c @@ -68,11 +68,20 @@ struct _psync_file_lock_t { char filename[]; }; +static void free_range_list(psync_range_list_t *elem) { + pmem_free(PMEM_SUBSYS_OTHER, elem); +} + +static void free_upload_range_list_net(psync_upload_range_list_t *elem) { + pmem_free(PMEM_SUBSYS_OTHER, elem); +} + typedef struct { unsigned char mbedtls_sha1[PSYNC_SHA1_DIGEST_LEN]; uint32_t adler; } psync_block_checksum; + typedef struct { uint64_t filesize; uint32_t blocksize; @@ -81,17 +90,20 @@ typedef struct { psync_block_checksum blocks[]; } psync_file_checksums; + typedef struct { unsigned long elementcnt; uint32_t elements[]; } psync_file_checksum_hash; + typedef struct { uint64_t filesize; uint32_t blocksize; unsigned char _reserved[12]; } psync_block_checksum_header; + typedef struct { uint64_t off; uint32_t idx; @@ -1051,6 +1063,7 @@ int psync_http_readall(psync_http_socket *http, void *buff, int num) { } } + typedef struct { psync_tree tree; pthread_cond_t *cond; diff --git a/pclsync/ppagecache.c b/pclsync/ppagecache.c index f8c350d..4a49da2 100644 --- a/pclsync/ppagecache.c +++ b/pclsync/ppagecache.c @@ -1866,6 +1866,14 @@ int ppagecache_flush() { return 0; } +static void free_page_waiter(psync_page_waiter_t *elem) { + pmem_free(PMEM_SUBSYS_CACHE, elem); +} + +static void free_crypto_auth_page(psync_crypto_auth_page *elem) { + pmem_free(PMEM_SUBSYS_CACHE, elem); +} + static void ppagecache_flush_timer(psync_timer_t timer, void *ptr) { if (!flushedbetweentimers && (cache_pages_in_hash || cachepages_to_update_cnt)) diff --git a/pclsync/psuggest.c b/pclsync/psuggest.c index 19ce5d4..be70019 100644 --- a/pclsync/psuggest.c +++ b/pclsync/psuggest.c @@ -77,6 +77,10 @@ static uint32_t get_ext_id(const char *ext) { return n; } +static void free_suggested_folder(suggested_folder *elem) { + pmem_free(PMEM_SUBSYS_OTHER, elem); +} + static uint32_t get_extid_type(uint32_t extid) { unsigned long lo, hi, mid; uint32_t n; diff --git a/pclsync/ptimer.c b/pclsync/ptimer.c index 8c0a21f..adea9db 100644 --- a/pclsync/ptimer.c +++ b/pclsync/ptimer.c @@ -87,6 +87,10 @@ PSYNC_NOINLINE static void timer_sleep_detected(time_t lt) { ptimer_notify_exception(); } +static void free_timer(psync_timer_structure_t *elem) { + pmem_free(PMEM_SUBSYS_OTHER, elem); +} + static void timer_check_upper_levels(time_t tmdiv, unsigned long level, unsigned long sh) { psync_list *l1, *l2, *l; diff --git a/pclsync/pupload.c b/pclsync/pupload.c index 9f4f58d..469946f 100644 --- a/pclsync/pupload.c +++ b/pclsync/pupload.c @@ -57,6 +57,7 @@ extern const unsigned char pfile_invalid_chars[]; + typedef struct { psync_list list; psync_fileid_t localfileid; @@ -68,11 +69,13 @@ typedef struct { unsigned char hash[PSYNC_HASH_DIGEST_HEXLEN]; } upload_list_t; + typedef struct { upload_list_t upllist; char filename[]; } upload_task_t; + typedef struct { psync_folderid_t folderid; psync_folderid_t newparentfolderid; @@ -790,6 +793,10 @@ err00: return -1; } +static void free_upload_range_list(psync_upload_range_list_t *elem) { + pmem_free(PMEM_SUBSYS_UPLOAD, elem); +} + static int upload_range(psock_t *api, psync_upload_range_list_t *r, upload_list_t *upload, psync_uploadid_t uploadid, int fd) {