diff options
author | Thomas Haller <thaller@redhat.com> | 2019-02-20 13:52:59 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-02-22 10:08:00 +0100 |
commit | 40e0ff9fbfcc21e1ebe5a67bcf59828c12039dce (patch) | |
tree | 9e72dace7a49006a1ab90891a8344badf98f16b2 | |
parent | d431de70acb7688ef769f0e960b5d2413a99584f (diff) | |
download | NetworkManager-40e0ff9fbfcc21e1ebe5a67bcf59828c12039dce.tar.gz |
platform: pass lookup instance to nmp_cache_dirty_set_all() instead of object-type
We already have NMPLookup to express a set of objects that can be looked
up via the multi-index.
Change the behavior of nmp_cache_dirty_set_all(), not to accept an
object-type. Instead, make it generally useful and accept a lookup
instance that is used to filter the elements that should be set as
dirty.
-rw-r--r-- | src/platform/nm-linux-platform.c | 6 | ||||
-rw-r--r-- | src/platform/nmp-object.c | 10 | ||||
-rw-r--r-- | src/platform/nmp-object.h | 3 |
3 files changed, 12 insertions, 7 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index f5f75e3d97..5c81f3666f 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -5205,9 +5205,13 @@ do_request_all_no_delayed_actions (NMPlatform *platform, DelayedActionType actio action_type &= DELAYED_ACTION_TYPE_REFRESH_ALL; FOR_EACH_DELAYED_ACTION (iflags, action_type) { + NMPLookup lookup; + priv->pruning[delayed_action_refresh_all_to_idx (iflags)] = TRUE; + nmp_lookup_init_obj_type (&lookup, + delayed_action_refresh_to_object_type (iflags)); nmp_cache_dirty_set_all (nm_platform_get_cache (platform), - delayed_action_refresh_to_object_type (iflags)); + &lookup); } FOR_EACH_DELAYED_ACTION (iflags, action_type) { diff --git a/src/platform/nmp-object.c b/src/platform/nmp-object.c index aec6838bd7..ba84672a1e 100644 --- a/src/platform/nmp-object.c +++ b/src/platform/nmp-object.c @@ -2920,15 +2920,15 @@ nmp_cache_update_link_master_connected (NMPCache *cache, /*****************************************************************************/ void -nmp_cache_dirty_set_all (NMPCache *cache, NMPObjectType obj_type) +nmp_cache_dirty_set_all (NMPCache *cache, + const NMPLookup *lookup) { - NMPObject obj_needle; - nm_assert (cache); + nm_assert (lookup); nm_dedup_multi_index_dirty_set_head (cache->multi_idx, - _idx_type_get (cache, NMP_CACHE_ID_TYPE_OBJECT_TYPE), - _nmp_object_stackinit_from_type (&obj_needle, obj_type)); + _idx_type_get (cache, lookup->cache_id_type), + &lookup->selector_obj); } /*****************************************************************************/ diff --git a/src/platform/nmp-object.h b/src/platform/nmp-object.h index 4649441bc5..32775efa83 100644 --- a/src/platform/nmp-object.h +++ b/src/platform/nmp-object.h @@ -771,7 +771,8 @@ NMPCacheOpsType nmp_cache_update_link_master_connected (NMPCache *cache, const NMPObject **out_obj_old, const NMPObject **out_obj_new); -void nmp_cache_dirty_set_all (NMPCache *cache, NMPObjectType obj_type); +void nmp_cache_dirty_set_all (NMPCache *cache, + const NMPLookup *lookup); NMPCache *nmp_cache_new (NMDedupMultiIndex *multi_idx, gboolean use_udev); void nmp_cache_free (NMPCache *cache); |