Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359319
b: refs/heads/master
c: 4106eca
h: refs/heads/master
i:
  359317: b6fde0c
  359315: 83a77ef
  359311: ee26a64
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent 958957e commit d764400
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 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: fe6e24ec90b753392c3f9ec1fbca196c4e88e511
refs/heads/master: 4106ecaf59b79efff3f9b466baf9e8c67e19ac5a
28 changes: 12 additions & 16 deletions trunk/include/linux/idr.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,28 +49,24 @@
#define MAX_IDR_FREE (MAX_IDR_LEVEL * 2)

struct idr_layer {
unsigned long bitmap; /* A zero bit means "space here" */
unsigned long bitmap; /* A zero bit means "space here" */
struct idr_layer __rcu *ary[1<<IDR_BITS];
int count; /* When zero, we can release it */
int layer; /* distance from leaf */
struct rcu_head rcu_head;
int count; /* When zero, we can release it */
int layer; /* distance from leaf */
struct rcu_head rcu_head;
};

struct idr {
struct idr_layer __rcu *top;
struct idr_layer *id_free;
int layers; /* only valid without concurrent changes */
int id_free_cnt;
spinlock_t lock;
struct idr_layer __rcu *top;
struct idr_layer *id_free;
int layers; /* only valid w/o concurrent changes */
int id_free_cnt;
spinlock_t lock;
};

#define IDR_INIT(name) \
{ \
.top = NULL, \
.id_free = NULL, \
.layers = 0, \
.id_free_cnt = 0, \
.lock = __SPIN_LOCK_UNLOCKED(name.lock), \
#define IDR_INIT(name) \
{ \
.lock = __SPIN_LOCK_UNLOCKED(name.lock), \
}
#define DEFINE_IDR(name) struct idr name = IDR_INIT(name)

Expand Down

0 comments on commit d764400

Please sign in to comment.