Whamcloud - gitweb
merge b_devel into HEAD (20030703)
[fs/lustre-release.git] / lustre / include / linux / lustre_otree.h
1 /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
2  * vim:expandtab:shiftwidth=8:tabstop=8:
3  */
4 #ifndef _LUSTRE_OTREE_H
5 #define _LUSTRE_OTREE_H
6
7 /* XXX ok, I can't make sense of our header nest right now.. */
8 #ifdef __KERNEL__
9 #include <linux/rbtree.h>
10 #include <linux/spinlock.h>
11
12 struct otree {
13         rb_root_t       ot_root;
14         spinlock_t      ot_lock;
15         unsigned long   ot_num_marked;
16 };
17 #else
18 struct otree {
19         unsigned long   lalala;
20 };
21 #endif
22
23 int ot_mark_offset(struct otree *ot, unsigned long offset);
24 int ot_clear_extent(struct otree *ot, unsigned long start, unsigned long end);
25 int ot_find_marked_extent(struct otree *ot, unsigned long *start,
26                           unsigned long *end);
27 int ot_last_marked(struct otree *ot, unsigned long *last);
28 unsigned long ot_num_marked(struct otree *ot);
29 void ot_init(struct otree *ot);
30
31 #endif