Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140157
b: refs/heads/master
c: 5642b8a
h: refs/heads/master
i:
  140155: ed398d7
v: v3
  • Loading branch information
Cheng Renquan authored and Alasdair G Kergon committed Apr 2, 2009
1 parent 916cd9b commit 2c35c9d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 35bf659b008e83e725dcd30f542e38461dbb867c
refs/heads/master: 5642b8a61a15436231adf27b2b1bd96901b623dd
20 changes: 3 additions & 17 deletions trunk/drivers/md/dm-target.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ struct tt_internal {
struct target_type tt;

struct list_head list;
long use;
};

static LIST_HEAD(_targets);
Expand All @@ -44,12 +43,8 @@ static struct tt_internal *get_target_type(const char *name)
down_read(&_lock);

ti = __find_target_type(name);
if (ti) {
if ((ti->use == 0) && !try_module_get(ti->tt.module))
ti = NULL;
else
ti->use++;
}
if (ti && !try_module_get(ti->tt.module))
ti = NULL;

up_read(&_lock);
return ti;
Expand Down Expand Up @@ -77,10 +72,7 @@ void dm_put_target_type(struct target_type *t)
struct tt_internal *ti = (struct tt_internal *) t;

down_read(&_lock);
if (--ti->use == 0)
module_put(ti->tt.module);

BUG_ON(ti->use < 0);
module_put(ti->tt.module);
up_read(&_lock);

return;
Expand Down Expand Up @@ -140,12 +132,6 @@ void dm_unregister_target(struct target_type *t)
BUG();
}

if (ti->use) {
DMCRIT("Attempt to unregister target still in use: %s",
t->name);
BUG();
}

list_del(&ti->list);
kfree(ti);

Expand Down

0 comments on commit 2c35c9d

Please sign in to comment.