diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-24 01:03:34 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-24 01:03:34 -0400 |
commit | 75a95178dafb5c8d69b4abe45ea746a9cea23142 (patch) | |
tree | 1dbf80c83d9521dcdebc9e670f48da6c1ba34187 /include/net/ax25.h | |
parent | 8531c5ffbca65f6df868637c26e6df6f88bff738 (diff) | |
parent | 0572e3da3ff5c3744b2f606ecf296d5f89a4bbdf (diff) | |
download | blackbird-op-linux-75a95178dafb5c8d69b4abe45ea746a9cea23142.tar.gz blackbird-op-linux-75a95178dafb5c8d69b4abe45ea746a9cea23142.zip |
Merge upstream into 'upstream' branch of netdev-2.6.git.
Hand fix merge conflict in drivers/net/tokenring/Kconfig.
Diffstat (limited to 'include/net/ax25.h')
-rw-r--r-- | include/net/ax25.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/net/ax25.h b/include/net/ax25.h index 828a3a93dda1..3696f988a9f1 100644 --- a/include/net/ax25.h +++ b/include/net/ax25.h @@ -139,11 +139,25 @@ enum { #define AX25_DEF_DS_TIMEOUT (3 * 60 * HZ) /* DAMA timeout 3 minutes */ typedef struct ax25_uid_assoc { - struct ax25_uid_assoc *next; + struct hlist_node uid_node; + atomic_t refcount; uid_t uid; ax25_address call; } ax25_uid_assoc; +#define ax25_uid_for_each(__ax25, node, list) \ + hlist_for_each_entry(__ax25, node, list, uid_node) + +#define ax25_uid_hold(ax25) \ + atomic_inc(&((ax25)->refcount)) + +static inline void ax25_uid_put(ax25_uid_assoc *assoc) +{ + if (atomic_dec_and_test(&assoc->refcount)) { + kfree(assoc); + } +} + typedef struct { ax25_address calls[AX25_MAX_DIGIS]; unsigned char repeated[AX25_MAX_DIGIS]; @@ -376,7 +390,7 @@ extern unsigned long ax25_display_timer(struct timer_list *); /* ax25_uid.c */ extern int ax25_uid_policy; -extern ax25_address *ax25_findbyuid(uid_t); +extern ax25_uid_assoc *ax25_findbyuid(uid_t); extern int ax25_uid_ioctl(int, struct sockaddr_ax25 *); extern struct file_operations ax25_uid_fops; extern void ax25_uid_free(void); |