blkio: Increment the blkio cgroup stats for real now
[safe/jmp/linux-2.6] / block / elevator.c
index 9ad5ccc..76e3702 100644 (file)
@@ -154,7 +154,7 @@ static struct elevator_type *elevator_get(const char *name)
 
                spin_unlock(&elv_list_lock);
 
-               sprintf(elv, "%s-iosched", name);
+               snprintf(elv, sizeof(elv), "%s-iosched", name);
 
                request_module("%s", elv);
                spin_lock(&elv_list_lock);
@@ -474,6 +474,15 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio)
        int ret;
 
        /*
+        * Levels of merges:
+        *      nomerges:  No merges at all attempted
+        *      noxmerges: Only simple one-hit cache try
+        *      merges:    All merge tries attempted
+        */
+       if (blk_queue_nomerges(q))
+               return ELEVATOR_NO_MERGE;
+
+       /*
         * First try one-hit cache.
         */
        if (q->last_merge) {
@@ -484,7 +493,7 @@ int elv_merge(struct request_queue *q, struct request **req, struct bio *bio)
                }
        }
 
-       if (blk_queue_nomerges(q))
+       if (blk_queue_noxmerges(q))
                return ELEVATOR_NO_MERGE;
 
        /*
@@ -883,7 +892,7 @@ elv_attr_store(struct kobject *kobj, struct attribute *attr,
        return error;
 }
 
-static struct sysfs_ops elv_sysfs_ops = {
+static const struct sysfs_ops elv_sysfs_ops = {
        .show   = elv_attr_show,
        .store  = elv_attr_store,
 };