Lines Matching refs:sb

24 static int befs_find_brun_direct(struct super_block *sb,
28 static int befs_find_brun_indirect(struct super_block *sb,
33 static int befs_find_brun_dblindirect(struct super_block *sb,
40 * @sb: Filesystem superblock
49 befs_read_datastream(struct super_block *sb, const befs_data_stream *ds,
56 befs_debug(sb, "---> %s %llu", __func__, pos);
57 block = pos >> BEFS_SB(sb)->block_shift;
59 *off = pos - (block << BEFS_SB(sb)->block_shift);
61 if (befs_fblock2brun(sb, ds, block, &run) != BEFS_OK) {
62 befs_error(sb, "BeFS: Error finding disk addr of block %lu",
64 befs_debug(sb, "<--- %s ERROR", __func__);
67 bh = befs_bread_iaddr(sb, run);
69 befs_error(sb, "BeFS: Error reading block %lu from datastream",
74 befs_debug(sb, "<--- %s read data, starting at %llu", __func__, pos);
81 * @sb: the superblock
95 befs_fblock2brun(struct super_block *sb, const befs_data_stream *data,
99 befs_off_t pos = fblock << BEFS_SB(sb)->block_shift;
102 err = befs_find_brun_direct(sb, data, fblock, run);
105 err = befs_find_brun_indirect(sb, data, fblock, run);
108 err = befs_find_brun_dblindirect(sb, data, fblock, run);
111 befs_error(sb,
122 * @sb: Filesystem superblock
130 befs_read_lsymlink(struct super_block *sb, const befs_data_stream *ds,
137 befs_debug(sb, "---> %s length: %llu", __func__, len);
140 bh = befs_read_datastream(sb, ds, bytes_read, NULL);
142 befs_error(sb, "BeFS: Error reading datastream block "
144 befs_debug(sb, "<--- %s ERROR", __func__);
148 plen = ((bytes_read + BEFS_SB(sb)->block_size) < len) ?
149 BEFS_SB(sb)->block_size : len - bytes_read;
155 befs_debug(sb, "<--- %s read %u bytes", __func__, (unsigned int)
162 * @sb: Filesystem superblock
172 befs_count_blocks(struct super_block *sb, const befs_data_stream *ds)
177 struct befs_sb_info *befs_sb = BEFS_SB(sb);
179 befs_debug(sb, "---> %s", __func__);
209 indirblocks = dbl_bruns / befs_iaddrs_per_block(sb);
216 befs_debug(sb, "<--- %s %u blocks", __func__, (unsigned int)blocks);
223 * @sb: the superblock
251 befs_find_brun_direct(struct super_block *sb, const befs_data_stream *data,
258 befs_debug(sb, "---> %s, find %lu", __func__, (unsigned long)blockno);
269 befs_debug(sb, "---> %s, "
276 befs_error(sb, "%s failed to find file block %lu", __func__,
278 befs_debug(sb, "---> %s ERROR", __func__);
284 * @sb: the superblock
305 befs_find_brun_indirect(struct super_block *sb,
318 befs_blocknr_t indirblockno = iaddr2blockno(sb, &indirect);
319 int arraylen = befs_iaddrs_per_block(sb);
321 befs_debug(sb, "---> %s, find %lu", __func__, (unsigned long)blockno);
323 indir_start_blk = data->max_direct_range >> BEFS_SB(sb)->block_shift;
328 indirblock = sb_bread(sb, indirblockno + i);
330 befs_error(sb, "---> %s failed to read "
333 befs_debug(sb, "<--- %s ERROR", __func__);
340 int len = fs16_to_cpu(sb, array[j].len);
345 fs32_to_cpu(sb, array[j].allocation_group);
347 fs16_to_cpu(sb, array[j].start) + offset;
349 fs16_to_cpu(sb, array[j].len) - offset;
352 befs_debug(sb,
366 befs_error(sb, "BeFS: %s failed to find "
369 befs_debug(sb, "<--- %s ERROR", __func__);
375 * @sb: the superblock
414 befs_find_brun_dblindirect(struct super_block *sb,
434 data->max_indirect_range >> BEFS_SB(sb)->block_shift;
446 size_t diblklen = iblklen * befs_iaddrs_per_block(sb)
449 befs_debug(sb, "---> %s find %lu", __func__, (unsigned long)blockno);
462 dbl_which_block = dblindir_indx / befs_iaddrs_per_block(sb);
464 befs_error(sb, "The double-indirect index calculated by "
472 sb_bread(sb, iaddr2blockno(sb, &data->double_indirect) +
475 befs_error(sb, "%s couldn't read the "
478 iaddr2blockno(sb, &data->double_indirect) +
484 dblindir_indx - (dbl_which_block * befs_iaddrs_per_block(sb));
486 indir_run = fsrun_to_cpu(sb, iaddr_array[dbl_block_indx]);
490 which_block = indir_indx / befs_iaddrs_per_block(sb);
492 befs_error(sb, "The indirect index calculated by "
499 sb_bread(sb, iaddr2blockno(sb, &indir_run) + which_block);
501 befs_error(sb, "%s couldn't read the indirect block "
503 iaddr2blockno(sb, &indir_run) + which_block);
507 block_indx = indir_indx - (which_block * befs_iaddrs_per_block(sb));
509 *run = fsrun_to_cpu(sb, iaddr_array[block_indx]);
520 befs_debug(sb, "Found file block %lu in double_indirect[%d][%d],"