* [PATCH 2.5.69] Fix module ref counting in block/loop.c
@ 2003-05-09 23:17 Stephen Hemminger
0 siblings, 0 replies; only message in thread
From: Stephen Hemminger @ 2003-05-09 23:17 UTC (permalink / raw)
To: Linus Torvalds, Jens Axboe; +Cc: linux-kernel
Replace old MOD_INC with new __module_get.
No need for using try_module_get, because module_get is only called in open
routine where there must already be a ref count.
diff -Nru a/drivers/block/loop.c b/drivers/block/loop.c
--- a/drivers/block/loop.c Fri May 9 15:54:51 2003
+++ b/drivers/block/loop.c Fri May 9 15:54:51 2003
@@ -651,7 +651,7 @@
int lo_flags = 0;
int error;
- MOD_INC_USE_COUNT;
+ __module_get(THIS_MODULE); /* already have ref we are open */
error = -EBUSY;
if (lo->lo_state != Lo_unbound)
@@ -751,7 +751,7 @@
out_putf:
fput(file);
out:
- MOD_DEC_USE_COUNT;
+ module_put(THIS_MODULE);
return error;
}
@@ -824,7 +824,7 @@
filp->f_dentry->d_inode->i_mapping->gfp_mask = gfp;
lo->lo_state = Lo_unbound;
fput(filp);
- MOD_DEC_USE_COUNT;
+ module_put(THIS_MODULE);
return 0;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-05-09 23:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-09 23:17 [PATCH 2.5.69] Fix module ref counting in block/loop.c Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®