revert-mm-fix-blkdev-size-calculation-in-generic_write_checks
[linux-2.6/linux-trees-mm.git] / fs / reiser4 / tap.h
blob1416729cf3e781e4f8385d0f296d8353773342fe
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__
8 #include "forward.h"
9 #include "readahead.h"
11 /**
12 tree_access_pointer aka tap. Data structure combining coord_t and lock
13 handle.
14 Invariants involving this data-type, see doc/lock-ordering for details:
16 [tap-sane]
18 struct tree_access_pointer {
19 /* coord tap is at */
20 coord_t *coord;
21 /* lock handle on ->coord->node */
22 lock_handle *lh;
23 /* mode of lock acquired by this tap */
24 znode_lock_mode mode;
25 /* incremented by reiser4_tap_load().
26 Decremented by reiser4_tap_relse(). */
27 int loaded;
28 /* list of taps */
29 struct list_head linkage;
30 /* read-ahead hint */
31 ra_info_t ra_info;
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__ */
60 #endif
61 /* Make Linus happy.
62 Local variables:
63 c-indentation-style: "K&R"
64 mode-name: "LC"
65 c-basic-offset: 8
66 tab-width: 8
67 fill-column: 120
68 scroll-step: 1
69 End: