Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 40505
b: refs/heads/master
c: d7fb2c3
h: refs/heads/master
i:
  40503: db56734
v: v3
  • Loading branch information
Paolo 'Blaisorblade' Giarrusso authored and Linus Torvalds committed Oct 31, 2006
1 parent a9f50e0 commit e4be922
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 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: 5f75a4f887a35b99878fc07ed749a90375194b63
refs/heads/master: d7fb2c3865ca0f95d92e2864c3dc9220789d83f5
23 changes: 12 additions & 11 deletions trunk/arch/um/drivers/ubd_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ static inline void ubd_set_bit(__u64 bit, unsigned char *data)
#define DRIVER_NAME "uml-blkdev"

static DEFINE_SPINLOCK(ubd_io_lock);
static DEFINE_SPINLOCK(ubd_lock);

static DEFINE_MUTEX(ubd_lock);

static void (*do_ubd)(void);

Expand Down Expand Up @@ -314,7 +315,7 @@ static int ubd_setup_common(char *str, int *index_out)
}

err = 1;
spin_lock(&ubd_lock);
mutex_lock(&ubd_lock);
if(fake_major != MAJOR_NR){
printk(KERN_ERR "Can't assign a fake major twice\n");
goto out1;
Expand All @@ -326,7 +327,7 @@ static int ubd_setup_common(char *str, int *index_out)
major);
err = 0;
out1:
spin_unlock(&ubd_lock);
mutex_unlock(&ubd_lock);
return(err);
}

Expand All @@ -343,7 +344,7 @@ static int ubd_setup_common(char *str, int *index_out)
}

err = 1;
spin_lock(&ubd_lock);
mutex_lock(&ubd_lock);

ubd_dev = &ubd_devs[n];
if(ubd_dev->file != NULL){
Expand Down Expand Up @@ -405,7 +406,7 @@ static int ubd_setup_common(char *str, int *index_out)
ubd_dev->cow.file = backing_file;
ubd_dev->boot_openflags = flags;
out:
spin_unlock(&ubd_lock);
mutex_unlock(&ubd_lock);
return(err);
}

Expand Down Expand Up @@ -710,11 +711,11 @@ static int ubd_config(char *str)
}
if(n == -1) return(0);

spin_lock(&ubd_lock);
mutex_lock(&ubd_lock);
err = ubd_add(n);
if(err)
ubd_devs[n].file = NULL;
spin_unlock(&ubd_lock);
mutex_unlock(&ubd_lock);

return(err);
}
Expand All @@ -731,7 +732,7 @@ static int ubd_get_config(char *name, char *str, int size, char **error_out)
}

ubd_dev = &ubd_devs[n];
spin_lock(&ubd_lock);
mutex_lock(&ubd_lock);

if(ubd_dev->file == NULL){
CONFIG_CHUNK(str, size, len, "", 1);
Expand All @@ -747,7 +748,7 @@ static int ubd_get_config(char *name, char *str, int size, char **error_out)
else CONFIG_CHUNK(str, size, len, "", 1);

out:
spin_unlock(&ubd_lock);
mutex_unlock(&ubd_lock);
return(len);
}

Expand All @@ -766,7 +767,7 @@ static int ubd_remove(int n)
struct ubd *ubd_dev;
int err = -ENODEV;

spin_lock(&ubd_lock);
mutex_lock(&ubd_lock);

if(ubd_gendisk[n] == NULL)
goto out;
Expand Down Expand Up @@ -795,7 +796,7 @@ static int ubd_remove(int n)
*ubd_dev = ((struct ubd) DEFAULT_UBD);
err = 0;
out:
spin_unlock(&ubd_lock);
mutex_unlock(&ubd_lock);
return err;
}

Expand Down

0 comments on commit e4be922

Please sign in to comment.