1 /* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */
3 /* Tree Access Pointers. See tap.c for more details. */
5 #if !defined( __REISER4_TAP_H__ )
6 #define __REISER4_TAP_H__
12 tree_access_pointer aka tap. Data structure combining coord_t and lock
14 Invariants involving this data-type, see doc/lock-ordering for details:
18 struct tree_access_pointer
{
21 /* lock handle on ->coord->node */
23 /* mode of lock acquired by this tap */
25 /* incremented by reiser4_tap_load().
26 Decremented by reiser4_tap_relse(). */
29 struct list_head linkage
;
34 typedef int (*go_actor_t
) (tap_t
* tap
);
36 extern int reiser4_tap_load(tap_t
* tap
);
37 extern void reiser4_tap_relse(tap_t
* tap
);
38 extern void reiser4_tap_init(tap_t
* tap
, coord_t
* coord
, lock_handle
* lh
,
39 znode_lock_mode mode
);
40 extern void reiser4_tap_monitor(tap_t
* tap
);
41 extern void reiser4_tap_copy(tap_t
* dst
, tap_t
* src
);
42 extern void reiser4_tap_done(tap_t
* tap
);
43 extern int reiser4_tap_move(tap_t
* tap
, lock_handle
* target
);
44 extern int tap_to_coord(tap_t
* tap
, coord_t
* target
);
46 extern int go_dir_el(tap_t
* tap
, sideof dir
, int units_p
);
47 extern int go_next_unit(tap_t
* tap
);
48 extern int go_prev_unit(tap_t
* tap
);
49 extern int rewind_right(tap_t
* tap
, int shift
);
50 extern int rewind_left(tap_t
* tap
, int shift
);
52 extern struct list_head
*reiser4_taps_list(void);
54 #define for_all_taps(tap) \
55 for (tap = list_entry(reiser4_taps_list()->next, tap_t, linkage); \
56 reiser4_taps_list() != &tap->linkage; \
57 tap = list_entry(tap->linkage.next, tap_t, linkage))
59 /* __REISER4_TAP_H__ */
63 c-indentation-style: "K&R"