Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[pandora-kernel.git] / arch / um / drivers / ubd_kern.c
index fc27f6c..25b248a 100644 (file)
@@ -469,7 +469,7 @@ __uml_help(fakehd,
 "    Change the ubd device name to \"hd\".\n\n"
 );
 
-static void do_ubd_request(request_queue_t * q);
+static void do_ubd_request(struct request_queue * q);
 
 /* Only changed by ubd_init, which is an initcall. */
 int thread_fd = -1;
@@ -612,8 +612,10 @@ static int ubd_open_dev(struct ubd *ubd_dev)
        ubd_dev->fd = fd;
 
        if(ubd_dev->cow.file != NULL){
+               blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long));
+
                err = -ENOMEM;
-               ubd_dev->cow.bitmap = (void *) vmalloc(ubd_dev->cow.bitmap_len);
+               ubd_dev->cow.bitmap = vmalloc(ubd_dev->cow.bitmap_len);
                if(ubd_dev->cow.bitmap == NULL){
                        printk(KERN_ERR "Failed to vmalloc COW bitmap\n");
                        goto error;
@@ -712,8 +714,6 @@ static int ubd_add(int n, char **error_out)
        ubd_dev->queue->queuedata = ubd_dev;
 
        blk_queue_max_hw_segments(ubd_dev->queue, MAX_SG);
-       if(ubd_dev->cow.file != NULL)
-               blk_queue_max_sectors(ubd_dev->queue, 8 * sizeof(long));
        err = ubd_disk_register(MAJOR_NR, ubd_dev->size, n, &ubd_gendisk[n]);
        if(err){
                *error_out = "Failed to register device";
@@ -1081,7 +1081,7 @@ static void prepare_request(struct request *req, struct io_thread_req *io_req,
 }
 
 /* Called with dev->lock held */
-static void do_ubd_request(request_queue_t *q)
+static void do_ubd_request(struct request_queue *q)
 {
        struct io_thread_req *io_req;
        struct request *req;