Lines Matching refs:blk

59 static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
65 info->dqi_usable_bs, (loff_t)blk << info->dqi_blocksize_bits);
68 static ssize_t write_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
74 info->dqi_usable_bs, (loff_t)blk << info->dqi_blocksize_bits);
117 int ret, blk;
122 blk = info->dqi_free_blk;
123 ret = read_blk(info, blk, buf);
137 blk = info->dqi_blocks++;
140 ret = blk;
147 static int put_free_dqblk(struct qtree_mem_dqinfo *info, char *buf, uint blk)
155 err = write_blk(info, blk, buf);
158 info->dqi_free_blk = blk;
165 uint blk)
201 if (write_blk(info, blk, buf) < 0)
203 "with free entries", blk);
212 uint blk)
222 err = write_blk(info, blk, buf);
230 cpu_to_le32(blk);
236 info->dqi_free_entry = blk;
260 uint blk, i;
272 blk = info->dqi_free_entry;
273 *err = read_blk(info, blk, buf);
280 blk = get_free_dqblk(info);
281 if ((int)blk < 0) {
282 *err = blk;
289 info->dqi_free_entry = blk;
294 *err = remove_free_dqentry(info, buf, blk);
297 "from entry free list", blk);
316 *err = write_blk(info, blk, buf);
319 blk);
322 dquot->dq_off = ((loff_t)blk << info->dqi_blocksize_bits) +
326 return blk;
449 uint blk)
457 if (dquot->dq_off >> info->dqi_blocksize_bits != blk) {
459 "other block (%u) than it should (%u)", blk,
464 ret = read_blk(info, blk, buf);
467 blk);
476 ret = remove_free_dqentry(info, buf, blk);
478 ret = put_free_dqblk(info, buf, blk);
481 "(%u) to free list", blk);
491 ret = insert_free_dqentry(info, buf, blk);
494 "data block (%u) to free entry list", blk);
498 ret = write_blk(info, blk, buf);
501 "data block %u", blk);
514 uint *blk, int depth)
523 ret = read_blk(info, *blk, buf);
526 *blk);
551 && *blk != QT_TREEOFF) {
552 put_free_dqblk(info, buf, *blk);
553 *blk = 0;
555 ret = write_blk(info, *blk, buf);
559 *blk);
580 struct dquot *dquot, uint blk)
589 ret = read_blk(info, blk, buf);
592 "block %u", blk);
608 ret = ((loff_t)blk << info->dqi_blocksize_bits) + sizeof(struct
618 struct dquot *dquot, uint blk, int depth)
626 ret = read_blk(info, blk, buf);
629 blk);
633 blk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]);
634 if (!blk) /* No reference? */
636 if (blk < QT_TREEOFF || blk >= info->dqi_blocks) {
638 blk, info->dqi_blocks);
644 ret = find_tree_dqentry(info, dquot, blk, depth+1);
646 ret = find_block_dqentry(info, dquot, blk);
733 unsigned int blk, int depth)
748 ret = read_blk(info, blk, buf);
751 "Can't read quota tree block %u", blk);