From caf0eee9a45c6969e099718e51005e97e347fbef Mon Sep 17 00:00:00 2001 From: Bo Zhang Date: Mon, 30 Sep 2024 17:33:14 -0600 Subject: [PATCH] more fix on conditional compilation --- include/gspace.h | 2 ++ include/ss_data.h | 9 ++++----- src/dspaces-server.c | 5 ++++- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/gspace.h b/include/gspace.h index 3fd2e13..67354bb 100644 --- a/include/gspace.h +++ b/include/gspace.h @@ -60,8 +60,10 @@ struct ds_gspace { /* Pending object descriptors for draining. */ struct list_head obj_desc_drain_list; +#ifdef DSPACES_HAVE_FILE_STORAGE /* List of object data for swap out */ struct list_head ls_od_list; +#endif // DSPACES_HAVE_FILE_STORAGE int rank; int size_sp; diff --git a/include/ss_data.h b/include/ss_data.h index bbe922f..5071216 100644 --- a/include/ss_data.h +++ b/include/ss_data.h @@ -66,15 +66,19 @@ struct global_dimension { struct coord sizes; }; +#ifdef DSPACES_HAVE_FILE_STORAGE struct flat_od_list_info { struct list_head entry; int usecnt; }; +#endif // DSPACES_HAVE_FILE_STORAGE struct obj_data { struct list_head obj_entry; +#ifdef DSPACES_HAVE_FILE_STORAGE struct flat_od_list_info flat_list_entry; +#endif // DSPACES_HAVE_FILE_STORAGE obj_descriptor obj_desc; @@ -90,11 +94,6 @@ struct obj_data { /* Flag to mark if we should free this data object. */ unsigned int f_free : 1; - -#ifdef DSPACES_HAVE_FILE_STORAGE - /* Reference to the flat od list in local storage; Used for advanced swap policy */ - struct obj_data_ptr_flat_list_entry* ls_od_entry; -#endif // DSPACES_HAVE_FILE_STORAGE }; struct gdim_list_entry { diff --git a/src/dspaces-server.c b/src/dspaces-server.c index c518410..a70b4b8 100644 --- a/src/dspaces-server.c +++ b/src/dspaces-server.c @@ -402,7 +402,9 @@ static int dsg_alloc(dspaces_provider_t server, const char *conf_name, goto err_free; } +#ifdef DSPACES_HAVE_FILE_STORAGE INIT_LIST_HEAD(&dsg_l->ls_od_list); +#endif // DSPACES_HAVE_FILE_STORAGE // proxy storage dsg_l->ps = ls_alloc(server->conf.max_versions); @@ -2262,7 +2264,9 @@ static void get_rpc(hg_handle_t handle) DEBUG_OUT("found source data object from staging memory\n"); ssd_copy(od, from_obj); DEBUG_OUT("copied object data\n"); +#ifdef DSPACES_HAVE_FILE_STORAGE from_obj->flat_list_entry.usecnt++; +#endif // DSPACES_HAVE_FILE_STORAGE } ABT_mutex_unlock(server->ls_mutex); @@ -2327,7 +2331,6 @@ static void get_rpc(hg_handle_t handle) out.len = csize; /* If we read the od back from the swap space, * then we keep it in the staging memory */ - struct obj_data_ptr_flat_list_entry *od_flat_entry; if(from_obj) { obj_data_free(od); }