Home | History | Annotate | Download | only in support

Lines Matching refs:blk

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