[lkml]   [2003]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH][ATM] add reference counting to atm_dev
On Wed, May 14, 2003 at 04:20:09PM -0400, chas williams wrote:
> this patch adds a reference count to atm_dev, and a lock to
> protect the members of struct atm_dev. atm_dev_lock is now
> used to protect the atm_dev linked list. atm_find_dev was
> renamed to atm_dev_lookup. atm_dev_hold and atm_dev_release
> were added to manipulate atm_dev's reference count. this
> fixes atm_ioctl()'s troublesome 'global' spinlock. also,
> got rid of the nodev list of 'unlinked' vccs.
> --- linux-2.5.68/include/linux/atmdev.h.004 Fri May 9 08:30:20 2003
> +++ linux-2.5.68/include/linux/atmdev.h Wed May 14 12:40:39 2003
> @@ -331,6 +331,8 @@
> struct k_atm_dev_stats stats; /* statistics */
> char signal; /* signal status (ATM_PHY_SIG_*) */
> int link_rate; /* link rate (default: OC3) */
> + atomic_t refcnt; /* reference count */

Any reason to not just use a struct device here? This is a device,
right? Or at the very least, a kobject would be acceptable.

Please don't roll your own reference counting code, when we've already
gotten a in-kernel version that has been debugged quite well.

Is this going to help us be able to get rid of the MOD_* calls in ATM
drivers soon?


greg k-h
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:35    [W:0.110 / U:0.184 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site