Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 37550
b: refs/heads/master
c: 4a893e8
h: refs/heads/master
v: v3
  • Loading branch information
Jens Axboe authored and Jens Axboe committed Sep 30, 2006
1 parent a5a27a6 commit 43fc8f8
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fc46379daf90dce57bf765c81d3b39f55150aac2
refs/heads/master: 4a893e837bb470867d74c05d6c6b97bba5a96185
25 changes: 25 additions & 0 deletions trunk/include/linux/elevator.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#ifndef _LINUX_ELEVATOR_H
#define _LINUX_ELEVATOR_H

#include <linux/percpu.h>

typedef int (elevator_merge_fn) (request_queue_t *, struct request **,
struct bio *);

Expand Down Expand Up @@ -178,4 +180,27 @@ enum {
INIT_LIST_HEAD(&(rq)->donelist); \
} while (0)

/*
* io context count accounting
*/
#define elv_ioc_count_mod(name, __val) \
do { \
preempt_disable(); \
__get_cpu_var(name) += (__val); \
preempt_enable(); \
} while (0)

#define elv_ioc_count_inc(name) elv_ioc_count_mod(name, 1)
#define elv_ioc_count_dec(name) elv_ioc_count_mod(name, -1)

#define elv_ioc_count_read(name) \
({ \
unsigned long __val = 0; \
int __cpu; \
smp_wmb(); \
for_each_possible_cpu(__cpu) \
__val += per_cpu(name, __cpu); \
__val; \
})

#endif

0 comments on commit 43fc8f8

Please sign in to comment.