Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37551
b: refs/heads/master
c: e4313dd
h: refs/heads/master
i:
  37549: a5a27a6
  37547: 1a8983e
  37543: 2688df8
  37535: 9e8cbfd
v: v3
  • Loading branch information
Jens Axboe authored and Jens Axboe committed Sep 30, 2006
1 parent 43fc8f8 commit 9f03c4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a893e837bb470867d74c05d6c6b97bba5a96185
refs/heads/master: e4313dd423148fa729571b50c06cbc0bedf5c494
9 changes: 5 additions & 4 deletions trunk/block/as-iosched.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ enum arq_state {
#define RQ_STATE(rq) ((enum arq_state)(rq)->elevator_private2)
#define RQ_SET_STATE(rq, state) ((rq)->elevator_private2 = (void *) state)

static atomic_t ioc_count = ATOMIC_INIT(0);
static DEFINE_PER_CPU(unsigned long, ioc_count);
static struct completion *ioc_gone;

static void as_move_to_dispatch(struct as_data *ad, struct request *rq);
Expand All @@ -163,7 +163,8 @@ static void as_antic_stop(struct as_data *ad);
static void free_as_io_context(struct as_io_context *aic)
{
kfree(aic);
if (atomic_dec_and_test(&ioc_count) && ioc_gone)
elv_ioc_count_dec(ioc_count);
if (ioc_gone && !elv_ioc_count_read(ioc_count))
complete(ioc_gone);
}

Expand Down Expand Up @@ -199,7 +200,7 @@ static struct as_io_context *alloc_as_io_context(void)
ret->seek_total = 0;
ret->seek_samples = 0;
ret->seek_mean = 0;
atomic_inc(&ioc_count);
elv_ioc_count_inc(ioc_count);
}

return ret;
Expand Down Expand Up @@ -1484,7 +1485,7 @@ static void __exit as_exit(void)
ioc_gone = &all_gone;
/* ioc_gone's update must be visible before reading ioc_count */
smp_wmb();
if (atomic_read(&ioc_count))
if (elv_ioc_count_read(ioc_count))
wait_for_completion(ioc_gone);
synchronize_rcu();
}
Expand Down

0 comments on commit 9f03c4f

Please sign in to comment.