diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-05-14 19:01:14 -0700 |
|---|---|---|
| committer | Patrick Mochel <mochel@osdl.org> | 2003-05-14 19:01:14 -0700 |
| commit | 2ce6b74d59e4fad2dc1549a4718dafaecdb7138b (patch) | |
| tree | 9c1fe2dc275d6d31abb8631b4fd7abfee1be0f19 /drivers/block/loop.c | |
| parent | 4acff84c2d455a5927e007f452c6458085518eb1 (diff) | |
[PATCH] loop.c warning removal
From: Rusty Russell <rusty@rustcorp.com.au>
loop.c has one of those places where manipulating own refcounts is safe: to
get into the ioctl handler you need to have the device open, so that holds a
refcount already (verified that this actually happens).
The compile warning is irritating.
Diffstat (limited to 'drivers/block/loop.c')
| -rw-r--r-- | drivers/block/loop.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 28e9a9a23def..399ce9b37d44 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -651,7 +651,8 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, int lo_flags = 0; int error; - MOD_INC_USE_COUNT; + /* This is safe, since we have a reference from open(). */ + __module_get(THIS_MODULE); error = -EBUSY; if (lo->lo_state != Lo_unbound) @@ -751,7 +752,8 @@ static int loop_set_fd(struct loop_device *lo, struct file *lo_file, out_putf: fput(file); out: - MOD_DEC_USE_COUNT; + /* This is safe: open() is still holding a reference. */ + module_put(THIS_MODULE); return error; } @@ -824,7 +826,8 @@ static int loop_clr_fd(struct loop_device *lo, struct block_device *bdev) filp->f_dentry->d_inode->i_mapping->gfp_mask = gfp; lo->lo_state = Lo_unbound; fput(filp); - MOD_DEC_USE_COUNT; + /* This is safe: open() is still holding a reference. */ + module_put(THIS_MODULE); return 0; } |
