* [PATCH] remove __MOD_* from dm
@ 2002-12-20 23:38 Greg KH
2002-12-30 14:24 ` [lvm-devel] " Joe Thornber
0 siblings, 1 reply; 2+ messages in thread
From: Greg KH @ 2002-12-20 23:38 UTC (permalink / raw)
To: lvm-devel; +Cc: linux-kernel
Here's another patch against 2.5.52-bk that gets rid of the old __MOD_*
functions for the newer module api. This also allows the modules to be
unloaded.
Joe, please add this to your next round of patches.
thanks,
greg k-h
# DM: convert old __MOD_INC and __MOD_DEC calls to the new style.
diff -Nru a/drivers/md/dm-target.c b/drivers/md/dm-target.c
--- a/drivers/md/dm-target.c Fri Dec 20 15:38:41 2002
+++ b/drivers/md/dm-target.c Fri Dec 20 15:38:41 2002
@@ -46,10 +46,14 @@
ti = __find_target_type(name);
if (ti) {
- if (ti->use == 0 && ti->tt.module)
- __MOD_INC_USE_COUNT(ti->tt.module);
+ if (ti->use == 0)
+ if (!try_module_get(ti->tt.module)) {
+ ti = NULL;
+ goto exit;
+ }
ti->use++;
}
+exit:
read_unlock(&_lock);
return ti;
@@ -86,8 +90,8 @@
struct tt_internal *ti = (struct tt_internal *) t;
read_lock(&_lock);
- if (--ti->use == 0 && ti->tt.module)
- __MOD_DEC_USE_COUNT(ti->tt.module);
+ if (--ti->use == 0)
+ module_put(ti->tt.module);
if (ti->use < 0)
BUG();
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [lvm-devel] [PATCH] remove __MOD_* from dm
2002-12-20 23:38 [PATCH] remove __MOD_* from dm Greg KH
@ 2002-12-30 14:24 ` Joe Thornber
0 siblings, 0 replies; 2+ messages in thread
From: Joe Thornber @ 2002-12-30 14:24 UTC (permalink / raw)
To: lvm-devel; +Cc: linux-kernel
On Fri, Dec 20, 2002 at 03:38:56PM -0800, Greg KH wrote:
> Here's another patch against 2.5.52-bk that gets rid of the old __MOD_*
> functions for the newer module api. This also allows the modules to be
> unloaded.
>
> Joe, please add this to your next round of patches.
Thanks Greg, if the following patchset has no problems I'll push it to
Linus at the end of the week.
http://people.sistina.com/~thornber/patches/2.5-stable/2.5.53/2.5.53-dm-2.tar.bz2
- Joe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-12-30 14:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-20 23:38 [PATCH] remove __MOD_* from dm Greg KH
2002-12-30 14:24 ` [lvm-devel] " Joe Thornber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).