aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2012-03-19 18:10:59 -0400
committerJens Axboe <axboe@kernel.dk>2012-03-20 07:47:48 -0400
commit2b566fa55b9a94b53217c2818e6c5e5756eeb1a1 (patch)
treed2186ebd18062172a7b0c83e31ca834f44ecdcc0
parent598971bfbdfdc8701337dc1636c7919c44699914 (diff)
block: remove ioc_*_changed()
After the previous patch to cfq, there's no ioc_get_changed() user left. This patch yanks out ioc_{ioprio|cgroup|get}_changed() and all related stuff. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Vivek Goyal <vgoyal@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--block/blk-cgroup.c19
-rw-r--r--block/blk-ioc.c68
-rw-r--r--fs/ioprio.c2
-rw-r--r--include/linux/iocontext.h7
4 files changed, 1 insertions, 95 deletions
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 30e07308db24..a74019b67311 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -47,8 +47,6 @@ static struct cgroup_subsys_state *blkiocg_create(struct cgroup_subsys *,
47 struct cgroup *); 47 struct cgroup *);
48static int blkiocg_can_attach(struct cgroup_subsys *, struct cgroup *, 48static int blkiocg_can_attach(struct cgroup_subsys *, struct cgroup *,
49 struct cgroup_taskset *); 49 struct cgroup_taskset *);
50static void blkiocg_attach(struct cgroup_subsys *, struct cgroup *,
51 struct cgroup_taskset *);
52static int blkiocg_pre_destroy(struct cgroup_subsys *, struct cgroup *); 50static int blkiocg_pre_destroy(struct cgroup_subsys *, struct cgroup *);
53static void blkiocg_destroy(struct cgroup_subsys *, struct cgroup *); 51static void blkiocg_destroy(struct cgroup_subsys *, struct cgroup *);
54static int blkiocg_populate(struct cgroup_subsys *, struct cgroup *); 52static int blkiocg_populate(struct cgroup_subsys *, struct cgroup *);
@@ -63,7 +61,6 @@ struct cgroup_subsys blkio_subsys = {
63 .name = "blkio", 61 .name = "blkio",
64 .create = blkiocg_create, 62 .create = blkiocg_create,
65 .can_attach = blkiocg_can_attach, 63 .can_attach = blkiocg_can_attach,
66 .attach = blkiocg_attach,
67 .pre_destroy = blkiocg_pre_destroy, 64 .pre_destroy = blkiocg_pre_destroy,
68 .destroy = blkiocg_destroy, 65 .destroy = blkiocg_destroy,
69 .populate = blkiocg_populate, 66 .populate = blkiocg_populate,
@@ -1729,22 +1726,6 @@ static int blkiocg_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
1729 return ret; 1726 return ret;
1730} 1727}
1731 1728
1732static void blkiocg_attach(struct cgroup_subsys *ss, struct cgroup *cgrp,
1733 struct cgroup_taskset *tset)
1734{
1735 struct task_struct *task;
1736 struct io_context *ioc;
1737
1738 cgroup_taskset_for_each(task, cgrp, tset) {
1739 /* we don't lose anything even if ioc allocation fails */
1740 ioc = get_task_io_context(task, GFP_ATOMIC, NUMA_NO_NODE);
1741 if (ioc) {
1742 ioc_cgroup_changed(ioc);
1743 put_io_context(ioc);
1744 }
1745 }
1746}
1747
1748static void blkcg_bypass_start(void) 1729static void blkcg_bypass_start(void)
1749 __acquires(&all_q_mutex) 1730 __acquires(&all_q_mutex)
1750{ 1731{
diff --git a/block/blk-ioc.c b/block/blk-ioc.c
index 439ec21fd787..3f3dd51a1280 100644
--- a/block/blk-ioc.c
+++ b/block/blk-ioc.c
@@ -388,74 +388,6 @@ struct io_cq *ioc_create_icq(struct io_context *ioc, struct request_queue *q,
388 return icq; 388 return icq;
389} 389}
390 390
391void ioc_set_icq_flags(struct io_context *ioc, unsigned int flags)
392{
393 struct io_cq *icq;
394 struct hlist_node *n;
395
396 hlist_for_each_entry(icq, n, &ioc->icq_list, ioc_node)
397 icq->flags |= flags;
398}
399
400/**
401 * ioc_ioprio_changed - notify ioprio change
402 * @ioc: io_context of interest
403 * @ioprio: new ioprio
404 *
405 * @ioc's ioprio has changed to @ioprio. Set %ICQ_IOPRIO_CHANGED for all
406 * icq's. iosched is responsible for checking the bit and applying it on
407 * request issue path.
408 */
409void ioc_ioprio_changed(struct io_context *ioc, int ioprio)
410{
411 unsigned long flags;
412
413 spin_lock_irqsave(&ioc->lock, flags);
414 ioc->ioprio = ioprio;
415 ioc_set_icq_flags(ioc, ICQ_IOPRIO_CHANGED);
416 spin_unlock_irqrestore(&ioc->lock, flags);
417}
418
419/**
420 * ioc_cgroup_changed - notify cgroup change
421 * @ioc: io_context of interest
422 *
423 * @ioc's cgroup has changed. Set %ICQ_CGROUP_CHANGED for all icq's.
424 * iosched is responsible for checking the bit and applying it on request
425 * issue path.
426 */
427void ioc_cgroup_changed(struct io_context *ioc)
428{
429 unsigned long flags;
430
431 spin_lock_irqsave(&ioc->lock, flags);
432 ioc_set_icq_flags(ioc, ICQ_CGROUP_CHANGED);
433 spin_unlock_irqrestore(&ioc->lock, flags);
434}
435EXPORT_SYMBOL(ioc_cgroup_changed);
436
437/**
438 * icq_get_changed - fetch and clear icq changed mask
439 * @icq: icq of interest
440 *
441 * Fetch and clear ICQ_*_CHANGED bits from @icq. Grabs and releases
442 * @icq->ioc->lock.
443 */
444unsigned icq_get_changed(struct io_cq *icq)
445{
446 unsigned int changed = 0;
447 unsigned long flags;
448
449 if (unlikely(icq->flags & ICQ_CHANGED_MASK)) {
450 spin_lock_irqsave(&icq->ioc->lock, flags);
451 changed = icq->flags & ICQ_CHANGED_MASK;
452 icq->flags &= ~ICQ_CHANGED_MASK;
453 spin_unlock_irqrestore(&icq->ioc->lock, flags);
454 }
455 return changed;
456}
457EXPORT_SYMBOL(icq_get_changed);
458
459static int __init blk_ioc_init(void) 391static int __init blk_ioc_init(void)
460{ 392{
461 iocontext_cachep = kmem_cache_create("blkdev_ioc", 393 iocontext_cachep = kmem_cache_create("blkdev_ioc",
diff --git a/fs/ioprio.c b/fs/ioprio.c
index 0f1b9515213b..48644373de58 100644
--- a/fs/ioprio.c
+++ b/fs/ioprio.c
@@ -50,7 +50,7 @@ int set_task_ioprio(struct task_struct *task, int ioprio)
50 50
51 ioc = get_task_io_context(task, GFP_ATOMIC, NUMA_NO_NODE); 51 ioc = get_task_io_context(task, GFP_ATOMIC, NUMA_NO_NODE);
52 if (ioc) { 52 if (ioc) {
53 ioc_ioprio_changed(ioc, ioprio); 53 ioc->ioprio = ioprio;
54 put_io_context(ioc); 54 put_io_context(ioc);
55 } 55 }
56 56
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index 6f1a2608e91f..df38db2ef45b 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -6,11 +6,7 @@
6#include <linux/workqueue.h> 6#include <linux/workqueue.h>
7 7
8enum { 8enum {
9 ICQ_IOPRIO_CHANGED = 1 << 0,
10 ICQ_CGROUP_CHANGED = 1 << 1,
11 ICQ_EXITED = 1 << 2, 9 ICQ_EXITED = 1 << 2,
12
13 ICQ_CHANGED_MASK = ICQ_IOPRIO_CHANGED | ICQ_CGROUP_CHANGED,
14}; 10};
15 11
16/* 12/*
@@ -152,9 +148,6 @@ void put_io_context_active(struct io_context *ioc);
152void exit_io_context(struct task_struct *task); 148void exit_io_context(struct task_struct *task);
153struct io_context *get_task_io_context(struct task_struct *task, 149struct io_context *get_task_io_context(struct task_struct *task,
154 gfp_t gfp_flags, int node); 150 gfp_t gfp_flags, int node);
155void ioc_ioprio_changed(struct io_context *ioc, int ioprio);
156void ioc_cgroup_changed(struct io_context *ioc);
157unsigned int icq_get_changed(struct io_cq *icq);
158#else 151#else
159struct io_context; 152struct io_context;
160static inline void put_io_context(struct io_context *ioc) { } 153static inline void put_io_context(struct io_context *ioc) { }