]>
Commit | Line | Data |
---|---|---|
57926640 CH |
1 | /* |
2 | * Copyright (c) 2000-2001,2005 Silicon Graphics, Inc. | |
3 | * All Rights Reserved. | |
4 | * | |
5 | * This program is free software; you can redistribute it and/or | |
6 | * modify it under the terms of the GNU General Public License as | |
7 | * published by the Free Software Foundation. | |
8 | * | |
9 | * This program is distributed in the hope that it would be useful, | |
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 | * GNU General Public License for more details. | |
13 | * | |
14 | * You should have received a copy of the GNU General Public License | |
15 | * along with this program; if not, write the Free Software Foundation, | |
16 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | |
17 | */ | |
18 | #ifndef __XFS_DIR2_PRIV_H__ | |
19 | #define __XFS_DIR2_PRIV_H__ | |
20 | ||
21 | /* xfs_dir2.c */ | |
22 | extern int xfs_dir_ino_validate(struct xfs_mount *mp, xfs_ino_t ino); | |
23 | extern int xfs_dir2_isblock(struct xfs_trans *tp, struct xfs_inode *dp, int *r); | |
24 | extern int xfs_dir2_isleaf(struct xfs_trans *tp, struct xfs_inode *dp, int *r); | |
25 | extern int xfs_dir2_grow_inode(struct xfs_da_args *args, int space, | |
26 | xfs_dir2_db_t *dbp); | |
27 | extern int xfs_dir2_shrink_inode(struct xfs_da_args *args, xfs_dir2_db_t db, | |
1d9025e5 | 28 | struct xfs_buf *bp); |
57926640 CH |
29 | extern int xfs_dir_cilookup_result(struct xfs_da_args *args, |
30 | const unsigned char *name, int len); | |
31 | ||
32 | /* xfs_dir2_block.c */ | |
33 | extern int xfs_dir2_block_addname(struct xfs_da_args *args); | |
34 | extern int xfs_dir2_block_getdents(struct xfs_inode *dp, void *dirent, | |
35 | xfs_off_t *offset, filldir_t filldir); | |
36 | extern int xfs_dir2_block_lookup(struct xfs_da_args *args); | |
37 | extern int xfs_dir2_block_removename(struct xfs_da_args *args); | |
38 | extern int xfs_dir2_block_replace(struct xfs_da_args *args); | |
39 | extern int xfs_dir2_leaf_to_block(struct xfs_da_args *args, | |
1d9025e5 | 40 | struct xfs_buf *lbp, struct xfs_buf *dbp); |
57926640 CH |
41 | |
42 | /* xfs_dir2_data.c */ | |
43 | #ifdef DEBUG | |
82025d7f | 44 | #define xfs_dir2_data_check(dp,bp) __xfs_dir2_data_check(dp, bp); |
57926640 CH |
45 | #else |
46 | #define xfs_dir2_data_check(dp,bp) | |
47 | #endif | |
b0f539de | 48 | extern void xfs_dir2_data_write_verify(struct xfs_buf *bp); |
82025d7f | 49 | extern int __xfs_dir2_data_check(struct xfs_inode *dp, struct xfs_buf *bp); |
e4813572 DC |
50 | extern int xfs_dir2_data_read(struct xfs_trans *tp, struct xfs_inode *dp, |
51 | xfs_dablk_t bno, xfs_daddr_t mapped_bno, struct xfs_buf **bpp); | |
da6958c8 DC |
52 | extern int xfs_dir2_data_readahead(struct xfs_trans *tp, struct xfs_inode *dp, |
53 | xfs_dablk_t bno, xfs_daddr_t mapped_bno); | |
82025d7f | 54 | |
57926640 CH |
55 | extern struct xfs_dir2_data_free * |
56 | xfs_dir2_data_freeinsert(struct xfs_dir2_data_hdr *hdr, | |
57 | struct xfs_dir2_data_unused *dup, int *loghead); | |
58 | extern void xfs_dir2_data_freescan(struct xfs_mount *mp, | |
59 | struct xfs_dir2_data_hdr *hdr, int *loghead); | |
60 | extern int xfs_dir2_data_init(struct xfs_da_args *args, xfs_dir2_db_t blkno, | |
1d9025e5 DC |
61 | struct xfs_buf **bpp); |
62 | extern void xfs_dir2_data_log_entry(struct xfs_trans *tp, struct xfs_buf *bp, | |
57926640 CH |
63 | struct xfs_dir2_data_entry *dep); |
64 | extern void xfs_dir2_data_log_header(struct xfs_trans *tp, | |
1d9025e5 DC |
65 | struct xfs_buf *bp); |
66 | extern void xfs_dir2_data_log_unused(struct xfs_trans *tp, struct xfs_buf *bp, | |
57926640 | 67 | struct xfs_dir2_data_unused *dup); |
1d9025e5 | 68 | extern void xfs_dir2_data_make_free(struct xfs_trans *tp, struct xfs_buf *bp, |
57926640 CH |
69 | xfs_dir2_data_aoff_t offset, xfs_dir2_data_aoff_t len, |
70 | int *needlogp, int *needscanp); | |
1d9025e5 | 71 | extern void xfs_dir2_data_use_free(struct xfs_trans *tp, struct xfs_buf *bp, |
57926640 CH |
72 | struct xfs_dir2_data_unused *dup, xfs_dir2_data_aoff_t offset, |
73 | xfs_dir2_data_aoff_t len, int *needlogp, int *needscanp); | |
74 | ||
75 | /* xfs_dir2_leaf.c */ | |
612cfbfe | 76 | extern void xfs_dir2_leafn_read_verify(struct xfs_buf *bp); |
b0f539de | 77 | extern void xfs_dir2_leafn_write_verify(struct xfs_buf *bp); |
e6f7667c DC |
78 | extern int xfs_dir2_leafn_read(struct xfs_trans *tp, struct xfs_inode *dp, |
79 | xfs_dablk_t fbno, xfs_daddr_t mappedbno, struct xfs_buf **bpp); | |
57926640 | 80 | extern int xfs_dir2_block_to_leaf(struct xfs_da_args *args, |
1d9025e5 | 81 | struct xfs_buf *dbp); |
57926640 CH |
82 | extern int xfs_dir2_leaf_addname(struct xfs_da_args *args); |
83 | extern void xfs_dir2_leaf_compact(struct xfs_da_args *args, | |
1d9025e5 DC |
84 | struct xfs_buf *bp); |
85 | extern void xfs_dir2_leaf_compact_x1(struct xfs_buf *bp, int *indexp, | |
57926640 CH |
86 | int *lowstalep, int *highstalep, int *lowlogp, int *highlogp); |
87 | extern int xfs_dir2_leaf_getdents(struct xfs_inode *dp, void *dirent, | |
88 | size_t bufsize, xfs_off_t *offset, filldir_t filldir); | |
89 | extern int xfs_dir2_leaf_init(struct xfs_da_args *args, xfs_dir2_db_t bno, | |
1d9025e5 DC |
90 | struct xfs_buf **bpp, int magic); |
91 | extern void xfs_dir2_leaf_log_ents(struct xfs_trans *tp, struct xfs_buf *bp, | |
57926640 CH |
92 | int first, int last); |
93 | extern void xfs_dir2_leaf_log_header(struct xfs_trans *tp, | |
1d9025e5 | 94 | struct xfs_buf *bp); |
57926640 CH |
95 | extern int xfs_dir2_leaf_lookup(struct xfs_da_args *args); |
96 | extern int xfs_dir2_leaf_removename(struct xfs_da_args *args); | |
97 | extern int xfs_dir2_leaf_replace(struct xfs_da_args *args); | |
98 | extern int xfs_dir2_leaf_search_hash(struct xfs_da_args *args, | |
1d9025e5 | 99 | struct xfs_buf *lbp); |
57926640 | 100 | extern int xfs_dir2_leaf_trim_data(struct xfs_da_args *args, |
1d9025e5 | 101 | struct xfs_buf *lbp, xfs_dir2_db_t db); |
57926640 CH |
102 | extern struct xfs_dir2_leaf_entry * |
103 | xfs_dir2_leaf_find_entry(struct xfs_dir2_leaf *leaf, int index, int compact, | |
104 | int lowstale, int highstale, | |
105 | int *lfloglow, int *lfloghigh); | |
106 | extern int xfs_dir2_node_to_leaf(struct xfs_da_state *state); | |
107 | ||
108 | /* xfs_dir2_node.c */ | |
109 | extern int xfs_dir2_leaf_to_node(struct xfs_da_args *args, | |
1d9025e5 DC |
110 | struct xfs_buf *lbp); |
111 | extern xfs_dahash_t xfs_dir2_leafn_lasthash(struct xfs_buf *bp, int *count); | |
112 | extern int xfs_dir2_leafn_lookup_int(struct xfs_buf *bp, | |
57926640 CH |
113 | struct xfs_da_args *args, int *indexp, |
114 | struct xfs_da_state *state); | |
1d9025e5 DC |
115 | extern int xfs_dir2_leafn_order(struct xfs_buf *leaf1_bp, |
116 | struct xfs_buf *leaf2_bp); | |
57926640 CH |
117 | extern int xfs_dir2_leafn_split(struct xfs_da_state *state, |
118 | struct xfs_da_state_blk *oldblk, struct xfs_da_state_blk *newblk); | |
119 | extern int xfs_dir2_leafn_toosmall(struct xfs_da_state *state, int *action); | |
120 | extern void xfs_dir2_leafn_unbalance(struct xfs_da_state *state, | |
121 | struct xfs_da_state_blk *drop_blk, | |
122 | struct xfs_da_state_blk *save_blk); | |
123 | extern int xfs_dir2_node_addname(struct xfs_da_args *args); | |
124 | extern int xfs_dir2_node_lookup(struct xfs_da_args *args); | |
125 | extern int xfs_dir2_node_removename(struct xfs_da_args *args); | |
126 | extern int xfs_dir2_node_replace(struct xfs_da_args *args); | |
127 | extern int xfs_dir2_node_trim_free(struct xfs_da_args *args, xfs_fileoff_t fo, | |
128 | int *rvalp); | |
2025207c DC |
129 | extern int xfs_dir2_free_read(struct xfs_trans *tp, struct xfs_inode *dp, |
130 | xfs_dablk_t fbno, struct xfs_buf **bpp); | |
57926640 CH |
131 | |
132 | /* xfs_dir2_sf.c */ | |
133 | extern xfs_ino_t xfs_dir2_sf_get_parent_ino(struct xfs_dir2_sf_hdr *sfp); | |
134 | extern xfs_ino_t xfs_dir2_sfe_get_ino(struct xfs_dir2_sf_hdr *sfp, | |
135 | struct xfs_dir2_sf_entry *sfep); | |
136 | extern int xfs_dir2_block_sfsize(struct xfs_inode *dp, | |
137 | struct xfs_dir2_data_hdr *block, struct xfs_dir2_sf_hdr *sfhp); | |
1d9025e5 | 138 | extern int xfs_dir2_block_to_sf(struct xfs_da_args *args, struct xfs_buf *bp, |
57926640 CH |
139 | int size, xfs_dir2_sf_hdr_t *sfhp); |
140 | extern int xfs_dir2_sf_addname(struct xfs_da_args *args); | |
141 | extern int xfs_dir2_sf_create(struct xfs_da_args *args, xfs_ino_t pino); | |
142 | extern int xfs_dir2_sf_getdents(struct xfs_inode *dp, void *dirent, | |
143 | xfs_off_t *offset, filldir_t filldir); | |
144 | extern int xfs_dir2_sf_lookup(struct xfs_da_args *args); | |
145 | extern int xfs_dir2_sf_removename(struct xfs_da_args *args); | |
146 | extern int xfs_dir2_sf_replace(struct xfs_da_args *args); | |
147 | ||
148 | #endif /* __XFS_DIR2_PRIV_H__ */ |