Skip to content

Commit

Permalink
meta2: clarify variable name
Browse files Browse the repository at this point in the history
  • Loading branch information
fvennetier authored and AymericDu committed Mar 6, 2018
1 parent a6382fe commit 3836285
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions meta2v2/meta2_filters_action_container.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ meta2_filter_action_purge_container(struct gridd_filter_ctx_s *ctx,
struct meta2_backend_s *m2b = meta2_filter_ctx_get_backend(ctx);
struct oio_url_s *url = meta2_filter_ctx_get_url(ctx);
gint64 *pmaxvers = NULL;
GSList *beans_list = NULL;
GSList *beans_list_list = NULL;

const char *maxvers_str = meta2_filter_ctx_get_param(ctx,
NAME_MSGKEY_MAXVERS);
Expand All @@ -157,13 +157,13 @@ meta2_filter_action_purge_container(struct gridd_filter_ctx_s *ctx,
}

GError *err = meta2_backend_purge_container(m2b, url, pmaxvers,
_bean_list_cb, &beans_list);
_bean_list_cb, &beans_list_list);

for (GSList *l=beans_list; l; l=l->next) {
for (GSList *l = beans_list_list; l; l = l->next) {
_m2b_notify_beans(m2b, url, l->data, "content.deleted", TRUE);
_bean_cleanl2(l->data);
}
g_slist_free(beans_list);
g_slist_free(beans_list_list);

if (!err)
return FILTER_OK;
Expand Down
9 changes: 5 additions & 4 deletions meta2v2/meta2_filters_action_content.c
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ meta2_filter_action_purge_content(struct gridd_filter_ctx_s *ctx,
struct meta2_backend_s *m2b = meta2_filter_ctx_get_backend(ctx);
struct oio_url_s *url = meta2_filter_ctx_get_url(ctx);
gint64 *pmaxvers = NULL;
GSList *beans_list = NULL;
GSList *beans_list_list = NULL;

const char *maxvers_str = meta2_filter_ctx_get_param(ctx,
NAME_MSGKEY_MAXVERS);
Expand All @@ -625,14 +625,15 @@ meta2_filter_action_purge_content(struct gridd_filter_ctx_s *ctx,
pmaxvers = &maxvers;
}

// Here we are abusing _bean_list_cb with a list of lists of beans
GError *err = meta2_backend_purge_alias(m2b, url, pmaxvers,
_bean_list_cb, &beans_list);
_bean_list_cb, &beans_list_list);

for (GSList *l=beans_list; l; l=l->next) {
for (GSList *l = beans_list_list; l; l = l->next) {
_m2b_notify_beans(m2b, url, l->data, "content.deleted", TRUE);
_bean_cleanl2(l->data);
}
g_slist_free(beans_list);
g_slist_free(beans_list_list);

if (!err)
return FILTER_OK;
Expand Down
5 changes: 3 additions & 2 deletions meta2v2/meta2_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,9 @@ GError* m2db_get_storage_policy(struct sqlx_sqlite3_s *sq3, struct oio_url_s *ur
* @param retention_delay Delay in seconds before actually purging
* a deleted alias (use -1 to keep all deleted aliases)
* @param flags: M2V2_DRYRUN_MODE, ...
* @param cb: callback for chunks that have been removed from
* the database, and that should be removed from disk
* @param cb: callback for lists of beans (one list per alias)
* that have been removed from the database,
* and that should be notified
* @param u0: argument for the callback
* @return
*/
Expand Down

0 comments on commit 3836285

Please sign in to comment.