~ubuntu-branches/ubuntu/raring/linux-nexus7/raring-proposed

« back to all changes in this revision

Viewing changes to block/blk-ioc.c

  • Committer: Package Import Robot
  • Author(s): Tim Gardner, Andy Whitcroft, Erez Zadok, Miklos Szeredi, Neil Brown, Paolo Pisati, Tim Gardner
  • Date: 2013-02-27 11:55:02 UTC
  • Revision ID: package-import@ubuntu.com-20130227115502-979tupqdiwnd6bob
Tags: 3.1.10-10.28
[ Andy Whitcroft ]

* ubuntu: overlayfs -- overlayfs: add statfs support
  - LP: #1076317
* ubuntu: overlayfs -- overlayfs: apply device cgroup and security
  permissions to overlay files
  - LP: #1076317, #915941, #918212
  - CVE-2012-0055
* [packaging] Rename from linaro to nexus7 -- part 2

[ Erez Zadok ]

* ubuntu: overlayfs -- overlayfs: implement show_options
  - LP: #1076317

[ Miklos Szeredi ]

* ubuntu: overlayfs -- vfs: pass struct path to __dentry_open()
  - LP: #1076317
* ubuntu: overlayfs -- vfs: add i_op->open()
  - LP: #1076317
* ubuntu: overlayfs -- vfs: export do_splice_direct() to modules
  - LP: #1076317
* ubuntu: overlayfs -- vfs: introduce clone_private_mount()
  - LP: #1076317
* ubuntu: overlayfs -- overlay filesystem
  - LP: #1076317
* ubuntu: overlayfs -- fs: limit filesystem stacking depth
  - LP: #1076317

[ Neil Brown ]

* ubuntu: overlayfs -- overlay: overlay filesystem documentation
  - LP: #1076317

[ Paolo Pisati ]

* [Config] OVERLAYFS_FS=m
  - LP: #1076317
* SAUCE: compilation fix for missing symbols
  - LP: #1076317

[ Tim Gardner ]

* Rebased against git://phablet.ubuntu.com/CyanogenMod/android_kernel_asus_grouper.git phablet-10.1
* Updated configs to be more device consistent with
  arch/arm/configs/cyanogenmod_grouper_defconfig
  https://wiki.ubuntu.com/Touch/Porting#Kernel
  http://phablet.ubuntu.com/gitweb?p=CyanogenMod/android_kernel_asus_grouper.git;a=shortlog;h=refs/heads/phablet-10.1
* Pull config changes from git://phablet.ubuntu.com/CyanogenMod/android_kernel_asus_grouper.git phablet-10.1
  CONFIG_NAMESPACES=y
  CONFIG_UTS_NS=y
  CONFIG_IPC_NS=y
  CONFIG_USER_NS=y
  CONFIG_PID_NS=y
  CONFIG_NET_NS=y
  CONFIG_DEVTMPFS=y
  CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
  CONFIG_DNOTIFY=y
  CONFIG_FANOTIFY=y
  CONFIG_FANOTIFY_ACCESS_PERMISSIONS=y
  ONFIG_ANDROID_PARANOID_NETWORK=n
  ONFIG_DEVPTS_MULTIPLE_INSTANCES=y
  CONFIG_SYSVIPC=y
* [packaging] Rename from linaro to nexus7

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
#include <linux/module.h>
6
6
#include <linux/init.h>
7
7
#include <linux/bio.h>
 
8
#include <linux/bitmap.h>
8
9
#include <linux/blkdev.h>
9
10
#include <linux/bootmem.h>      /* for max_pfn/max_low_pfn */
10
11
#include <linux/slab.h>
16
17
 */
17
18
static struct kmem_cache *iocontext_cachep;
18
19
 
19
 
static void cfq_dtor(struct io_context *ioc)
 
20
static void hlist_sched_dtor(struct io_context *ioc, struct hlist_head *list)
20
21
{
21
 
        if (!hlist_empty(&ioc->cic_list)) {
 
22
        if (!hlist_empty(list)) {
22
23
                struct cfq_io_context *cic;
23
24
 
24
 
                cic = hlist_entry(ioc->cic_list.first, struct cfq_io_context,
25
 
                                                                cic_list);
 
25
                cic = hlist_entry(list->first, struct cfq_io_context, cic_list);
26
26
                cic->dtor(ioc);
27
27
        }
28
28
}
40
40
 
41
41
        if (atomic_long_dec_and_test(&ioc->refcount)) {
42
42
                rcu_read_lock();
43
 
                cfq_dtor(ioc);
 
43
 
 
44
                hlist_sched_dtor(ioc, &ioc->cic_list);
 
45
                hlist_sched_dtor(ioc, &ioc->bfq_cic_list);
44
46
                rcu_read_unlock();
45
47
 
46
48
                kmem_cache_free(iocontext_cachep, ioc);
50
52
}
51
53
EXPORT_SYMBOL(put_io_context);
52
54
 
53
 
static void cfq_exit(struct io_context *ioc)
 
55
static void hlist_sched_exit(struct io_context *ioc, struct hlist_head *list)
54
56
{
55
57
        rcu_read_lock();
56
58
 
57
 
        if (!hlist_empty(&ioc->cic_list)) {
 
59
        if (!hlist_empty(list)) {
58
60
                struct cfq_io_context *cic;
59
61
 
60
 
                cic = hlist_entry(ioc->cic_list.first, struct cfq_io_context,
61
 
                                                                cic_list);
 
62
                cic = hlist_entry(list->first, struct cfq_io_context, cic_list);
62
63
                cic->exit(ioc);
63
64
        }
64
65
        rcu_read_unlock();
74
75
        task->io_context = NULL;
75
76
        task_unlock(task);
76
77
 
77
 
        if (atomic_dec_and_test(&ioc->nr_tasks))
78
 
                cfq_exit(ioc);
79
 
 
 
78
        if (atomic_dec_and_test(&ioc->nr_tasks)) {
 
79
                hlist_sched_exit(ioc, &ioc->cic_list);
 
80
                hlist_sched_exit(ioc, &ioc->bfq_cic_list);
 
81
        }
80
82
        put_io_context(ioc);
81
83
}
82
84
 
89
91
                atomic_long_set(&ioc->refcount, 1);
90
92
                atomic_set(&ioc->nr_tasks, 1);
91
93
                spin_lock_init(&ioc->lock);
92
 
                ioc->ioprio_changed = 0;
 
94
                bitmap_zero(ioc->ioprio_changed, IOC_IOPRIO_CHANGED_BITS);
93
95
                ioc->ioprio = 0;
94
96
                ioc->last_waited = 0; /* doesn't matter... */
95
97
                ioc->nr_batch_requests = 0; /* because this is 0 */
96
98
                INIT_RADIX_TREE(&ioc->radix_root, GFP_ATOMIC | __GFP_HIGH);
97
99
                INIT_HLIST_HEAD(&ioc->cic_list);
 
100
                INIT_RADIX_TREE(&ioc->bfq_radix_root, GFP_ATOMIC | __GFP_HIGH);
 
101
                INIT_HLIST_HEAD(&ioc->bfq_cic_list);
98
102
                ioc->ioc_data = NULL;
99
103
#if defined(CONFIG_BLK_CGROUP) || defined(CONFIG_BLK_CGROUP_MODULE)
100
104
                ioc->cgroup_changed = 0;