From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Greg KH <greg@kroah.com>
Cc: Tejun Heo <tj@home-tj.org>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2.6.10-rc1 2/5] driver-model: bus_recan_devices() locking fix
Date: Tue, 9 Nov 2004 23:17:31 -0500 [thread overview]
Message-ID: <200411092317.33300.dtor_core@ameritech.net> (raw)
In-Reply-To: <20041110004052.GB8672@kroah.com>
On Tuesday 09 November 2004 07:40 pm, Greg KH wrote:
> > I think we just have lay down the rules that one needs to get a reference
> > to an object in the following cases:
> > - object creation (first reference)
> > - linking some other object to the object in question. Every link to the
> > ? object should increase reference count.
> > - before passing object to another thread of execution to guarantee that
> > ? the object will live long enough for both threads.
>
> The rules are defined. ?See my OLS 2004 paper on krefs for details.
>
So that means you will patches like the one below, right?
--
Dmitry
===================================================================
ChangeSet@1.1964, 2004-11-09 23:14:31-05:00, dtor_core@ameritech.net
Driver core: remove unnecessary get_driver/put_driver from driver.c
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
driver.c | 13 ++-----------
1 files changed, 2 insertions(+), 11 deletions(-)
===================================================================
diff -Nru a/drivers/base/driver.c b/drivers/base/driver.c
--- a/drivers/base/driver.c 2004-11-09 23:16:43 -05:00
+++ b/drivers/base/driver.c 2004-11-09 23:16:43 -05:00
@@ -26,13 +26,7 @@
int driver_create_file(struct device_driver * drv, struct driver_attribute * attr)
{
- int error;
- if (get_driver(drv)) {
- error = sysfs_create_file(&drv->kobj, &attr->attr);
- put_driver(drv);
- } else
- error = -EINVAL;
- return error;
+ return sysfs_create_file(&drv->kobj, &attr->attr);
}
@@ -44,10 +38,7 @@
void driver_remove_file(struct device_driver * drv, struct driver_attribute * attr)
{
- if (get_driver(drv)) {
- sysfs_remove_file(&drv->kobj, &attr->attr);
- put_driver(drv);
- }
+ sysfs_remove_file(&drv->kobj, &attr->attr);
}
next prev parent reply other threads:[~2004-11-10 4:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-04 7:01 [PATCH 2.6.10-rc1 0/5] driver-model: misc bug fixes Tejun Heo
2004-11-04 7:02 ` [PATCH 2.6.10-rc1 1/5] driver-model: comment fix in bus.c Tejun Heo
2004-11-04 18:35 ` Greg KH
2004-11-04 7:02 ` [PATCH 2.6.10-rc1 2/5] driver-model: bus_recan_devices() locking fix Tejun Heo
2004-11-04 18:58 ` Greg KH
2004-11-04 19:12 ` Dmitry Torokhov
2004-11-05 6:14 ` Tejun Heo
2004-11-05 16:33 ` Dmitry Torokhov
2004-11-09 1:27 ` Tejun Heo
2004-11-09 1:43 ` Dmitry Torokhov
2004-11-10 7:13 ` Tejun Heo
2004-11-10 0:40 ` Greg KH
2004-11-10 4:17 ` Dmitry Torokhov [this message]
2004-11-16 5:52 ` Greg KH
2004-11-04 7:03 ` [PATCH 2.6.10-rc1 3/5] driver-model: sysfs_release() dangling pointer reference fix Tejun Heo
2004-11-04 18:59 ` Greg KH
2004-11-04 7:04 ` [PATCH 2.6.10-rc1 4/5] driver-model: kobject_add() error path reference counting fix Tejun Heo
2004-11-04 19:00 ` Greg KH
2004-11-04 7:05 ` [PATCH 2.6.10-rc1 5/5] driver-model: device_add() " Tejun Heo
2004-11-04 20:07 ` 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=200411092317.33300.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@home-tj.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