public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: chas williams <chas@cmf.nrl.navy.mil>
Cc: davem@redhat.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][ATM] add reference counting to atm_dev
Date: Wed, 14 May 2003 13:59:49 -0700	[thread overview]
Message-ID: <20030514205949.GA3945@kroah.com> (raw)
In-Reply-To: <200305142020.h4EKK9J01052@relax.cmf.nrl.navy.mil>

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?

thanks,

greg k-h

  parent reply	other threads:[~2003-05-14 20:45 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-14 20:20 [PATCH][ATM] add reference counting to atm_dev chas williams
2003-05-14 20:36 ` David S. Miller
2003-05-14 22:16   ` chas williams
2003-05-15  4:30     ` David S. Miller
2003-05-15 14:39       ` chas williams
2003-05-15 20:10         ` David S. Miller
2003-05-15 20:20           ` chas williams
2003-05-16  0:14             ` David S. Miller
2003-05-16 16:05               ` chas williams
2003-05-16 20:44                 ` David S. Miller
2003-05-16  0:19             ` David S. Miller
2003-05-14 20:59 ` Greg KH [this message]
2003-05-14 21:02   ` David S. Miller
2003-05-14 21:57     ` Greg KH
2003-05-14 22:21   ` chas williams
2003-05-15  5:20     ` Greg KH
2003-05-15 14:32       ` chas williams
2003-05-15 19:09         ` Greg KH
2003-05-15 19:17           ` chas williams
2003-05-20 12:25             ` Duncan Sands
2003-05-16  0:12         ` David S. Miller
2003-05-16 14:40         ` Duncan Sands
2003-05-16 15:39           ` chas williams
2003-05-16 18:48             ` Francois Romieu
2003-05-22 17:59   ` Linux 2.4 scheduler is RTOS-alike? Ming Lei
2003-05-22 20:01   ` Ming Lei
2003-05-22 20:37     ` Elladan
2003-05-22 20:47     ` Elladan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030514205949.GA3945@kroah.com \
    --to=greg@kroah.com \
    --cc=chas@cmf.nrl.navy.mil \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox