diff options
Diffstat (limited to 'block/cfq-iosched.c')
-rw-r--r-- | block/cfq-iosched.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index ec3f5e8ba564..d42d89ccce1b 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/rbtree.h> | 14 | #include <linux/rbtree.h> |
15 | #include <linux/ioprio.h> | 15 | #include <linux/ioprio.h> |
16 | #include <linux/blktrace_api.h> | 16 | #include <linux/blktrace_api.h> |
17 | #include "blk.h" | ||
17 | #include "cfq.h" | 18 | #include "cfq.h" |
18 | 19 | ||
19 | /* | 20 | /* |
@@ -3194,13 +3195,13 @@ static struct cfq_io_context * | |||
3194 | cfq_get_io_context(struct cfq_data *cfqd, gfp_t gfp_mask) | 3195 | cfq_get_io_context(struct cfq_data *cfqd, gfp_t gfp_mask) |
3195 | { | 3196 | { |
3196 | struct io_context *ioc = NULL; | 3197 | struct io_context *ioc = NULL; |
3197 | struct cfq_io_context *cic; | 3198 | struct cfq_io_context *cic = NULL; |
3198 | 3199 | ||
3199 | might_sleep_if(gfp_mask & __GFP_WAIT); | 3200 | might_sleep_if(gfp_mask & __GFP_WAIT); |
3200 | 3201 | ||
3201 | ioc = get_io_context(gfp_mask, cfqd->queue->node); | 3202 | ioc = current_io_context(gfp_mask, cfqd->queue->node); |
3202 | if (!ioc) | 3203 | if (!ioc) |
3203 | return NULL; | 3204 | goto err; |
3204 | 3205 | ||
3205 | cic = cfq_cic_lookup(cfqd, ioc); | 3206 | cic = cfq_cic_lookup(cfqd, ioc); |
3206 | if (cic) | 3207 | if (cic) |
@@ -3211,10 +3212,10 @@ cfq_get_io_context(struct cfq_data *cfqd, gfp_t gfp_mask) | |||
3211 | goto err; | 3212 | goto err; |
3212 | 3213 | ||
3213 | if (cfq_cic_link(cfqd, ioc, cic, gfp_mask)) | 3214 | if (cfq_cic_link(cfqd, ioc, cic, gfp_mask)) |
3214 | goto err_free; | 3215 | goto err; |
3215 | |||
3216 | out: | 3216 | out: |
3217 | smp_read_barrier_depends(); | 3217 | get_io_context(ioc); |
3218 | |||
3218 | if (unlikely(ioc->ioprio_changed)) | 3219 | if (unlikely(ioc->ioprio_changed)) |
3219 | cfq_ioc_set_ioprio(ioc); | 3220 | cfq_ioc_set_ioprio(ioc); |
3220 | 3221 | ||
@@ -3223,10 +3224,9 @@ out: | |||
3223 | cfq_ioc_set_cgroup(ioc); | 3224 | cfq_ioc_set_cgroup(ioc); |
3224 | #endif | 3225 | #endif |
3225 | return cic; | 3226 | return cic; |
3226 | err_free: | ||
3227 | cfq_cic_free(cic); | ||
3228 | err: | 3227 | err: |
3229 | put_io_context(ioc); | 3228 | if (cic) |
3229 | cfq_cic_free(cic); | ||
3230 | return NULL; | 3230 | return NULL; |
3231 | } | 3231 | } |
3232 | 3232 | ||