#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);
}
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;
major);
err = 0;
out1:
- spin_unlock(&ubd_lock);
+ mutex_unlock(&ubd_lock);
return(err);
}
}
err = 1;
- spin_lock(&ubd_lock);
+ mutex_lock(&ubd_lock);
ubd_dev = &ubd_devs[n];
if(ubd_dev->file != NULL){
ubd_dev->cow.file = backing_file;
ubd_dev->boot_openflags = flags;
out:
- spin_unlock(&ubd_lock);
+ mutex_unlock(&ubd_lock);
return(err);
}
}
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);
}
}
ubd_dev = &ubd_devs[n];
- spin_lock(&ubd_lock);
+ mutex_lock(&ubd_lock);
if(ubd_dev->file == NULL){
CONFIG_CHUNK(str, size, len, "", 1);
else CONFIG_CHUNK(str, size, len, "", 1);
out:
- spin_unlock(&ubd_lock);
+ mutex_unlock(&ubd_lock);
return(len);
}
struct ubd *ubd_dev;
int err = -ENODEV;
- spin_lock(&ubd_lock);
+ mutex_lock(&ubd_lock);
if(ubd_gendisk[n] == NULL)
goto out;
*ubd_dev = ((struct ubd) DEFAULT_UBD);
err = 0;
out:
- spin_unlock(&ubd_lock);
+ mutex_unlock(&ubd_lock);
return err;
}