diff options
| author | Doug Ledford <dledford@redhat.com> | 2017-07-17 18:26:58 +0300 |
|---|---|---|
| committer | Doug Ledford <dledford@redhat.com> | 2017-07-17 18:26:58 +0300 |
| commit | 3d886aa3be15439e05784ac1cbd4acc2f13c0048 (patch) | |
| tree | 5d7d5943c7f6697e640bdd684a560e9af7942300 /include/linux/inetdevice.h | |
| parent | b6ea01ba3fe9dcb5e08bbd9ed482845582a1e80b (diff) | |
| parent | 5771a8c08880cdca3bfb4a3fc6d309d6bba20877 (diff) | |
| download | linux-3d886aa3be15439e05784ac1cbd4acc2f13c0048.tar.xz | |
Merge tag 'v4.13-rc1' into k.o/for-4.13-rc
Linux v4.13-rc1
Diffstat (limited to 'include/linux/inetdevice.h')
| -rw-r--r-- | include/linux/inetdevice.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index a2e9d6ea1349..fb3f809e34e4 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h @@ -11,6 +11,7 @@ #include <linux/timer.h> #include <linux/sysctl.h> #include <linux/rtnetlink.h> +#include <linux/refcount.h> struct ipv4_devconf { void *sysctl; @@ -22,7 +23,7 @@ struct ipv4_devconf { struct in_device { struct net_device *dev; - atomic_t refcnt; + refcount_t refcnt; int dead; struct in_ifaddr *ifa_list; /* IP ifaddr chain */ @@ -150,8 +151,15 @@ struct in_ifaddr { unsigned long ifa_tstamp; /* updated timestamp */ }; +struct in_validator_info { + __be32 ivi_addr; + struct in_device *ivi_dev; +}; + int register_inetaddr_notifier(struct notifier_block *nb); int unregister_inetaddr_notifier(struct notifier_block *nb); +int register_inetaddr_validator_notifier(struct notifier_block *nb); +int unregister_inetaddr_validator_notifier(struct notifier_block *nb); void inet_netconf_notify_devconf(struct net *net, int event, int type, int ifindex, struct ipv4_devconf *devconf); @@ -212,7 +220,7 @@ static inline struct in_device *in_dev_get(const struct net_device *dev) rcu_read_lock(); in_dev = __in_dev_get_rcu(dev); if (in_dev) - atomic_inc(&in_dev->refcnt); + refcount_inc(&in_dev->refcnt); rcu_read_unlock(); return in_dev; } @@ -233,12 +241,12 @@ void in_dev_finish_destroy(struct in_device *idev); static inline void in_dev_put(struct in_device *idev) { - if (atomic_dec_and_test(&idev->refcnt)) + if (refcount_dec_and_test(&idev->refcnt)) in_dev_finish_destroy(idev); } -#define __in_dev_put(idev) atomic_dec(&(idev)->refcnt) -#define in_dev_hold(idev) atomic_inc(&(idev)->refcnt) +#define __in_dev_put(idev) refcount_dec(&(idev)->refcnt) +#define in_dev_hold(idev) refcount_inc(&(idev)->refcnt) #endif /* __KERNEL__ */ |
