Merge master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
[pandora-kernel.git] / drivers / block / as-iosched.c
index a9575bb..95c0a36 100644 (file)
@@ -1806,7 +1806,8 @@ static void as_put_request(request_queue_t *q, struct request *rq)
        rq->elevator_private = NULL;
 }
 
-static int as_set_request(request_queue_t *q, struct request *rq, int gfp_mask)
+static int as_set_request(request_queue_t *q, struct request *rq,
+                         struct bio *bio, int gfp_mask)
 {
        struct as_data *ad = q->elevator->elevator_data;
        struct as_rq *arq = mempool_alloc(ad->arq_pool, gfp_mask);
@@ -1827,7 +1828,7 @@ static int as_set_request(request_queue_t *q, struct request *rq, int gfp_mask)
        return 1;
 }
 
-static int as_may_queue(request_queue_t *q, int rw)
+static int as_may_queue(request_queue_t *q, int rw, struct bio *bio)
 {
        int ret = ELV_MQUEUE_MAY;
        struct as_data *ad = q->elevator->elevator_data;
@@ -1871,20 +1872,22 @@ static int as_init_queue(request_queue_t *q, elevator_t *e)
        if (!arq_pool)
                return -ENOMEM;
 
-       ad = kmalloc(sizeof(*ad), GFP_KERNEL);
+       ad = kmalloc_node(sizeof(*ad), GFP_KERNEL, q->node);
        if (!ad)
                return -ENOMEM;
        memset(ad, 0, sizeof(*ad));
 
        ad->q = q; /* Identify what queue the data belongs to */
 
-       ad->hash = kmalloc(sizeof(struct list_head)*AS_HASH_ENTRIES,GFP_KERNEL);
+       ad->hash = kmalloc_node(sizeof(struct list_head)*AS_HASH_ENTRIES,
+                               GFP_KERNEL, q->node);
        if (!ad->hash) {
                kfree(ad);
                return -ENOMEM;
        }
 
-       ad->arq_pool = mempool_create(BLKDEV_MIN_RQ, mempool_alloc_slab, mempool_free_slab, arq_pool);
+       ad->arq_pool = mempool_create_node(BLKDEV_MIN_RQ, mempool_alloc_slab,
+                               mempool_free_slab, arq_pool, q->node);
        if (!ad->arq_pool) {
                kfree(ad->hash);
                kfree(ad);
@@ -1932,23 +1935,15 @@ struct as_fs_entry {
 static ssize_t
 as_var_show(unsigned int var, char *page)
 {
-       var = (var * 1000) / HZ;
        return sprintf(page, "%d\n", var);
 }
 
 static ssize_t
 as_var_store(unsigned long *var, const char *page, size_t count)
 {
-       unsigned long tmp;
        char *p = (char *) page;
 
-       tmp = simple_strtoul(p, &p, 10);
-       if (tmp != 0) {
-               tmp = (tmp * HZ) / 1000;
-               if (tmp == 0)
-                       tmp = 1;
-       }
-       *var = tmp;
+       *var = simple_strtoul(p, &p, 10);
        return count;
 }
 
@@ -2044,7 +2039,7 @@ as_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
        struct as_fs_entry *entry = to_as(attr);
 
        if (!entry->show)
-               return 0;
+               return -EIO;
 
        return entry->show(e->elevator_data, page);
 }
@@ -2057,7 +2052,7 @@ as_attr_store(struct kobject *kobj, struct attribute *attr,
        struct as_fs_entry *entry = to_as(attr);
 
        if (!entry->store)
-               return -EINVAL;
+               return -EIO;
 
        return entry->store(e->elevator_data, page, length);
 }