Lines Matching refs:blk
52 static ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf) in read_blk() argument
58 info->dqi_usable_bs, blk << info->dqi_blocksize_bits); in read_blk()
61 static ssize_t write_blk(struct qtree_mem_dqinfo *info, uint blk, char *buf) in write_blk() argument
67 info->dqi_usable_bs, blk << info->dqi_blocksize_bits); in write_blk()
81 int ret, blk; in get_free_dqblk() local
86 blk = info->dqi_free_blk; in get_free_dqblk()
87 ret = read_blk(info, blk, buf); in get_free_dqblk()
98 blk = info->dqi_blocks++; in get_free_dqblk()
101 ret = blk; in get_free_dqblk()
108 static int put_free_dqblk(struct qtree_mem_dqinfo *info, char *buf, uint blk) in put_free_dqblk() argument
116 err = write_blk(info, blk, buf); in put_free_dqblk()
119 info->dqi_free_blk = blk; in put_free_dqblk()
126 uint blk) in remove_free_dqentry() argument
162 if (write_blk(info, blk, buf) < 0) in remove_free_dqentry()
164 "with free entries", blk); in remove_free_dqentry()
173 uint blk) in insert_free_dqentry() argument
183 err = write_blk(info, blk, buf); in insert_free_dqentry()
191 cpu_to_le32(blk); in insert_free_dqentry()
197 info->dqi_free_entry = blk; in insert_free_dqentry()
221 uint blk, i; in find_free_dqentry() local
233 blk = info->dqi_free_entry; in find_free_dqentry()
234 *err = read_blk(info, blk, buf); in find_free_dqentry()
238 blk = get_free_dqblk(info); in find_free_dqentry()
239 if ((int)blk < 0) { in find_free_dqentry()
240 *err = blk; in find_free_dqentry()
247 info->dqi_free_entry = blk; in find_free_dqentry()
252 *err = remove_free_dqentry(info, buf, blk); in find_free_dqentry()
255 "from entry free list", blk); in find_free_dqentry()
274 *err = write_blk(info, blk, buf); in find_free_dqentry()
277 blk); in find_free_dqentry()
280 dquot->dq_off = (blk << info->dqi_blocksize_bits) + in find_free_dqentry()
284 return blk; in find_free_dqentry()
400 uint blk) in free_dqentry() argument
408 if (dquot->dq_off >> info->dqi_blocksize_bits != blk) { in free_dqentry()
410 "other block (%u) than it should (%u)", blk, in free_dqentry()
414 ret = read_blk(info, blk, buf); in free_dqentry()
417 blk); in free_dqentry()
423 ret = remove_free_dqentry(info, buf, blk); in free_dqentry()
425 ret = put_free_dqblk(info, buf, blk); in free_dqentry()
428 "(%u) to free list", blk); in free_dqentry()
438 ret = insert_free_dqentry(info, buf, blk); in free_dqentry()
441 "data block (%u) to free entry list", blk); in free_dqentry()
445 ret = write_blk(info, blk, buf); in free_dqentry()
448 "data block %u", blk); in free_dqentry()
461 uint *blk, int depth) in remove_tree() argument
470 ret = read_blk(info, *blk, buf); in remove_tree()
473 *blk); in remove_tree()
491 && *blk != QT_TREEOFF) { in remove_tree()
492 put_free_dqblk(info, buf, *blk); in remove_tree()
493 *blk = 0; in remove_tree()
495 ret = write_blk(info, *blk, buf); in remove_tree()
499 *blk); in remove_tree()
520 struct dquot *dquot, uint blk) in find_block_dqentry() argument
529 ret = read_blk(info, blk, buf); in find_block_dqentry()
532 "block %u", blk); in find_block_dqentry()
548 ret = (blk << info->dqi_blocksize_bits) + sizeof(struct in find_block_dqentry()
558 struct dquot *dquot, uint blk, int depth) in find_tree_dqentry() argument
566 ret = read_blk(info, blk, buf); in find_tree_dqentry()
569 blk); in find_tree_dqentry()
573 blk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]); in find_tree_dqentry()
574 if (!blk) /* No reference? */ in find_tree_dqentry()
577 ret = find_tree_dqentry(info, dquot, blk, depth+1); in find_tree_dqentry()
579 ret = find_block_dqentry(info, dquot, blk); in find_tree_dqentry()