16 #include <linux/string.h>
18 #include <linux/kernel.h>
20 #include <linux/slab.h>
26 #define ERRBUFSIZE 1024
33 if (err_buf ==
NULL) {
51 if (err_buf ==
NULL) {
68 #ifdef CONFIG_BEFS_DEBUG
73 if (BEFS_SB(sb)->mount_opts.debug) {
75 if (err_buf ==
NULL) {
90 #endif //CONFIG_BEFS_DEBUG
96 #ifdef CONFIG_BEFS_DEBUG
98 befs_block_run tmp_run;
102 befs_debug(sb,
" magic1 %08x", fs32_to_cpu(sb, inode->magic1));
104 tmp_run = fsrun_to_cpu(sb, inode->inode_num);
106 tmp_run.allocation_group, tmp_run.start, tmp_run.len);
108 befs_debug(sb,
" uid %u", fs32_to_cpu(sb, inode->uid));
109 befs_debug(sb,
" gid %u", fs32_to_cpu(sb, inode->gid));
110 befs_debug(sb,
" mode %08x", fs32_to_cpu(sb, inode->mode));
111 befs_debug(sb,
" flags %08x", fs32_to_cpu(sb, inode->flags));
113 fs64_to_cpu(sb, inode->create_time));
115 fs64_to_cpu(sb, inode->last_modified_time));
117 tmp_run = fsrun_to_cpu(sb, inode->parent);
119 tmp_run.allocation_group, tmp_run.start, tmp_run.len);
121 tmp_run = fsrun_to_cpu(sb, inode->attributes);
123 tmp_run.allocation_group, tmp_run.start, tmp_run.len);
125 befs_debug(sb,
" type %08x", fs32_to_cpu(sb, inode->type));
126 befs_debug(sb,
" inode_size %u", fs32_to_cpu(sb, inode->inode_size));
128 if (
S_ISLNK(fs32_to_cpu(sb, inode->mode))) {
129 befs_debug(sb,
" Symbolic link [%s]", inode->data.symlink);
135 fsrun_to_cpu(sb, inode->data.datastream.direct[i]);
136 befs_debug(sb,
" direct %d [%u, %hu, %hu]", i,
137 tmp_run.allocation_group, tmp_run.start,
142 inode->data.datastream.
145 tmp_run = fsrun_to_cpu(sb, inode->data.datastream.indirect);
147 tmp_run.allocation_group,
148 tmp_run.start, tmp_run.len);
152 inode->data.datastream.
153 max_indirect_range));
156 fsrun_to_cpu(sb, inode->data.datastream.double_indirect);
157 befs_debug(sb,
" double indirect [%u, %hu, %hu]",
158 tmp_run.allocation_group, tmp_run.start,
161 befs_debug(sb,
" max_double_indirect_range %Lu",
163 inode->data.datastream.
164 max_double_indirect_range));
167 fs64_to_cpu(sb, inode->data.datastream.size));
170 #endif //CONFIG_BEFS_DEBUG
180 #ifdef CONFIG_BEFS_DEBUG
182 befs_block_run tmp_run;
184 befs_debug(sb,
"befs_super_block information");
187 befs_debug(sb,
" magic1 %08x", fs32_to_cpu(sb, sup->magic1));
189 fs32_to_cpu(sb, sup->fs_byte_order));
191 befs_debug(sb,
" block_size %u", fs32_to_cpu(sb, sup->block_size));
192 befs_debug(sb,
" block_shift %u", fs32_to_cpu(sb, sup->block_shift));
194 befs_debug(sb,
" num_blocks %Lu", fs64_to_cpu(sb, sup->num_blocks));
195 befs_debug(sb,
" used_blocks %Lu", fs64_to_cpu(sb, sup->used_blocks));
197 befs_debug(sb,
" magic2 %08x", fs32_to_cpu(sb, sup->magic2));
199 fs32_to_cpu(sb, sup->blocks_per_ag));
200 befs_debug(sb,
" ag_shift %u", fs32_to_cpu(sb, sup->ag_shift));
201 befs_debug(sb,
" num_ags %u", fs32_to_cpu(sb, sup->num_ags));
203 befs_debug(sb,
" flags %08x", fs32_to_cpu(sb, sup->flags));
205 tmp_run = fsrun_to_cpu(sb, sup->log_blocks);
207 tmp_run.allocation_group, tmp_run.start, tmp_run.len);
209 befs_debug(sb,
" log_start %Ld", fs64_to_cpu(sb, sup->log_start));
210 befs_debug(sb,
" log_end %Ld", fs64_to_cpu(sb, sup->log_end));
212 befs_debug(sb,
" magic3 %08x", fs32_to_cpu(sb, sup->magic3));
214 tmp_run = fsrun_to_cpu(sb, sup->root_dir);
216 tmp_run.allocation_group, tmp_run.start, tmp_run.len);
218 tmp_run = fsrun_to_cpu(sb, sup->indices);
220 tmp_run.allocation_group, tmp_run.start, tmp_run.len);
222 #endif //CONFIG_BEFS_DEBUG
228 befs_dump_small_data(
const struct super_block *
sb, befs_small_data *
sd)
236 #ifdef CONFIG_BEFS_DEBUG
238 befs_block_run
n = fsrun_to_cpu(sb, run);
240 befs_debug(sb,
"[%u, %hu, %hu]", n.allocation_group, n.start, n.len);
242 #endif //CONFIG_BEFS_DEBUG
249 #ifdef CONFIG_BEFS_DEBUG
252 befs_debug(sb,
" magic %08x", fs32_to_cpu(sb, super->magic));
253 befs_debug(sb,
" node_size %u", fs32_to_cpu(sb, super->node_size));
254 befs_debug(sb,
" max_depth %08x", fs32_to_cpu(sb, super->max_depth));
256 befs_debug(sb,
" data_type %08x", fs32_to_cpu(sb, super->data_type));
258 fs64_to_cpu(sb, super->root_node_ptr));
260 fs64_to_cpu(sb, super->free_node_ptr));
262 fs64_to_cpu(sb, super->max_size));
264 #endif //CONFIG_BEFS_DEBUG
270 #ifdef CONFIG_BEFS_DEBUG
273 befs_debug(sb,
" left %016LX", fs64_to_cpu(sb, node->left));
274 befs_debug(sb,
" right %016LX", fs64_to_cpu(sb, node->right));
275 befs_debug(sb,
" overflow %016LX", fs64_to_cpu(sb, node->overflow));
277 fs16_to_cpu(sb, node->all_key_count));
279 fs16_to_cpu(sb, node->all_key_length));
281 #endif //CONFIG_BEFS_DEBUG