From: Pete Zaitcev <zaitcev@redhat.com>
To: vitalivanov@gmail.com
Cc: Willy Tarreau <w@1wt.eu>,
gregkh@suse.de, linux-usb-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org, zaitcev@redhat.com
Subject: Re: [2.4 patch] Port of adutux driver from 2.6 kernel to 2.4.
Date: Tue, 16 Oct 2007 10:52:23 -0700 [thread overview]
Message-ID: <20071016105223.a0a8fe8c.zaitcev@redhat.com> (raw)
In-Reply-To: <1192542889.29039.66.camel@dell1.softservecom.com>
On Tue, 16 Oct 2007 16:54:49 +0300, Vitaliy Ivanov <vitalivanov@gmail.com> wrote:
> Again, comments are welcomed.
It looks like you misunderstood why a static lock protects open counts.
This is done so you do not need to worry about in-structure lock which
can be freed together with the structure. Look at this:
> +static int adu_release_internal(struct adu_device *dev)
> +{
> + /* lock this device */
> + down(&dev->sem);
> + /* decrement our usage count for the device */
> + --dev->open_count;
> + if (dev->open_count <= 0) {
> + adu_abort_transfers(dev);
> + dev->open_count = 0;
> + }
> + /* unlock this device */
> + up(&dev->sem);
The dev->sem is entirely unnecessary here. Every time you use
open_count, it's protected by minor_table_mutex. The name is a litte
unfortunate, feel free to rename it.
This is probably a problem in 2.6 as well. I don't know why people keep
writing these things. Someone at Ontrak needs to look into it.
-- Pete
next prev parent reply other threads:[~2007-10-16 17:52 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-14 17:37 Vitaliy Ivanov
2007-10-14 18:25 ` Willy Tarreau
2007-10-14 20:45 ` Vitaliy Ivanov
2007-10-14 22:39 ` Willy Tarreau
2007-10-16 13:54 ` Vitaliy Ivanov
2007-10-16 15:41 ` Willy Tarreau
2007-10-16 17:56 ` Pete Zaitcev
2007-10-16 18:22 ` Vitaliy Ivanov
2007-10-16 18:24 ` Willy Tarreau
2007-10-16 18:24 ` Vitaliy Ivanov
2007-10-17 18:12 ` Vitaliy Ivanov
2007-10-19 15:26 ` Vitaliy Ivanov
2007-10-19 16:53 ` Pete Zaitcev
2007-10-19 17:40 ` Vitaliy Ivanov
2007-10-23 3:45 ` Pete Zaitcev
2007-11-04 14:05 ` Willy Tarreau
2007-11-05 9:32 ` Vitaliy Ivanov
2007-11-05 9:36 ` Willy Tarreau
2007-10-16 17:52 ` Pete Zaitcev [this message]
2007-10-15 17:30 ` Pete Zaitcev
2007-10-15 20:04 ` Vitaliy Ivanov
2007-10-16 13:48 ` Vitaliy Ivanov
2007-10-16 14:59 ` Greg KH
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=20071016105223.a0a8fe8c.zaitcev@redhat.com \
--to=zaitcev@redhat.com \
--cc=gregkh@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
--cc=vitalivanov@gmail.com \
--cc=w@1wt.eu \
/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
Powered by JetHome