• Home
  • Raw
  • Download

Lines Matching refs:dquot

266 static inline void insert_dquot_hash(struct dquot *dquot)  in insert_dquot_hash()  argument
269 head = dquot_hash + hashfn(dquot->dq_sb, dquot->dq_id); in insert_dquot_hash()
270 hlist_add_head(&dquot->dq_hash, head); in insert_dquot_hash()
273 static inline void remove_dquot_hash(struct dquot *dquot) in remove_dquot_hash() argument
275 hlist_del_init(&dquot->dq_hash); in remove_dquot_hash()
278 static struct dquot *find_dquot(unsigned int hashent, struct super_block *sb, in find_dquot()
282 struct dquot *dquot; in find_dquot() local
285 dquot = hlist_entry(node, struct dquot, dq_hash); in find_dquot()
286 if (dquot->dq_sb == sb && qid_eq(dquot->dq_id, qid)) in find_dquot()
287 return dquot; in find_dquot()
293 static inline void put_dquot_last(struct dquot *dquot) in put_dquot_last() argument
295 list_add_tail(&dquot->dq_free, &free_dquots); in put_dquot_last()
299 static inline void remove_free_dquot(struct dquot *dquot) in remove_free_dquot() argument
301 if (list_empty(&dquot->dq_free)) in remove_free_dquot()
303 list_del_init(&dquot->dq_free); in remove_free_dquot()
307 static inline void put_inuse(struct dquot *dquot) in put_inuse() argument
311 list_add_tail(&dquot->dq_inuse, &inuse_list); in put_inuse()
315 static inline void remove_inuse(struct dquot *dquot) in remove_inuse() argument
318 list_del(&dquot->dq_inuse); in remove_inuse()
324 static void wait_on_dquot(struct dquot *dquot) in wait_on_dquot() argument
326 mutex_lock(&dquot->dq_lock); in wait_on_dquot()
327 mutex_unlock(&dquot->dq_lock); in wait_on_dquot()
330 static inline int dquot_dirty(struct dquot *dquot) in dquot_dirty() argument
332 return test_bit(DQ_MOD_B, &dquot->dq_flags); in dquot_dirty()
335 static inline int mark_dquot_dirty(struct dquot *dquot) in mark_dquot_dirty() argument
337 return dquot->dq_sb->dq_op->mark_dirty(dquot); in mark_dquot_dirty()
341 int dquot_mark_dquot_dirty(struct dquot *dquot) in dquot_mark_dquot_dirty() argument
346 if (test_bit(DQ_MOD_B, &dquot->dq_flags)) in dquot_mark_dquot_dirty()
350 if (!test_and_set_bit(DQ_MOD_B, &dquot->dq_flags)) { in dquot_mark_dquot_dirty()
351 list_add(&dquot->dq_dirty, &sb_dqopt(dquot->dq_sb)-> in dquot_mark_dquot_dirty()
352 info[dquot->dq_id.type].dqi_dirty_list); in dquot_mark_dquot_dirty()
361 static inline int mark_all_dquot_dirty(struct dquot * const *dquot) in mark_all_dquot_dirty() argument
367 if (dquot[cnt]) in mark_all_dquot_dirty()
369 ret = mark_dquot_dirty(dquot[cnt]); in mark_all_dquot_dirty()
376 static inline void dqput_all(struct dquot **dquot) in dqput_all() argument
381 dqput(dquot[cnt]); in dqput_all()
385 static inline int clear_dquot_dirty(struct dquot *dquot) in clear_dquot_dirty() argument
387 if (!test_and_clear_bit(DQ_MOD_B, &dquot->dq_flags)) in clear_dquot_dirty()
389 list_del_init(&dquot->dq_dirty); in clear_dquot_dirty()
403 int dquot_acquire(struct dquot *dquot) in dquot_acquire() argument
406 struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); in dquot_acquire()
408 mutex_lock(&dquot->dq_lock); in dquot_acquire()
410 if (!test_bit(DQ_READ_B, &dquot->dq_flags)) in dquot_acquire()
411 ret = dqopt->ops[dquot->dq_id.type]->read_dqblk(dquot); in dquot_acquire()
416 set_bit(DQ_READ_B, &dquot->dq_flags); in dquot_acquire()
418 if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags) && !dquot->dq_off) { in dquot_acquire()
419 ret = dqopt->ops[dquot->dq_id.type]->commit_dqblk(dquot); in dquot_acquire()
421 if (info_dirty(&dqopt->info[dquot->dq_id.type])) { in dquot_acquire()
422 ret2 = dqopt->ops[dquot->dq_id.type]->write_file_info( in dquot_acquire()
423 dquot->dq_sb, dquot->dq_id.type); in dquot_acquire()
437 set_bit(DQ_ACTIVE_B, &dquot->dq_flags); in dquot_acquire()
440 mutex_unlock(&dquot->dq_lock); in dquot_acquire()
448 int dquot_commit(struct dquot *dquot) in dquot_commit() argument
451 struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); in dquot_commit()
455 if (!clear_dquot_dirty(dquot)) { in dquot_commit()
462 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) in dquot_commit()
463 ret = dqopt->ops[dquot->dq_id.type]->commit_dqblk(dquot); in dquot_commit()
475 int dquot_release(struct dquot *dquot) in dquot_release() argument
478 struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); in dquot_release()
480 mutex_lock(&dquot->dq_lock); in dquot_release()
482 if (atomic_read(&dquot->dq_count) > 1) in dquot_release()
485 if (dqopt->ops[dquot->dq_id.type]->release_dqblk) { in dquot_release()
486 ret = dqopt->ops[dquot->dq_id.type]->release_dqblk(dquot); in dquot_release()
488 if (info_dirty(&dqopt->info[dquot->dq_id.type])) { in dquot_release()
489 ret2 = dqopt->ops[dquot->dq_id.type]->write_file_info( in dquot_release()
490 dquot->dq_sb, dquot->dq_id.type); in dquot_release()
495 clear_bit(DQ_ACTIVE_B, &dquot->dq_flags); in dquot_release()
498 mutex_unlock(&dquot->dq_lock); in dquot_release()
503 void dquot_destroy(struct dquot *dquot) in dquot_destroy() argument
505 kmem_cache_free(dquot_cachep, dquot); in dquot_destroy()
509 static inline void do_destroy_dquot(struct dquot *dquot) in do_destroy_dquot() argument
511 dquot->dq_sb->dq_op->destroy_dquot(dquot); in do_destroy_dquot()
522 struct dquot *dquot, *tmp; in invalidate_dquots() local
526 list_for_each_entry_safe(dquot, tmp, &inuse_list, dq_inuse) { in invalidate_dquots()
527 if (dquot->dq_sb != sb) in invalidate_dquots()
529 if (dquot->dq_id.type != type) in invalidate_dquots()
532 if (atomic_read(&dquot->dq_count)) { in invalidate_dquots()
535 dqgrab(dquot); in invalidate_dquots()
536 prepare_to_wait(&dquot->dq_wait_unused, &wait, in invalidate_dquots()
546 if (atomic_read(&dquot->dq_count) > 1) in invalidate_dquots()
548 finish_wait(&dquot->dq_wait_unused, &wait); in invalidate_dquots()
549 dqput(dquot); in invalidate_dquots()
559 remove_dquot_hash(dquot); in invalidate_dquots()
560 remove_free_dquot(dquot); in invalidate_dquots()
561 remove_inuse(dquot); in invalidate_dquots()
562 do_destroy_dquot(dquot); in invalidate_dquots()
569 int (*fn)(struct dquot *dquot, unsigned long priv), in dquot_scan_active() argument
572 struct dquot *dquot, *old_dquot = NULL; in dquot_scan_active() local
577 list_for_each_entry(dquot, &inuse_list, dq_inuse) { in dquot_scan_active()
578 if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) in dquot_scan_active()
580 if (dquot->dq_sb != sb) in dquot_scan_active()
583 atomic_inc(&dquot->dq_count); in dquot_scan_active()
587 old_dquot = dquot; in dquot_scan_active()
593 wait_on_dquot(dquot); in dquot_scan_active()
594 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { in dquot_scan_active()
595 ret = fn(dquot, priv); in dquot_scan_active()
615 struct dquot *dquot; in dquot_writeback_dquots() local
629 dquot = list_first_entry(dirty, struct dquot, in dquot_writeback_dquots()
632 if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { in dquot_writeback_dquots()
633 clear_dquot_dirty(dquot); in dquot_writeback_dquots()
639 dqgrab(dquot); in dquot_writeback_dquots()
642 err = sb->dq_op->write_dquot(dquot); in dquot_writeback_dquots()
645 dqput(dquot); in dquot_writeback_dquots()
706 struct dquot *dquot; in dqcache_shrink_scan() local
712 dquot = list_entry(head, struct dquot, dq_free); in dqcache_shrink_scan()
713 remove_dquot_hash(dquot); in dqcache_shrink_scan()
714 remove_free_dquot(dquot); in dqcache_shrink_scan()
715 remove_inuse(dquot); in dqcache_shrink_scan()
716 do_destroy_dquot(dquot); in dqcache_shrink_scan()
741 void dqput(struct dquot *dquot) in dqput() argument
745 if (!dquot) in dqput()
748 if (!atomic_read(&dquot->dq_count)) { in dqput()
749 quota_error(dquot->dq_sb, "trying to free free dquot of %s %d", in dqput()
750 quotatypes[dquot->dq_id.type], in dqput()
751 from_kqid(&init_user_ns, dquot->dq_id)); in dqput()
758 if (atomic_read(&dquot->dq_count) > 1) { in dqput()
760 atomic_dec(&dquot->dq_count); in dqput()
762 if (!sb_has_quota_active(dquot->dq_sb, dquot->dq_id.type) && in dqput()
763 atomic_read(&dquot->dq_count) == 1) in dqput()
764 wake_up(&dquot->dq_wait_unused); in dqput()
769 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags) && dquot_dirty(dquot)) { in dqput()
772 ret = dquot->dq_sb->dq_op->write_dquot(dquot); in dqput()
774 quota_error(dquot->dq_sb, "Can't write quota structure" in dqput()
782 clear_dquot_dirty(dquot); in dqput()
788 clear_dquot_dirty(dquot); in dqput()
789 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { in dqput()
791 dquot->dq_sb->dq_op->release_dquot(dquot); in dqput()
794 atomic_dec(&dquot->dq_count); in dqput()
797 BUG_ON(!list_empty(&dquot->dq_free)); in dqput()
799 put_dquot_last(dquot); in dqput()
804 struct dquot *dquot_alloc(struct super_block *sb, int type) in dquot_alloc()
810 static struct dquot *get_empty_dquot(struct super_block *sb, int type) in get_empty_dquot()
812 struct dquot *dquot; in get_empty_dquot() local
814 dquot = sb->dq_op->alloc_dquot(sb, type); in get_empty_dquot()
815 if(!dquot) in get_empty_dquot()
818 mutex_init(&dquot->dq_lock); in get_empty_dquot()
819 INIT_LIST_HEAD(&dquot->dq_free); in get_empty_dquot()
820 INIT_LIST_HEAD(&dquot->dq_inuse); in get_empty_dquot()
821 INIT_HLIST_NODE(&dquot->dq_hash); in get_empty_dquot()
822 INIT_LIST_HEAD(&dquot->dq_dirty); in get_empty_dquot()
823 init_waitqueue_head(&dquot->dq_wait_unused); in get_empty_dquot()
824 dquot->dq_sb = sb; in get_empty_dquot()
825 dquot->dq_id = make_kqid_invalid(type); in get_empty_dquot()
826 atomic_set(&dquot->dq_count, 1); in get_empty_dquot()
828 return dquot; in get_empty_dquot()
839 struct dquot *dqget(struct super_block *sb, struct kqid qid) in dqget()
842 struct dquot *dquot, *empty = NULL; in dqget() local
855 dquot = ERR_PTR(-ESRCH); in dqget()
860 dquot = find_dquot(hashent, sb, qid); in dqget()
861 if (!dquot) { in dqget()
869 dquot = empty; in dqget()
871 dquot->dq_id = qid; in dqget()
873 put_inuse(dquot); in dqget()
875 insert_dquot_hash(dquot); in dqget()
879 if (!atomic_read(&dquot->dq_count)) in dqget()
880 remove_free_dquot(dquot); in dqget()
881 atomic_inc(&dquot->dq_count); in dqget()
888 wait_on_dquot(dquot); in dqget()
890 if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { in dqget()
893 err = sb->dq_op->acquire_dquot(dquot); in dqget()
895 dqput(dquot); in dqget()
896 dquot = ERR_PTR(err); in dqget()
906 BUG_ON(!dquot->dq_sb); /* Has somebody invalidated entry under us? */ in dqget()
912 return dquot; in dqget()
916 static inline struct dquot **i_dquot(struct inode *inode) in i_dquot()
923 struct dquot * const *dquots; in dqinit_needed()
996 struct dquot **dquots = i_dquot(inode); in remove_inode_dquot_ref()
997 struct dquot *dquot = dquots[type]; in remove_inode_dquot_ref() local
999 if (!dquot) in remove_inode_dquot_ref()
1003 if (list_empty(&dquot->dq_free)) { in remove_inode_dquot_ref()
1009 list_add(&dquot->dq_free, tofree_head); in remove_inode_dquot_ref()
1016 dqput(dquot); in remove_inode_dquot_ref()
1028 struct dquot *dquot; in put_dquot_list() local
1032 dquot = list_entry(act_head, struct dquot, dq_free); in put_dquot_list()
1035 list_del_init(&dquot->dq_free); in put_dquot_list()
1036 dqput(dquot); in put_dquot_list()
1084 static inline void dquot_incr_inodes(struct dquot *dquot, qsize_t number) in dquot_incr_inodes() argument
1086 dquot->dq_dqb.dqb_curinodes += number; in dquot_incr_inodes()
1089 static inline void dquot_incr_space(struct dquot *dquot, qsize_t number) in dquot_incr_space() argument
1091 dquot->dq_dqb.dqb_curspace += number; in dquot_incr_space()
1094 static inline void dquot_resv_space(struct dquot *dquot, qsize_t number) in dquot_resv_space() argument
1096 dquot->dq_dqb.dqb_rsvspace += number; in dquot_resv_space()
1102 static void dquot_claim_reserved_space(struct dquot *dquot, qsize_t number) in dquot_claim_reserved_space() argument
1104 if (dquot->dq_dqb.dqb_rsvspace < number) { in dquot_claim_reserved_space()
1106 number = dquot->dq_dqb.dqb_rsvspace; in dquot_claim_reserved_space()
1108 dquot->dq_dqb.dqb_curspace += number; in dquot_claim_reserved_space()
1109 dquot->dq_dqb.dqb_rsvspace -= number; in dquot_claim_reserved_space()
1112 static void dquot_reclaim_reserved_space(struct dquot *dquot, qsize_t number) in dquot_reclaim_reserved_space() argument
1114 if (WARN_ON_ONCE(dquot->dq_dqb.dqb_curspace < number)) in dquot_reclaim_reserved_space()
1115 number = dquot->dq_dqb.dqb_curspace; in dquot_reclaim_reserved_space()
1116 dquot->dq_dqb.dqb_rsvspace += number; in dquot_reclaim_reserved_space()
1117 dquot->dq_dqb.dqb_curspace -= number; in dquot_reclaim_reserved_space()
1121 void dquot_free_reserved_space(struct dquot *dquot, qsize_t number) in dquot_free_reserved_space() argument
1123 if (dquot->dq_dqb.dqb_rsvspace >= number) in dquot_free_reserved_space()
1124 dquot->dq_dqb.dqb_rsvspace -= number; in dquot_free_reserved_space()
1127 dquot->dq_dqb.dqb_rsvspace = 0; in dquot_free_reserved_space()
1131 static void dquot_decr_inodes(struct dquot *dquot, qsize_t number) in dquot_decr_inodes() argument
1133 if (sb_dqopt(dquot->dq_sb)->flags & DQUOT_NEGATIVE_USAGE || in dquot_decr_inodes()
1134 dquot->dq_dqb.dqb_curinodes >= number) in dquot_decr_inodes()
1135 dquot->dq_dqb.dqb_curinodes -= number; in dquot_decr_inodes()
1137 dquot->dq_dqb.dqb_curinodes = 0; in dquot_decr_inodes()
1138 if (dquot->dq_dqb.dqb_curinodes <= dquot->dq_dqb.dqb_isoftlimit) in dquot_decr_inodes()
1139 dquot->dq_dqb.dqb_itime = (time64_t) 0; in dquot_decr_inodes()
1140 clear_bit(DQ_INODES_B, &dquot->dq_flags); in dquot_decr_inodes()
1143 static void dquot_decr_space(struct dquot *dquot, qsize_t number) in dquot_decr_space() argument
1145 if (sb_dqopt(dquot->dq_sb)->flags & DQUOT_NEGATIVE_USAGE || in dquot_decr_space()
1146 dquot->dq_dqb.dqb_curspace >= number) in dquot_decr_space()
1147 dquot->dq_dqb.dqb_curspace -= number; in dquot_decr_space()
1149 dquot->dq_dqb.dqb_curspace = 0; in dquot_decr_space()
1150 if (dquot->dq_dqb.dqb_curspace <= dquot->dq_dqb.dqb_bsoftlimit) in dquot_decr_space()
1151 dquot->dq_dqb.dqb_btime = (time64_t) 0; in dquot_decr_space()
1152 clear_bit(DQ_BLKS_B, &dquot->dq_flags); in dquot_decr_space()
1161 static int warning_issued(struct dquot *dquot, const int warntype) in warning_issued() argument
1170 return test_and_set_bit(flag, &dquot->dq_flags); in warning_issued()
1239 static void prepare_warning(struct dquot_warn *warn, struct dquot *dquot, in prepare_warning() argument
1242 if (warning_issued(dquot, warntype)) in prepare_warning()
1245 warn->w_sb = dquot->dq_sb; in prepare_warning()
1246 warn->w_dq_id = dquot->dq_id; in prepare_warning()
1269 static int ignore_hardlimit(struct dquot *dquot) in ignore_hardlimit() argument
1271 struct mem_dqinfo *info = &sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type]; in ignore_hardlimit()
1279 static int check_idq(struct dquot *dquot, qsize_t inodes, in check_idq() argument
1282 qsize_t newinodes = dquot->dq_dqb.dqb_curinodes + inodes; in check_idq()
1284 if (!sb_has_quota_limits_enabled(dquot->dq_sb, dquot->dq_id.type) || in check_idq()
1285 test_bit(DQ_FAKE_B, &dquot->dq_flags)) in check_idq()
1288 if (dquot->dq_dqb.dqb_ihardlimit && in check_idq()
1289 newinodes > dquot->dq_dqb.dqb_ihardlimit && in check_idq()
1290 !ignore_hardlimit(dquot)) { in check_idq()
1291 prepare_warning(warn, dquot, QUOTA_NL_IHARDWARN); in check_idq()
1295 if (dquot->dq_dqb.dqb_isoftlimit && in check_idq()
1296 newinodes > dquot->dq_dqb.dqb_isoftlimit && in check_idq()
1297 dquot->dq_dqb.dqb_itime && in check_idq()
1298 ktime_get_real_seconds() >= dquot->dq_dqb.dqb_itime && in check_idq()
1299 !ignore_hardlimit(dquot)) { in check_idq()
1300 prepare_warning(warn, dquot, QUOTA_NL_ISOFTLONGWARN); in check_idq()
1304 if (dquot->dq_dqb.dqb_isoftlimit && in check_idq()
1305 newinodes > dquot->dq_dqb.dqb_isoftlimit && in check_idq()
1306 dquot->dq_dqb.dqb_itime == 0) { in check_idq()
1307 prepare_warning(warn, dquot, QUOTA_NL_ISOFTWARN); in check_idq()
1308 dquot->dq_dqb.dqb_itime = ktime_get_real_seconds() + in check_idq()
1309 sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type].dqi_igrace; in check_idq()
1316 static int check_bdq(struct dquot *dquot, qsize_t space, int prealloc, in check_bdq() argument
1320 struct super_block *sb = dquot->dq_sb; in check_bdq()
1322 if (!sb_has_quota_limits_enabled(sb, dquot->dq_id.type) || in check_bdq()
1323 test_bit(DQ_FAKE_B, &dquot->dq_flags)) in check_bdq()
1326 tspace = dquot->dq_dqb.dqb_curspace + dquot->dq_dqb.dqb_rsvspace in check_bdq()
1329 if (dquot->dq_dqb.dqb_bhardlimit && in check_bdq()
1330 tspace > dquot->dq_dqb.dqb_bhardlimit && in check_bdq()
1331 !ignore_hardlimit(dquot)) { in check_bdq()
1333 prepare_warning(warn, dquot, QUOTA_NL_BHARDWARN); in check_bdq()
1337 if (dquot->dq_dqb.dqb_bsoftlimit && in check_bdq()
1338 tspace > dquot->dq_dqb.dqb_bsoftlimit && in check_bdq()
1339 dquot->dq_dqb.dqb_btime && in check_bdq()
1340 ktime_get_real_seconds() >= dquot->dq_dqb.dqb_btime && in check_bdq()
1341 !ignore_hardlimit(dquot)) { in check_bdq()
1343 prepare_warning(warn, dquot, QUOTA_NL_BSOFTLONGWARN); in check_bdq()
1347 if (dquot->dq_dqb.dqb_bsoftlimit && in check_bdq()
1348 tspace > dquot->dq_dqb.dqb_bsoftlimit && in check_bdq()
1349 dquot->dq_dqb.dqb_btime == 0) { in check_bdq()
1351 prepare_warning(warn, dquot, QUOTA_NL_BSOFTWARN); in check_bdq()
1352 dquot->dq_dqb.dqb_btime = ktime_get_real_seconds() + in check_bdq()
1353 sb_dqopt(sb)->info[dquot->dq_id.type].dqi_bgrace; in check_bdq()
1366 static int info_idq_free(struct dquot *dquot, qsize_t inodes) in info_idq_free() argument
1370 if (test_bit(DQ_FAKE_B, &dquot->dq_flags) || in info_idq_free()
1371 dquot->dq_dqb.dqb_curinodes <= dquot->dq_dqb.dqb_isoftlimit || in info_idq_free()
1372 !sb_has_quota_limits_enabled(dquot->dq_sb, dquot->dq_id.type)) in info_idq_free()
1375 newinodes = dquot->dq_dqb.dqb_curinodes - inodes; in info_idq_free()
1376 if (newinodes <= dquot->dq_dqb.dqb_isoftlimit) in info_idq_free()
1378 if (dquot->dq_dqb.dqb_curinodes >= dquot->dq_dqb.dqb_ihardlimit && in info_idq_free()
1379 newinodes < dquot->dq_dqb.dqb_ihardlimit) in info_idq_free()
1384 static int info_bdq_free(struct dquot *dquot, qsize_t space) in info_bdq_free() argument
1386 if (test_bit(DQ_FAKE_B, &dquot->dq_flags) || in info_bdq_free()
1387 dquot->dq_dqb.dqb_curspace <= dquot->dq_dqb.dqb_bsoftlimit) in info_bdq_free()
1390 if (dquot->dq_dqb.dqb_curspace - space <= dquot->dq_dqb.dqb_bsoftlimit) in info_bdq_free()
1392 if (dquot->dq_dqb.dqb_curspace >= dquot->dq_dqb.dqb_bhardlimit && in info_bdq_free()
1393 dquot->dq_dqb.dqb_curspace - space < dquot->dq_dqb.dqb_bhardlimit) in info_bdq_free()
1416 struct dquot **dquots, *got[MAXQUOTAS] = {}; in __dquot_initialize()
1431 struct dquot *dquot; in __dquot_initialize() local
1462 dquot = dqget(sb, qid); in __dquot_initialize()
1463 if (IS_ERR(dquot)) { in __dquot_initialize()
1465 if (PTR_ERR(dquot) != -ESRCH) { in __dquot_initialize()
1466 ret = PTR_ERR(dquot); in __dquot_initialize()
1469 dquot = NULL; in __dquot_initialize()
1471 got[cnt] = dquot; in __dquot_initialize()
1528 struct dquot **dquots = i_dquot(inode); in __dquot_drop()
1529 struct dquot *put[MAXQUOTAS]; in __dquot_drop()
1542 struct dquot * const *dquots; in dquot_drop()
1659 struct dquot **dquots; in __dquot_alloc_space()
1711 struct dquot * const *dquots; in dquot_alloc_inode()
1750 struct dquot **dquots; in dquot_claim_space_nodirty()
1780 struct dquot **dquots; in dquot_reclaim_space_nodirty()
1812 struct dquot **dquots; in __dquot_free_space()
1856 struct dquot * const *dquots; in dquot_free_inode()
1895 int __dquot_transfer(struct inode *inode, struct dquot **transfer_to) in __dquot_transfer()
1899 struct dquot *transfer_from[MAXQUOTAS] = {}; in __dquot_transfer()
1996 struct dquot *transfer_to[MAXQUOTAS] = {}; in dquot_transfer()
1997 struct dquot *dquot; in dquot_transfer() local
2005 dquot = dqget(sb, make_kqid_uid(iattr->ia_uid)); in dquot_transfer()
2006 if (IS_ERR(dquot)) { in dquot_transfer()
2007 if (PTR_ERR(dquot) != -ESRCH) { in dquot_transfer()
2008 ret = PTR_ERR(dquot); in dquot_transfer()
2011 dquot = NULL; in dquot_transfer()
2013 transfer_to[USRQUOTA] = dquot; in dquot_transfer()
2016 dquot = dqget(sb, make_kqid_gid(iattr->ia_gid)); in dquot_transfer()
2017 if (IS_ERR(dquot)) { in dquot_transfer()
2018 if (PTR_ERR(dquot) != -ESRCH) { in dquot_transfer()
2019 ret = PTR_ERR(dquot); in dquot_transfer()
2022 dquot = NULL; in dquot_transfer()
2024 transfer_to[GRPQUOTA] = dquot; in dquot_transfer()
2578 static void do_get_dqblk(struct dquot *dquot, struct qc_dqblk *di) in do_get_dqblk() argument
2580 struct mem_dqblk *dm = &dquot->dq_dqb; in do_get_dqblk()
2598 struct dquot *dquot; in dquot_get_dqblk() local
2600 dquot = dqget(sb, qid); in dquot_get_dqblk()
2601 if (IS_ERR(dquot)) in dquot_get_dqblk()
2602 return PTR_ERR(dquot); in dquot_get_dqblk()
2603 do_get_dqblk(dquot, di); in dquot_get_dqblk()
2604 dqput(dquot); in dquot_get_dqblk()
2613 struct dquot *dquot; in dquot_get_next_dqblk() local
2621 dquot = dqget(sb, *qid); in dquot_get_next_dqblk()
2622 if (IS_ERR(dquot)) in dquot_get_next_dqblk()
2623 return PTR_ERR(dquot); in dquot_get_next_dqblk()
2624 do_get_dqblk(dquot, di); in dquot_get_next_dqblk()
2625 dqput(dquot); in dquot_get_next_dqblk()
2637 static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di) in do_set_dqblk() argument
2639 struct mem_dqblk *dm = &dquot->dq_dqb; in do_set_dqblk()
2641 struct mem_dqinfo *dqi = &sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type]; in do_set_dqblk()
2660 set_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags); in do_set_dqblk()
2669 set_bit(DQ_LASTSET_B + QIF_BLIMITS_B, &dquot->dq_flags); in do_set_dqblk()
2675 set_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags); in do_set_dqblk()
2684 set_bit(DQ_LASTSET_B + QIF_ILIMITS_B, &dquot->dq_flags); in do_set_dqblk()
2690 set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags); in do_set_dqblk()
2696 set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags); in do_set_dqblk()
2703 clear_bit(DQ_BLKS_B, &dquot->dq_flags); in do_set_dqblk()
2712 clear_bit(DQ_INODES_B, &dquot->dq_flags); in do_set_dqblk()
2719 clear_bit(DQ_FAKE_B, &dquot->dq_flags); in do_set_dqblk()
2721 set_bit(DQ_FAKE_B, &dquot->dq_flags); in do_set_dqblk()
2723 mark_dquot_dirty(dquot); in do_set_dqblk()
2731 struct dquot *dquot; in dquot_set_dqblk() local
2734 dquot = dqget(sb, qid); in dquot_set_dqblk()
2735 if (IS_ERR(dquot)) { in dquot_set_dqblk()
2736 rc = PTR_ERR(dquot); in dquot_set_dqblk()
2739 rc = do_set_dqblk(dquot, di); in dquot_set_dqblk()
2740 dqput(dquot); in dquot_set_dqblk()
2956 sizeof(struct dquot), sizeof(unsigned long) * 4, in dquot_init()