Lines Matching defs:blk

50 static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
56 info->dqi_usable_bs, (loff_t)blk << info->dqi_blocksize_bits);
59 static ssize_t write_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf)
65 info->dqi_usable_bs, (loff_t)blk << info->dqi_blocksize_bits);
113 int ret, blk;
118 blk = info->dqi_free_blk;
119 ret = read_blk(info, blk, buf);
133 blk = info->dqi_blocks++;
136 ret = blk;
143 static int put_free_dqblk(struct qtree_mem_dqinfo *info, char *buf, uint blk)
151 err = write_blk(info, blk, buf);
154 info->dqi_free_blk = blk;
161 uint blk)
197 if (write_blk(info, blk, buf) < 0)
199 "with free entries", blk);
208 uint blk)
218 err = write_blk(info, blk, buf);
226 cpu_to_le32(blk);
232 info->dqi_free_entry = blk;
256 uint blk, i;
268 blk = info->dqi_free_entry;
269 *err = read_blk(info, blk, buf);
276 blk = get_free_dqblk(info);
277 if ((int)blk < 0) {
278 *err = blk;
285 info->dqi_free_entry = blk;
290 *err = remove_free_dqentry(info, buf, blk);
293 "from entry free list", blk);
312 *err = write_blk(info, blk, buf);
315 blk);
318 dquot->dq_off = ((loff_t)blk << info->dqi_blocksize_bits) +
322 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);
549 && *blk != QT_TREEOFF) {
550 put_free_dqblk(info, buf, *blk);
551 *blk = 0;
553 ret = write_blk(info, *blk, buf);
557 *blk);
578 struct dquot *dquot, uint blk)
587 ret = read_blk(info, blk, buf);
590 "block %u", blk);
606 ret = ((loff_t)blk << info->dqi_blocksize_bits) + sizeof(struct
616 struct dquot *dquot, uint blk, int depth)
624 ret = read_blk(info, blk, buf);
627 blk);
631 blk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]);
632 if (!blk) /* No reference? */
634 ret = do_check_range(dquot->dq_sb, "block", blk, QT_TREEOFF,
640 ret = find_tree_dqentry(info, dquot, blk, depth+1);
642 ret = find_block_dqentry(info, dquot, blk);
729 unsigned int blk, int depth)
744 ret = read_blk(info, blk, buf);
747 "Can't read quota tree block %u", blk);