Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 140158
b: refs/heads/master
c: aea9058
h: refs/heads/master
v: v3
  • Loading branch information
Jun'ichi Nomura authored and Alasdair G Kergon committed Apr 2, 2009
1 parent 2c35c9d commit 73bd6a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 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: 5642b8a61a15436231adf27b2b1bd96901b623dd
refs/heads/master: aea9058801c0acfa2831af1714da412dfb0018c2
21 changes: 3 additions & 18 deletions trunk/drivers/md/dm-path-selector.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@

struct ps_internal {
struct path_selector_type pst;

struct list_head list;
long use;
};

#define pst_to_psi(__pst) container_of((__pst), struct ps_internal, pst)
Expand All @@ -45,12 +43,8 @@ static struct ps_internal *get_path_selector(const char *name)

down_read(&_ps_lock);
psi = __find_path_selector_type(name);
if (psi) {
if ((psi->use == 0) && !try_module_get(psi->pst.module))
psi = NULL;
else
psi->use++;
}
if (psi && !try_module_get(psi->pst.module))
psi = NULL;
up_read(&_ps_lock);

return psi;
Expand Down Expand Up @@ -84,11 +78,7 @@ void dm_put_path_selector(struct path_selector_type *pst)
if (!psi)
goto out;

if (--psi->use == 0)
module_put(psi->pst.module);

BUG_ON(psi->use < 0);

module_put(psi->pst.module);
out:
up_read(&_ps_lock);
}
Expand Down Expand Up @@ -136,11 +126,6 @@ int dm_unregister_path_selector(struct path_selector_type *pst)
return -EINVAL;
}

if (psi->use) {
up_write(&_ps_lock);
return -ETXTBSY;
}

list_del(&psi->list);

up_write(&_ps_lock);
Expand Down

0 comments on commit 73bd6a7

Please sign in to comment.