From: Stephen Hemminger <shemminger@osdl.org>
To: Linus Torvalds <torvalds@transmeta.com>, Jens Axboe <axboe@suse.de>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 2.5.69] Fix module ref counting in block/loop.c
Date: Fri, 9 May 2003 16:17:53 -0700 [thread overview]
Message-ID: <20030509161753.75a17f2e.shemminger@osdl.org> (raw)
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;
}
reply other threads:[~2003-05-09 23:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20030509161753.75a17f2e.shemminger@osdl.org \
--to=shemminger@osdl.org \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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;
as well as URLs for NNTP newsgroup(s).