]> Pileus Git - ~andy/linux/blobdiff - block/blk-sysfs.c
netconf: add the handler to dump entries
[~andy/linux] / block / blk-sysfs.c
index ce6204608822462c18bda72c7ca2403fd17ec5eb..6206a934eb8c85a2f21636759f1b64afe8e3fb70 100644 (file)
@@ -466,7 +466,7 @@ queue_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
        if (!entry->show)
                return -EIO;
        mutex_lock(&q->sysfs_lock);
-       if (blk_queue_dead(q)) {
+       if (blk_queue_dying(q)) {
                mutex_unlock(&q->sysfs_lock);
                return -ENOENT;
        }
@@ -488,7 +488,7 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr,
 
        q = container_of(kobj, struct request_queue, kobj);
        mutex_lock(&q->sysfs_lock);
-       if (blk_queue_dead(q)) {
+       if (blk_queue_dying(q)) {
                mutex_unlock(&q->sysfs_lock);
                return -ENOENT;
        }
@@ -497,6 +497,13 @@ queue_attr_store(struct kobject *kobj, struct attribute *attr,
        return res;
 }
 
+static void blk_free_queue_rcu(struct rcu_head *rcu_head)
+{
+       struct request_queue *q = container_of(rcu_head, struct request_queue,
+                                              rcu_head);
+       kmem_cache_free(blk_requestq_cachep, q);
+}
+
 /**
  * blk_release_queue: - release a &struct request_queue when it is no longer needed
  * @kobj:    the kobj belonging to the request queue to be released
@@ -538,7 +545,7 @@ static void blk_release_queue(struct kobject *kobj)
        bdi_destroy(&q->backing_dev_info);
 
        ida_simple_remove(&blk_queue_ida, q->id);
-       kmem_cache_free(blk_requestq_cachep, q);
+       call_rcu(&q->rcu_head, blk_free_queue_rcu);
 }
 
 static const struct sysfs_ops queue_sysfs_ops = {