diff options
-rw-r--r-- | block/blk-ioc.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/block/blk-ioc.c b/block/blk-ioc.c index c898049dafd5..bfb0493d12af 100644 --- a/block/blk-ioc.c +++ b/block/blk-ioc.c | |||
@@ -82,26 +82,26 @@ void exit_io_context(struct task_struct *task) | |||
82 | 82 | ||
83 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node) | 83 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node) |
84 | { | 84 | { |
85 | struct io_context *ret; | 85 | struct io_context *ioc; |
86 | 86 | ||
87 | ret = kmem_cache_alloc_node(iocontext_cachep, gfp_flags, node); | 87 | ioc = kmem_cache_alloc_node(iocontext_cachep, gfp_flags, node); |
88 | if (ret) { | 88 | if (ioc) { |
89 | atomic_long_set(&ret->refcount, 1); | 89 | atomic_long_set(&ioc->refcount, 1); |
90 | atomic_set(&ret->nr_tasks, 1); | 90 | atomic_set(&ioc->nr_tasks, 1); |
91 | spin_lock_init(&ret->lock); | 91 | spin_lock_init(&ioc->lock); |
92 | ret->ioprio_changed = 0; | 92 | ioc->ioprio_changed = 0; |
93 | ret->ioprio = 0; | 93 | ioc->ioprio = 0; |
94 | ret->last_waited = 0; /* doesn't matter... */ | 94 | ioc->last_waited = 0; /* doesn't matter... */ |
95 | ret->nr_batch_requests = 0; /* because this is 0 */ | 95 | ioc->nr_batch_requests = 0; /* because this is 0 */ |
96 | INIT_RADIX_TREE(&ret->radix_root, GFP_ATOMIC | __GFP_HIGH); | 96 | INIT_RADIX_TREE(&ioc->radix_root, GFP_ATOMIC | __GFP_HIGH); |
97 | INIT_HLIST_HEAD(&ret->cic_list); | 97 | INIT_HLIST_HEAD(&ioc->cic_list); |
98 | ret->ioc_data = NULL; | 98 | ioc->ioc_data = NULL; |
99 | #if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE) | 99 | #if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE) |
100 | ret->cgroup_changed = 0; | 100 | ioc->cgroup_changed = 0; |
101 | #endif | 101 | #endif |
102 | } | 102 | } |
103 | 103 | ||
104 | return ret; | 104 | return ioc; |
105 | } | 105 | } |
106 | 106 | ||
107 | /* | 107 | /* |
@@ -139,19 +139,19 @@ struct io_context *current_io_context(gfp_t gfp_flags, int node) | |||
139 | */ | 139 | */ |
140 | struct io_context *get_io_context(gfp_t gfp_flags, int node) | 140 | struct io_context *get_io_context(gfp_t gfp_flags, int node) |
141 | { | 141 | { |
142 | struct io_context *ret = NULL; | 142 | struct io_context *ioc = NULL; |
143 | 143 | ||
144 | /* | 144 | /* |
145 | * Check for unlikely race with exiting task. ioc ref count is | 145 | * Check for unlikely race with exiting task. ioc ref count is |
146 | * zero when ioc is being detached. | 146 | * zero when ioc is being detached. |
147 | */ | 147 | */ |
148 | do { | 148 | do { |
149 | ret = current_io_context(gfp_flags, node); | 149 | ioc = current_io_context(gfp_flags, node); |
150 | if (unlikely(!ret)) | 150 | if (unlikely(!ioc)) |
151 | break; | 151 | break; |
152 | } while (!atomic_long_inc_not_zero(&ret->refcount)); | 152 | } while (!atomic_long_inc_not_zero(&ioc->refcount)); |
153 | 153 | ||
154 | return ret; | 154 | return ioc; |
155 | } | 155 | } |
156 | EXPORT_SYMBOL(get_io_context); | 156 | EXPORT_SYMBOL(get_io_context); |
157 | 157 | ||