• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/fs/quota/

Lines Matching refs:dquot

216 /* Find space for dquot */
218 struct dquot *dquot, int *err)
247 mark_info_dirty(dquot->dq_sb, dquot->dq_type);
253 quota_error(dquot->dq_sb, "Can't remove block (%u) "
268 quota_error(dquot->dq_sb, "Data block full but it shouldn't");
275 quota_error(dquot->dq_sb, "Can't write quota data block %u",
279 dquot->dq_off = (blk << info->dqi_blocksize_bits) +
290 static int do_insert_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot,
310 quota_error(dquot->dq_sb, "Can't read tree quota "
316 newblk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]);
322 quota_error(dquot->dq_sb, "Inserting already present "
325 dquot->dq_id, depth)]));
330 newblk = find_free_dqentry(info, dquot, &ret);
332 ret = do_insert_tree(info, dquot, &newblk, depth+1);
335 ref[get_index(info, dquot->dq_id, depth)] =
348 struct dquot *dquot)
351 return do_insert_tree(info, dquot, &tmp, 0);
358 int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
360 int type = dquot->dq_type;
361 struct super_block *sb = dquot->dq_sb;
369 if (!dquot->dq_off) {
370 ret = dq_insert_tree(info, dquot);
379 info->dqi_ops->mem2disk_dqblk(ddquot, dquot);
382 dquot->dq_off);
397 /* Free dquot entry in data block */
398 static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot,
407 if (dquot->dq_off >> info->dqi_blocksize_bits != blk) {
408 quota_error(dquot->dq_sb, "Quota structure has offset to "
410 (uint)(dquot->dq_off >> info->dqi_blocksize_bits));
415 quota_error(dquot->dq_sb, "Can't read quota data block %u",
426 quota_error(dquot->dq_sb, "Can't move quota data block "
432 (dquot->dq_off & ((1 << info->dqi_blocksize_bits) - 1)),
439 quota_error(dquot->dq_sb, "Can't insert quota "
446 quota_error(dquot->dq_sb, "Can't write quota "
452 dquot->dq_off = 0; /* Quota is now unattached */
458 /* Remove reference to dquot from tree */
459 static int remove_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot,
471 quota_error(dquot->dq_sb, "Can't read quota data "
475 newblk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]);
477 ret = free_dqentry(info, dquot, newblk);
480 ret = remove_tree(info, dquot, &newblk, depth+1);
484 ref[get_index(info, dquot->dq_id, depth)] = cpu_to_le32(0);
496 quota_error(dquot->dq_sb, "Can't write quota "
505 /* Delete dquot from tree */
506 int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
510 if (!dquot->dq_off) /* Even not allocated? */
512 return remove_tree(info, dquot, &tmp, 0);
518 struct dquot *dquot, uint blk)
529 quota_error(dquot->dq_sb, "Can't read quota tree "
535 if (info->dqi_ops->is_id(ddquot, dquot))
540 quota_error(dquot->dq_sb, "Quota for id %u referenced "
541 "but not present", dquot->dq_id);
555 struct dquot *dquot, uint blk, int depth)
565 quota_error(dquot->dq_sb, "Can't read quota tree block %u",
570 blk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]);
574 ret = find_tree_dqentry(info, dquot, blk, depth+1);
576 ret = find_block_dqentry(info, dquot, blk);
584 struct dquot *dquot)
586 return find_tree_dqentry(info, dquot, QT_TREEOFF, 0);
589 int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
591 int type = dquot->dq_type;
592 struct super_block *sb = dquot->dq_sb;
599 if (!sb_dqopt(dquot->dq_sb)->files[type]) {
604 /* Do we know offset of the dquot entry in the quota file? */
605 if (!dquot->dq_off) {
606 offset = find_dqentry(info, dquot);
610 "for id %u", dquot->dq_id);
611 dquot->dq_off = 0;
612 set_bit(DQ_FAKE_B, &dquot->dq_flags);
613 memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk));
617 dquot->dq_off = offset;
623 dquot->dq_off);
628 dquot->dq_id);
629 set_bit(DQ_FAKE_B, &dquot->dq_flags);
630 memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk));
635 info->dqi_ops->disk2mem_dqblk(dquot, ddquot);
636 if (!dquot->dq_dqb.dqb_bhardlimit &&
637 !dquot->dq_dqb.dqb_bsoftlimit &&
638 !dquot->dq_dqb.dqb_ihardlimit &&
639 !dquot->dq_dqb.dqb_isoftlimit)
640 set_bit(DQ_FAKE_B, &dquot->dq_flags);
649 /* Check whether dquot should not be deleted. We know we are
650 * the only one operating on dquot (thanks to dq_lock) */
651 int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot)
653 if (test_bit(DQ_FAKE_B, &dquot->dq_flags) &&
654 !(dquot->dq_dqb.dqb_curinodes | dquot->dq_dqb.dqb_curspace))
655 return qtree_delete_dquot(info, dquot);