diff options
author | Holger Eitzenberger <holger@eitzenberger.org> | 2014-11-23 14:40:36 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-11-23 14:58:13 (GMT) |
commit | 0020ba1212caad02841f72d680815e67d7180683 (patch) | |
tree | a38a4c76dfaffc7b17464735f5b2a2f445fe3f7f /include | |
parent | 15178401c264a348677db7a2d8cd041970a1ce72 (diff) | |
download | libnl-0020ba1212caad02841f72d680815e67d7180683.zip libnl-0020ba1212caad02841f72d680815e67d7180683.tar.gz libnl-0020ba1212caad02841f72d680815e67d7180683.tar.bz2 |
cache: avoid duplicate check on initial dump
The cache pickup does a check for duplicates for some time now.
However, the pickup in nl_cache_refill() explicitely clears the
cache, so the pickup doesn't need to actually do the dupe check,
as uniqueness is already guaranteed be Netlink subsystem.
And avoiding the dup check is beneficitial for performance
reasons, as the current algorithm is O(n^2).
http://lists.infradead.org/pipermail/libnl/2014-October/001680.html
Fixes: 96bb7c9a4cdd10a2665c0f56120943e79e33c560
Signed-off-by: Holger Eitzenberger <holger@eitzenberger.org>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/netlink/cache.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/netlink/cache.h b/include/netlink/cache.h index a2b3dbb..71eaceb 100644 --- a/include/netlink/cache.h +++ b/include/netlink/cache.h @@ -78,6 +78,8 @@ extern int nl_cache_refill(struct nl_sock *, struct nl_cache *); extern int nl_cache_pickup(struct nl_sock *, struct nl_cache *); +extern int nl_cache_pickup_checkdup(struct nl_sock *, + struct nl_cache *); extern int nl_cache_resync(struct nl_sock *, struct nl_cache *, change_func_t, |