revert-mm-fix-blkdev-size-calculation-in-generic_write_checks
[linux-2.6/linux-trees-mm.git] / fs / reiser4 / plugin / item / cde.h
blobf599714415c871de1143cea88653c31342e2ca44
1 /* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */
3 /* Compound directory item. See cde.c for description. */
5 #if !defined( __FS_REISER4_PLUGIN_COMPRESSED_DE_H__ )
6 #define __FS_REISER4_PLUGIN_COMPRESSED_DE_H__
8 #include "../../forward.h"
9 #include "../../kassign.h"
10 #include "../../dformat.h"
12 #include <linux/fs.h> /* for struct inode */
13 #include <linux/dcache.h> /* for struct dentry, etc */
15 typedef struct cde_unit_header {
16 de_id hash;
17 d16 offset;
18 } cde_unit_header;
20 typedef struct cde_item_format {
21 d16 num_of_entries;
22 cde_unit_header entry[0];
23 } cde_item_format;
25 struct cde_entry {
26 const struct inode *dir;
27 const struct inode *obj;
28 const struct qstr *name;
31 struct cde_entry_data {
32 int num_of_entries;
33 struct cde_entry *entry;
36 /* plugin->item.b.* */
37 reiser4_key *max_key_inside_cde(const coord_t * coord, reiser4_key * result);
38 int can_contain_key_cde(const coord_t * coord, const reiser4_key * key,
39 const reiser4_item_data *);
40 int mergeable_cde(const coord_t * p1, const coord_t * p2);
41 pos_in_node_t nr_units_cde(const coord_t * coord);
42 reiser4_key *unit_key_cde(const coord_t * coord, reiser4_key * key);
43 int estimate_cde(const coord_t * coord, const reiser4_item_data * data);
44 void print_cde(const char *prefix, coord_t * coord);
45 int init_cde(coord_t * coord, coord_t * from, reiser4_item_data * data);
46 lookup_result lookup_cde(const reiser4_key * key, lookup_bias bias,
47 coord_t * coord);
48 int paste_cde(coord_t * coord, reiser4_item_data * data,
49 carry_plugin_info * info UNUSED_ARG);
50 int can_shift_cde(unsigned free_space, coord_t * coord, znode * target,
51 shift_direction pend, unsigned *size, unsigned want);
52 void copy_units_cde(coord_t * target, coord_t * source, unsigned from,
53 unsigned count, shift_direction where_is_free_space,
54 unsigned free_space);
55 int cut_units_cde(coord_t * coord, pos_in_node_t from, pos_in_node_t to,
56 struct carry_cut_data *, reiser4_key * smallest_removed,
57 reiser4_key * new_first);
58 int kill_units_cde(coord_t * coord, pos_in_node_t from, pos_in_node_t to,
59 struct carry_kill_data *, reiser4_key * smallest_removed,
60 reiser4_key * new_first);
61 void print_cde(const char *prefix, coord_t * coord);
62 int reiser4_check_cde(const coord_t * coord, const char **error);
64 /* plugin->u.item.s.dir.* */
65 int extract_key_cde(const coord_t * coord, reiser4_key * key);
66 int update_key_cde(const coord_t * coord, const reiser4_key * key,
67 lock_handle * lh);
68 char *extract_name_cde(const coord_t * coord, char *buf);
69 int add_entry_cde(struct inode *dir, coord_t * coord,
70 lock_handle * lh, const struct dentry *name,
71 reiser4_dir_entry_desc * entry);
72 int rem_entry_cde(struct inode *dir, const struct qstr *name, coord_t * coord,
73 lock_handle * lh, reiser4_dir_entry_desc * entry);
74 int max_name_len_cde(const struct inode *dir);
76 /* __FS_REISER4_PLUGIN_COMPRESSED_DE_H__ */
77 #endif
79 /* Make Linus happy.
80 Local variables:
81 c-indentation-style: "K&R"
82 mode-name: "LC"
83 c-basic-offset: 8
84 tab-width: 8
85 fill-column: 120
86 End: