Skip to content

Instantly share code, notes, and snippets.

@heftig
Created August 10, 2010 01:59
Show Gist options
  • Save heftig/516520 to your computer and use it in GitHub Desktop.
Save heftig/516520 to your computer and use it in GitHub Desktop.
commit c4b8673a43c50c72a0f881f246c7e29860418bcd
Author: Jan Steffens <jan.steffens@gmail.com>
Date: Mon Aug 2 03:00:19 2010
Fix atomic functions in bfq
diff --git a/block/bfq-cgroup.c b/block/bfq-cgroup.c
index 9b2e0d1..b27481f 100644
--- a/block/bfq-cgroup.c
+++ b/block/bfq-cgroup.c
@@ -669,8 +669,8 @@ static void bfqio_attach(struct cgroup_subsys *subsys, struct cgroup *cgroup,
task_lock(tsk);
ioc = tsk->io_context;
if (ioc != NULL) {
- BUG_ON(atomic_read(&ioc->refcount) == 0);
- atomic_inc(&ioc->refcount);
+ BUG_ON(atomic_long_read(&ioc->refcount) == 0);
+ atomic_long_inc(&ioc->refcount);
}
task_unlock(tsk);
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index 6d53859..1744223 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -1160,7 +1160,7 @@ static int __bfq_dispatch_requests(struct bfq_data *bfqd,
dispatched++;
if (bfqd->active_cic == NULL) {
- atomic_inc(&RQ_CIC(rq)->ioc->refcount);
+ atomic_long_inc(&RQ_CIC(rq)->ioc->refcount);
bfqd->active_cic = RQ_CIC(rq);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment