]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - include/net/fib_rules.h
Merge tag 'platform-drivers-x86-v4.13-1' of git://git.infradead.org/linux-platform...
[karo-tx-linux.git] / include / net / fib_rules.h
index 76c7300626d675bd70374efe45e5608c65f44f84..c487bfa2f47907c8c2f059f3162e33c1d9f43b79 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/slab.h>
 #include <linux/netdevice.h>
 #include <linux/fib_rules.h>
+#include <linux/refcount.h>
 #include <net/flow.h>
 #include <net/rtnetlink.h>
 
@@ -29,7 +30,7 @@ struct fib_rule {
        struct fib_rule __rcu   *ctarget;
        struct net              *fr_net;
 
-       atomic_t                refcnt;
+       refcount_t              refcnt;
        u32                     pref;
        int                     suppress_ifgroup;
        int                     suppress_prefixlen;
@@ -103,12 +104,12 @@ struct fib_rules_ops {
 
 static inline void fib_rule_get(struct fib_rule *rule)
 {
-       atomic_inc(&rule->refcnt);
+       refcount_inc(&rule->refcnt);
 }
 
 static inline void fib_rule_put(struct fib_rule *rule)
 {
-       if (atomic_dec_and_test(&rule->refcnt))
+       if (refcount_dec_and_test(&rule->refcnt))
                kfree_rcu(rule, rcu);
 }