Lines Matching refs:dquot
214 struct dquot *dquot, int *err) in find_free_dqentry() argument
242 mark_info_dirty(dquot->dq_sb, dquot->dq_type); in find_free_dqentry()
273 dquot->dq_off = (blk << info->dqi_blocksize_bits) + in find_free_dqentry()
284 static int do_insert_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot, in do_insert_tree() argument
310 newblk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]); in do_insert_tree()
319 dquot->dq_id, depth)])); in do_insert_tree()
324 newblk = find_free_dqentry(info, dquot, &ret); in do_insert_tree()
326 ret = do_insert_tree(info, dquot, &newblk, depth+1); in do_insert_tree()
329 ref[get_index(info, dquot->dq_id, depth)] = in do_insert_tree()
342 struct dquot *dquot) in dq_insert_tree() argument
345 return do_insert_tree(info, dquot, &tmp, 0); in dq_insert_tree()
351 int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) in qtree_write_dquot() argument
353 int type = dquot->dq_type; in qtree_write_dquot()
354 struct super_block *sb = dquot->dq_sb; in qtree_write_dquot()
362 if (!dquot->dq_off) { in qtree_write_dquot()
363 ret = dq_insert_tree(info, dquot); in qtree_write_dquot()
372 info->dqi_ops->mem2disk_dqblk(ddquot, dquot); in qtree_write_dquot()
375 info->dqi_entry_size, dquot->dq_off); in qtree_write_dquot()
392 static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot, in free_dqentry() argument
401 if (dquot->dq_off >> info->dqi_blocksize_bits != blk) { in free_dqentry()
404 (uint)(dquot->dq_off >> info->dqi_blocksize_bits)); in free_dqentry()
425 (dquot->dq_off & ((1 << info->dqi_blocksize_bits) - 1)), in free_dqentry()
445 dquot->dq_off = 0; /* Quota is now unattached */ in free_dqentry()
452 static int remove_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot, in remove_tree() argument
467 newblk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]); in remove_tree()
469 ret = free_dqentry(info, dquot, newblk); in remove_tree()
472 ret = remove_tree(info, dquot, &newblk, depth+1); in remove_tree()
476 ref[get_index(info, dquot->dq_id, depth)] = cpu_to_le32(0); in remove_tree()
499 int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) in qtree_delete_dquot() argument
503 if (!dquot->dq_off) /* Even not allocated? */ in qtree_delete_dquot()
505 return remove_tree(info, dquot, &tmp, 0); in qtree_delete_dquot()
511 struct dquot *dquot, uint blk) in find_block_dqentry() argument
526 i < qtree_dqstr_in_blk(info) && !info->dqi_ops->is_id(ddquot, dquot); in find_block_dqentry()
530 "but not present.\n", dquot->dq_id); in find_block_dqentry()
544 struct dquot *dquot, uint blk, int depth) in find_tree_dqentry() argument
558 blk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]); in find_tree_dqentry()
562 ret = find_tree_dqentry(info, dquot, blk, depth+1); in find_tree_dqentry()
564 ret = find_block_dqentry(info, dquot, blk); in find_tree_dqentry()
572 struct dquot *dquot) in find_dqentry() argument
574 return find_tree_dqentry(info, dquot, QT_TREEOFF, 0); in find_dqentry()
577 int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) in qtree_read_dquot() argument
579 int type = dquot->dq_type; in qtree_read_dquot()
580 struct super_block *sb = dquot->dq_sb; in qtree_read_dquot()
587 if (!sb_dqopt(dquot->dq_sb)->files[type]) { in qtree_read_dquot()
593 if (!dquot->dq_off) { in qtree_read_dquot()
594 offset = find_dqentry(info, dquot); in qtree_read_dquot()
598 "structure for id %u.\n", dquot->dq_id); in qtree_read_dquot()
599 dquot->dq_off = 0; in qtree_read_dquot()
600 set_bit(DQ_FAKE_B, &dquot->dq_flags); in qtree_read_dquot()
601 memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk)); in qtree_read_dquot()
605 dquot->dq_off = offset; in qtree_read_dquot()
611 info->dqi_entry_size, dquot->dq_off); in qtree_read_dquot()
616 "structure for id %u.\n", dquot->dq_id); in qtree_read_dquot()
617 set_bit(DQ_FAKE_B, &dquot->dq_flags); in qtree_read_dquot()
618 memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk)); in qtree_read_dquot()
623 info->dqi_ops->disk2mem_dqblk(dquot, ddquot); in qtree_read_dquot()
624 if (!dquot->dq_dqb.dqb_bhardlimit && in qtree_read_dquot()
625 !dquot->dq_dqb.dqb_bsoftlimit && in qtree_read_dquot()
626 !dquot->dq_dqb.dqb_ihardlimit && in qtree_read_dquot()
627 !dquot->dq_dqb.dqb_isoftlimit) in qtree_read_dquot()
628 set_bit(DQ_FAKE_B, &dquot->dq_flags); in qtree_read_dquot()
639 int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) in qtree_release_dquot() argument
641 …if (test_bit(DQ_FAKE_B, &dquot->dq_flags) && !(dquot->dq_dqb.dqb_curinodes | dquot->dq_dqb.dqb_cur… in qtree_release_dquot()
642 return qtree_delete_dquot(info, dquot); in qtree_release_dquot()