• Home
  • Raw
  • Download

Lines Matching refs:blk

62 static void read_blk(struct quota_handle *h, unsigned int blk, dqbuf_t buf)  in read_blk()  argument
66 err = h->e2fs_read(&h->qh_qf, blk << QT_BLKSIZE_BITS, buf, in read_blk()
69 log_err("Cannot read block %u: %s", blk, strerror(errno)); in read_blk()
75 static int write_blk(struct quota_handle *h, unsigned int blk, dqbuf_t buf) in write_blk() argument
79 err = h->e2fs_write(&h->qh_qf, blk << QT_BLKSIZE_BITS, buf, in write_blk()
82 log_err("Cannot write block (%u): %s", blk, strerror(errno)); in write_blk()
94 int blk; in get_free_dqblk() local
100 blk = info->dqi_free_blk; in get_free_dqblk()
101 read_blk(h, blk, buf); in get_free_dqblk()
112 blk = info->dqi_blocks++; in get_free_dqblk()
116 return blk; in get_free_dqblk()
121 unsigned int blk) in put_free_dqblk() argument
129 info->dqi_free_blk = blk; in put_free_dqblk()
131 write_blk(h, blk, buf); in put_free_dqblk()
136 unsigned int blk) in remove_free_dqentry() argument
164 write_blk(h, blk, buf); /* No matter whether write succeeds in remove_free_dqentry()
170 unsigned int blk) in insert_free_dqentry() argument
181 write_blk(h, blk, buf); in insert_free_dqentry()
185 ext2fs_cpu_to_le32(blk); in insert_free_dqentry()
189 info->dqi_free_entry = blk; in insert_free_dqentry()
197 int blk, i; in find_free_dqentry() local
212 blk = info->dqi_free_entry; in find_free_dqentry()
213 read_blk(h, blk, buf); in find_free_dqentry()
215 blk = get_free_dqblk(h); in find_free_dqentry()
216 if (blk < 0) { in find_free_dqentry()
218 *err = blk; in find_free_dqentry()
222 info->dqi_free_entry = blk; in find_free_dqentry()
229 remove_free_dqentry(h, buf, blk); in find_free_dqentry()
243 write_blk(h, blk, buf); in find_free_dqentry()
245 (blk << QT_BLKSIZE_BITS) + sizeof(struct qt_disk_dqdbheader) + in find_free_dqentry()
248 return blk; in find_free_dqentry()
355 unsigned int blk) in free_dqentry() argument
364 if (dquot->dq_dqb.u.v2_mdqb.dqb_off >> QT_BLKSIZE_BITS != blk) in free_dqentry()
366 "than it should (%u).", blk, in free_dqentry()
370 read_blk(h, blk, buf); in free_dqentry()
376 remove_free_dqentry(h, buf, blk); in free_dqentry()
377 put_free_dqblk(h, buf, blk); in free_dqentry()
387 insert_free_dqentry(h, buf, blk); in free_dqentry()
389 write_blk(h, blk, buf); in free_dqentry()
397 unsigned int * blk, int depth) in remove_tree() argument
406 read_blk(h, *blk, buf); in remove_tree()
424 if (i == QT_BLKSIZE && *blk != QT_TREEOFF) { in remove_tree()
425 put_free_dqblk(h, buf, *blk); in remove_tree()
426 *blk = 0; in remove_tree()
428 write_blk(h, *blk, buf); in remove_tree()
446 struct dquot *dquot, unsigned int blk) in find_block_dqentry() argument
456 read_blk(h, blk, buf); in find_block_dqentry()
466 return (blk << QT_BLKSIZE_BITS) + sizeof(struct qt_disk_dqdbheader) + in find_block_dqentry()
473 unsigned int blk, int depth) in find_tree_dqentry() argument
482 read_blk(h, blk, buf); in find_tree_dqentry()
484 blk = ext2fs_le32_to_cpu(ref[get_index(dquot->dq_id, depth)]); in find_tree_dqentry()
485 if (!blk) /* No reference? */ in find_tree_dqentry()
488 ret = find_tree_dqentry(h, dquot, blk, depth + 1); in find_tree_dqentry()
490 ret = find_block_dqentry(h, dquot, blk); in find_tree_dqentry()
549 static int report_block(struct dquot *dquot, unsigned int blk, char *bitmap, in report_block() argument
563 set_bit(bitmap, blk); in report_block()
564 read_blk(dquot->dq_h, blk, buf); in report_block()
572 (blk << QT_BLKSIZE_BITS) + in report_block()
583 static void check_reference(struct quota_handle *h, unsigned int blk) in check_reference() argument
585 if (blk >= h->qh_info.u.v2_mdqi.dqi_qtree.dqi_blocks) in check_reference()
589 blk, in check_reference()
594 static int report_tree(struct dquot *dquot, unsigned int blk, int depth, in report_tree() argument
606 read_blk(dquot->dq_h, blk, buf); in report_tree()
609 blk = ext2fs_le32_to_cpu(ref[i]); in report_tree()
610 check_reference(dquot->dq_h, blk); in report_tree()
611 if (blk && !get_bit(bitmap, blk)) in report_tree()
612 entries += report_block(dquot, blk, bitmap, in report_tree()
617 blk = ext2fs_le32_to_cpu(ref[i]); in report_tree()
618 if (blk) { in report_tree()
619 check_reference(dquot->dq_h, blk); in report_tree()
620 entries += report_tree(dquot, blk, depth + 1, in report_tree()