]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/block/xd.c
const: make block_device_operations const
[net-next-2.6.git] / drivers / block / xd.c
index d4c4352354b559076002509e26422c1d63e6f973..0877d3628fdae251f48b87d87fffeb1e9d11df29 100644 (file)
@@ -130,7 +130,7 @@ static struct gendisk *xd_gendisk[2];
 
 static int xd_getgeo(struct block_device *bdev, struct hd_geometry *geo);
 
-static struct block_device_operations xd_fops = {
+static const struct block_device_operations xd_fops = {
        .owner  = THIS_MODULE,
        .locked_ioctl   = xd_ioctl,
        .getgeo = xd_getgeo,
@@ -305,10 +305,7 @@ static void do_xd_request (struct request_queue * q)
        if (xdc_busy)
                return;
 
-       req = elv_next_request(q);
-       if (req)
-               blkdev_dequeue_request(req);
-
+       req = blk_fetch_request(q);
        while (req) {
                unsigned block = blk_rq_pos(req);
                unsigned count = blk_rq_cur_sectors(req);
@@ -325,11 +322,8 @@ static void do_xd_request (struct request_queue * q)
                                           block, count);
        done:
                /* wrap up, 0 = success, -errno = fail */
-               if (!__blk_end_request_cur(req, res)) {
-                       req = elv_next_request(q);
-                       if (req)
-                               blkdev_dequeue_request(req);
-               }
+               if (!__blk_end_request_cur(req, res))
+                       req = blk_fetch_request(q);
        }
 }