Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93210
b: refs/heads/master
c: cf13ab8
h: refs/heads/master
v: v3
  • Loading branch information
Frederik Deweerdt authored and Alasdair G Kergon committed Apr 25, 2008
1 parent 635a7c0 commit c0e7cd7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 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: 4fdfe401e9d7e30029972d568c667234c0c1d828
refs/heads/master: cf13ab8e02d452e2236d0b5fda9972b3b7f503cb
14 changes: 6 additions & 8 deletions trunk/drivers/md/dm.c
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ static void free_minor(int minor)
/*
* See if the device with a specific minor # is free.
*/
static int specific_minor(struct mapped_device *md, int minor)
static int specific_minor(int minor)
{
int r, m;

Expand Down Expand Up @@ -957,7 +957,7 @@ static int specific_minor(struct mapped_device *md, int minor)
return r;
}

static int next_free_minor(struct mapped_device *md, int *minor)
static int next_free_minor(int *minor)
{
int r, m;

Expand All @@ -968,9 +968,8 @@ static int next_free_minor(struct mapped_device *md, int *minor)
spin_lock(&_minor_lock);

r = idr_get_new(&_minor_idr, MINOR_ALLOCED, &m);
if (r) {
if (r)
goto out;
}

if (m >= (1 << MINORBITS)) {
idr_remove(&_minor_idr, m);
Expand All @@ -993,7 +992,7 @@ static struct block_device_operations dm_blk_dops;
static struct mapped_device *alloc_dev(int minor)
{
int r;
struct mapped_device *md = kmalloc(sizeof(*md), GFP_KERNEL);
struct mapped_device *md = kzalloc(sizeof(*md), GFP_KERNEL);
void *old_md;

if (!md) {
Expand All @@ -1006,13 +1005,12 @@ static struct mapped_device *alloc_dev(int minor)

/* get a minor number for the dev */
if (minor == DM_ANY_MINOR)
r = next_free_minor(md, &minor);
r = next_free_minor(&minor);
else
r = specific_minor(md, minor);
r = specific_minor(minor);
if (r < 0)
goto bad_minor;

memset(md, 0, sizeof(*md));
init_rwsem(&md->io_lock);
mutex_init(&md->suspend_lock);
spin_lock_init(&md->pushback_lock);
Expand Down

0 comments on commit c0e7cd7

Please sign in to comment.