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()
414 set_bit(DQ_READ_B, &dquot->dq_flags); in dquot_acquire()
416 if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags) && !dquot->dq_off) { in dquot_acquire()
417 ret = dqopt->ops[dquot->dq_id.type]->commit_dqblk(dquot); in dquot_acquire()
419 if (info_dirty(&dqopt->info[dquot->dq_id.type])) { in dquot_acquire()
420 ret2 = dqopt->ops[dquot->dq_id.type]->write_file_info( in dquot_acquire()
421 dquot->dq_sb, dquot->dq_id.type); in dquot_acquire()
430 set_bit(DQ_ACTIVE_B, &dquot->dq_flags); in dquot_acquire()
433 mutex_unlock(&dquot->dq_lock); in dquot_acquire()
441 int dquot_commit(struct dquot *dquot) in dquot_commit() argument
444 struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); in dquot_commit()
448 if (!clear_dquot_dirty(dquot)) { in dquot_commit()
455 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) in dquot_commit()
456 ret = dqopt->ops[dquot->dq_id.type]->commit_dqblk(dquot); in dquot_commit()
468 int dquot_release(struct dquot *dquot) in dquot_release() argument
471 struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); in dquot_release()
473 mutex_lock(&dquot->dq_lock); in dquot_release()
475 if (atomic_read(&dquot->dq_count) > 1) in dquot_release()
478 if (dqopt->ops[dquot->dq_id.type]->release_dqblk) { in dquot_release()
479 ret = dqopt->ops[dquot->dq_id.type]->release_dqblk(dquot); in dquot_release()
481 if (info_dirty(&dqopt->info[dquot->dq_id.type])) { in dquot_release()
482 ret2 = dqopt->ops[dquot->dq_id.type]->write_file_info( in dquot_release()
483 dquot->dq_sb, dquot->dq_id.type); in dquot_release()
488 clear_bit(DQ_ACTIVE_B, &dquot->dq_flags); in dquot_release()
491 mutex_unlock(&dquot->dq_lock); in dquot_release()
496 void dquot_destroy(struct dquot *dquot) in dquot_destroy() argument
498 kmem_cache_free(dquot_cachep, dquot); in dquot_destroy()
502 static inline void do_destroy_dquot(struct dquot *dquot) in do_destroy_dquot() argument
504 dquot->dq_sb->dq_op->destroy_dquot(dquot); in do_destroy_dquot()
515 struct dquot *dquot, *tmp; in invalidate_dquots() local
519 list_for_each_entry_safe(dquot, tmp, &inuse_list, dq_inuse) { in invalidate_dquots()
520 if (dquot->dq_sb != sb) in invalidate_dquots()
522 if (dquot->dq_id.type != type) in invalidate_dquots()
525 if (atomic_read(&dquot->dq_count)) { in invalidate_dquots()
528 dqgrab(dquot); in invalidate_dquots()
529 prepare_to_wait(&dquot->dq_wait_unused, &wait, in invalidate_dquots()
539 if (atomic_read(&dquot->dq_count) > 1) in invalidate_dquots()
541 finish_wait(&dquot->dq_wait_unused, &wait); in invalidate_dquots()
542 dqput(dquot); in invalidate_dquots()
552 remove_dquot_hash(dquot); in invalidate_dquots()
553 remove_free_dquot(dquot); in invalidate_dquots()
554 remove_inuse(dquot); in invalidate_dquots()
555 do_destroy_dquot(dquot); in invalidate_dquots()
562 int (*fn)(struct dquot *dquot, unsigned long priv), in dquot_scan_active() argument
565 struct dquot *dquot, *old_dquot = NULL; in dquot_scan_active() local
570 list_for_each_entry(dquot, &inuse_list, dq_inuse) { in dquot_scan_active()
571 if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) in dquot_scan_active()
573 if (dquot->dq_sb != sb) in dquot_scan_active()
576 atomic_inc(&dquot->dq_count); in dquot_scan_active()
580 old_dquot = dquot; in dquot_scan_active()
586 wait_on_dquot(dquot); in dquot_scan_active()
587 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { in dquot_scan_active()
588 ret = fn(dquot, priv); in dquot_scan_active()
608 struct dquot *dquot; in dquot_writeback_dquots() local
622 dquot = list_first_entry(dirty, struct dquot, in dquot_writeback_dquots()
625 if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { in dquot_writeback_dquots()
626 clear_dquot_dirty(dquot); in dquot_writeback_dquots()
632 dqgrab(dquot); in dquot_writeback_dquots()
635 err = sb->dq_op->write_dquot(dquot); in dquot_writeback_dquots()
638 dqput(dquot); in dquot_writeback_dquots()
699 struct dquot *dquot; in dqcache_shrink_scan() local
705 dquot = list_entry(head, struct dquot, dq_free); in dqcache_shrink_scan()
706 remove_dquot_hash(dquot); in dqcache_shrink_scan()
707 remove_free_dquot(dquot); in dqcache_shrink_scan()
708 remove_inuse(dquot); in dqcache_shrink_scan()
709 do_destroy_dquot(dquot); in dqcache_shrink_scan()
734 void dqput(struct dquot *dquot) in dqput() argument
738 if (!dquot) in dqput()
741 if (!atomic_read(&dquot->dq_count)) { in dqput()
742 quota_error(dquot->dq_sb, "trying to free free dquot of %s %d", in dqput()
743 quotatypes[dquot->dq_id.type], in dqput()
744 from_kqid(&init_user_ns, dquot->dq_id)); in dqput()
751 if (atomic_read(&dquot->dq_count) > 1) { in dqput()
753 atomic_dec(&dquot->dq_count); in dqput()
755 if (!sb_has_quota_active(dquot->dq_sb, dquot->dq_id.type) && in dqput()
756 atomic_read(&dquot->dq_count) == 1) in dqput()
757 wake_up(&dquot->dq_wait_unused); in dqput()
762 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags) && dquot_dirty(dquot)) { in dqput()
765 ret = dquot->dq_sb->dq_op->write_dquot(dquot); in dqput()
767 quota_error(dquot->dq_sb, "Can't write quota structure" in dqput()
775 clear_dquot_dirty(dquot); in dqput()
781 clear_dquot_dirty(dquot); in dqput()
782 if (test_bit(DQ_ACTIVE_B, &dquot->dq_flags)) { in dqput()
784 dquot->dq_sb->dq_op->release_dquot(dquot); in dqput()
787 atomic_dec(&dquot->dq_count); in dqput()
790 BUG_ON(!list_empty(&dquot->dq_free)); in dqput()
792 put_dquot_last(dquot); in dqput()
797 struct dquot *dquot_alloc(struct super_block *sb, int type) in dquot_alloc()
803 static struct dquot *get_empty_dquot(struct super_block *sb, int type) in get_empty_dquot()
805 struct dquot *dquot; in get_empty_dquot() local
807 dquot = sb->dq_op->alloc_dquot(sb, type); in get_empty_dquot()
808 if(!dquot) in get_empty_dquot()
811 mutex_init(&dquot->dq_lock); in get_empty_dquot()
812 INIT_LIST_HEAD(&dquot->dq_free); in get_empty_dquot()
813 INIT_LIST_HEAD(&dquot->dq_inuse); in get_empty_dquot()
814 INIT_HLIST_NODE(&dquot->dq_hash); in get_empty_dquot()
815 INIT_LIST_HEAD(&dquot->dq_dirty); in get_empty_dquot()
816 init_waitqueue_head(&dquot->dq_wait_unused); in get_empty_dquot()
817 dquot->dq_sb = sb; in get_empty_dquot()
818 dquot->dq_id = make_kqid_invalid(type); in get_empty_dquot()
819 atomic_set(&dquot->dq_count, 1); in get_empty_dquot()
821 return dquot; in get_empty_dquot()
832 struct dquot *dqget(struct super_block *sb, struct kqid qid) in dqget()
835 struct dquot *dquot = NULL, *empty = NULL; in dqget() local
849 dquot = find_dquot(hashent, sb, qid); in dqget()
850 if (!dquot) { in dqget()
858 dquot = empty; in dqget()
860 dquot->dq_id = qid; in dqget()
862 put_inuse(dquot); in dqget()
864 insert_dquot_hash(dquot); in dqget()
868 if (!atomic_read(&dquot->dq_count)) in dqget()
869 remove_free_dquot(dquot); in dqget()
870 atomic_inc(&dquot->dq_count); in dqget()
877 wait_on_dquot(dquot); in dqget()
879 if (!test_bit(DQ_ACTIVE_B, &dquot->dq_flags) && in dqget()
880 sb->dq_op->acquire_dquot(dquot) < 0) { in dqget()
881 dqput(dquot); in dqget()
882 dquot = NULL; in dqget()
886 BUG_ON(!dquot->dq_sb); /* Has somebody invalidated entry under us? */ in dqget()
892 return dquot; in dqget()
896 static inline struct dquot **i_dquot(struct inode *inode) in i_dquot()
903 struct dquot * const *dquots; in dqinit_needed()
976 struct dquot **dquots = i_dquot(inode); in remove_inode_dquot_ref()
977 struct dquot *dquot = dquots[type]; in remove_inode_dquot_ref() local
979 if (!dquot) in remove_inode_dquot_ref()
983 if (list_empty(&dquot->dq_free)) { in remove_inode_dquot_ref()
989 list_add(&dquot->dq_free, tofree_head); in remove_inode_dquot_ref()
996 dqput(dquot); in remove_inode_dquot_ref()
1008 struct dquot *dquot; in put_dquot_list() local
1012 dquot = list_entry(act_head, struct dquot, dq_free); in put_dquot_list()
1015 list_del_init(&dquot->dq_free); in put_dquot_list()
1016 dqput(dquot); in put_dquot_list()
1064 static inline void dquot_incr_inodes(struct dquot *dquot, qsize_t number) in dquot_incr_inodes() argument
1066 dquot->dq_dqb.dqb_curinodes += number; in dquot_incr_inodes()
1069 static inline void dquot_incr_space(struct dquot *dquot, qsize_t number) in dquot_incr_space() argument
1071 dquot->dq_dqb.dqb_curspace += number; in dquot_incr_space()
1074 static inline void dquot_resv_space(struct dquot *dquot, qsize_t number) in dquot_resv_space() argument
1076 dquot->dq_dqb.dqb_rsvspace += number; in dquot_resv_space()
1082 static void dquot_claim_reserved_space(struct dquot *dquot, qsize_t number) in dquot_claim_reserved_space() argument
1084 if (dquot->dq_dqb.dqb_rsvspace < number) { in dquot_claim_reserved_space()
1086 number = dquot->dq_dqb.dqb_rsvspace; in dquot_claim_reserved_space()
1088 dquot->dq_dqb.dqb_curspace += number; in dquot_claim_reserved_space()
1089 dquot->dq_dqb.dqb_rsvspace -= number; in dquot_claim_reserved_space()
1092 static void dquot_reclaim_reserved_space(struct dquot *dquot, qsize_t number) in dquot_reclaim_reserved_space() argument
1094 if (WARN_ON_ONCE(dquot->dq_dqb.dqb_curspace < number)) in dquot_reclaim_reserved_space()
1095 number = dquot->dq_dqb.dqb_curspace; in dquot_reclaim_reserved_space()
1096 dquot->dq_dqb.dqb_rsvspace += number; in dquot_reclaim_reserved_space()
1097 dquot->dq_dqb.dqb_curspace -= number; in dquot_reclaim_reserved_space()
1101 void dquot_free_reserved_space(struct dquot *dquot, qsize_t number) in dquot_free_reserved_space() argument
1103 if (dquot->dq_dqb.dqb_rsvspace >= number) in dquot_free_reserved_space()
1104 dquot->dq_dqb.dqb_rsvspace -= number; in dquot_free_reserved_space()
1107 dquot->dq_dqb.dqb_rsvspace = 0; in dquot_free_reserved_space()
1111 static void dquot_decr_inodes(struct dquot *dquot, qsize_t number) in dquot_decr_inodes() argument
1113 if (sb_dqopt(dquot->dq_sb)->flags & DQUOT_NEGATIVE_USAGE || in dquot_decr_inodes()
1114 dquot->dq_dqb.dqb_curinodes >= number) in dquot_decr_inodes()
1115 dquot->dq_dqb.dqb_curinodes -= number; in dquot_decr_inodes()
1117 dquot->dq_dqb.dqb_curinodes = 0; in dquot_decr_inodes()
1118 if (dquot->dq_dqb.dqb_curinodes <= dquot->dq_dqb.dqb_isoftlimit) in dquot_decr_inodes()
1119 dquot->dq_dqb.dqb_itime = (time_t) 0; in dquot_decr_inodes()
1120 clear_bit(DQ_INODES_B, &dquot->dq_flags); in dquot_decr_inodes()
1123 static void dquot_decr_space(struct dquot *dquot, qsize_t number) in dquot_decr_space() argument
1125 if (sb_dqopt(dquot->dq_sb)->flags & DQUOT_NEGATIVE_USAGE || in dquot_decr_space()
1126 dquot->dq_dqb.dqb_curspace >= number) in dquot_decr_space()
1127 dquot->dq_dqb.dqb_curspace -= number; in dquot_decr_space()
1129 dquot->dq_dqb.dqb_curspace = 0; in dquot_decr_space()
1130 if (dquot->dq_dqb.dqb_curspace <= dquot->dq_dqb.dqb_bsoftlimit) in dquot_decr_space()
1131 dquot->dq_dqb.dqb_btime = (time_t) 0; in dquot_decr_space()
1132 clear_bit(DQ_BLKS_B, &dquot->dq_flags); in dquot_decr_space()
1141 static int warning_issued(struct dquot *dquot, const int warntype) in warning_issued() argument
1150 return test_and_set_bit(flag, &dquot->dq_flags); in warning_issued()
1219 static void prepare_warning(struct dquot_warn *warn, struct dquot *dquot, in prepare_warning() argument
1222 if (warning_issued(dquot, warntype)) in prepare_warning()
1225 warn->w_sb = dquot->dq_sb; in prepare_warning()
1226 warn->w_dq_id = dquot->dq_id; in prepare_warning()
1249 static int ignore_hardlimit(struct dquot *dquot) in ignore_hardlimit() argument
1251 struct mem_dqinfo *info = &sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type]; in ignore_hardlimit()
1259 static int check_idq(struct dquot *dquot, qsize_t inodes, in check_idq() argument
1262 qsize_t newinodes = dquot->dq_dqb.dqb_curinodes + inodes; in check_idq()
1264 if (!sb_has_quota_limits_enabled(dquot->dq_sb, dquot->dq_id.type) || in check_idq()
1265 test_bit(DQ_FAKE_B, &dquot->dq_flags)) in check_idq()
1268 if (dquot->dq_dqb.dqb_ihardlimit && in check_idq()
1269 newinodes > dquot->dq_dqb.dqb_ihardlimit && in check_idq()
1270 !ignore_hardlimit(dquot)) { in check_idq()
1271 prepare_warning(warn, dquot, QUOTA_NL_IHARDWARN); in check_idq()
1275 if (dquot->dq_dqb.dqb_isoftlimit && in check_idq()
1276 newinodes > dquot->dq_dqb.dqb_isoftlimit && in check_idq()
1277 dquot->dq_dqb.dqb_itime && in check_idq()
1278 get_seconds() >= dquot->dq_dqb.dqb_itime && in check_idq()
1279 !ignore_hardlimit(dquot)) { in check_idq()
1280 prepare_warning(warn, dquot, QUOTA_NL_ISOFTLONGWARN); in check_idq()
1284 if (dquot->dq_dqb.dqb_isoftlimit && in check_idq()
1285 newinodes > dquot->dq_dqb.dqb_isoftlimit && in check_idq()
1286 dquot->dq_dqb.dqb_itime == 0) { in check_idq()
1287 prepare_warning(warn, dquot, QUOTA_NL_ISOFTWARN); in check_idq()
1288 dquot->dq_dqb.dqb_itime = get_seconds() + in check_idq()
1289 sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type].dqi_igrace; in check_idq()
1296 static int check_bdq(struct dquot *dquot, qsize_t space, int prealloc, in check_bdq() argument
1300 struct super_block *sb = dquot->dq_sb; in check_bdq()
1302 if (!sb_has_quota_limits_enabled(sb, dquot->dq_id.type) || in check_bdq()
1303 test_bit(DQ_FAKE_B, &dquot->dq_flags)) in check_bdq()
1306 tspace = dquot->dq_dqb.dqb_curspace + dquot->dq_dqb.dqb_rsvspace in check_bdq()
1309 if (dquot->dq_dqb.dqb_bhardlimit && in check_bdq()
1310 tspace > dquot->dq_dqb.dqb_bhardlimit && in check_bdq()
1311 !ignore_hardlimit(dquot)) { in check_bdq()
1313 prepare_warning(warn, dquot, QUOTA_NL_BHARDWARN); in check_bdq()
1317 if (dquot->dq_dqb.dqb_bsoftlimit && in check_bdq()
1318 tspace > dquot->dq_dqb.dqb_bsoftlimit && in check_bdq()
1319 dquot->dq_dqb.dqb_btime && in check_bdq()
1320 get_seconds() >= dquot->dq_dqb.dqb_btime && in check_bdq()
1321 !ignore_hardlimit(dquot)) { in check_bdq()
1323 prepare_warning(warn, dquot, QUOTA_NL_BSOFTLONGWARN); in check_bdq()
1327 if (dquot->dq_dqb.dqb_bsoftlimit && in check_bdq()
1328 tspace > dquot->dq_dqb.dqb_bsoftlimit && in check_bdq()
1329 dquot->dq_dqb.dqb_btime == 0) { in check_bdq()
1331 prepare_warning(warn, dquot, QUOTA_NL_BSOFTWARN); in check_bdq()
1332 dquot->dq_dqb.dqb_btime = get_seconds() + in check_bdq()
1333 sb_dqopt(sb)->info[dquot->dq_id.type].dqi_bgrace; in check_bdq()
1346 static int info_idq_free(struct dquot *dquot, qsize_t inodes) in info_idq_free() argument
1350 if (test_bit(DQ_FAKE_B, &dquot->dq_flags) || in info_idq_free()
1351 dquot->dq_dqb.dqb_curinodes <= dquot->dq_dqb.dqb_isoftlimit || in info_idq_free()
1352 !sb_has_quota_limits_enabled(dquot->dq_sb, dquot->dq_id.type)) in info_idq_free()
1355 newinodes = dquot->dq_dqb.dqb_curinodes - inodes; in info_idq_free()
1356 if (newinodes <= dquot->dq_dqb.dqb_isoftlimit) in info_idq_free()
1358 if (dquot->dq_dqb.dqb_curinodes >= dquot->dq_dqb.dqb_ihardlimit && in info_idq_free()
1359 newinodes < dquot->dq_dqb.dqb_ihardlimit) in info_idq_free()
1364 static int info_bdq_free(struct dquot *dquot, qsize_t space) in info_bdq_free() argument
1366 if (test_bit(DQ_FAKE_B, &dquot->dq_flags) || in info_bdq_free()
1367 dquot->dq_dqb.dqb_curspace <= dquot->dq_dqb.dqb_bsoftlimit) in info_bdq_free()
1370 if (dquot->dq_dqb.dqb_curspace - space <= dquot->dq_dqb.dqb_bsoftlimit) in info_bdq_free()
1372 if (dquot->dq_dqb.dqb_curspace >= dquot->dq_dqb.dqb_bhardlimit && in info_bdq_free()
1373 dquot->dq_dqb.dqb_curspace - space < dquot->dq_dqb.dqb_bhardlimit) in info_bdq_free()
1396 struct dquot **dquots, *got[MAXQUOTAS] = {}; in __dquot_initialize()
1494 struct dquot **dquots = i_dquot(inode); in __dquot_drop()
1495 struct dquot *put[MAXQUOTAS]; in __dquot_drop()
1508 struct dquot * const *dquots; in dquot_drop()
1625 struct dquot **dquots; in __dquot_alloc_space()
1677 struct dquot * const *dquots; in dquot_alloc_inode()
1716 struct dquot **dquots; in dquot_claim_space_nodirty()
1746 struct dquot **dquots; in dquot_reclaim_space_nodirty()
1778 struct dquot **dquots; in __dquot_free_space()
1822 struct dquot * const *dquots; in dquot_free_inode()
1861 int __dquot_transfer(struct inode *inode, struct dquot **transfer_to) in __dquot_transfer()
1865 struct dquot *transfer_from[MAXQUOTAS] = {}; in __dquot_transfer()
1962 struct dquot *transfer_to[MAXQUOTAS] = {}; in dquot_transfer()
2497 static void do_get_dqblk(struct dquot *dquot, struct qc_dqblk *di) in do_get_dqblk() argument
2499 struct mem_dqblk *dm = &dquot->dq_dqb; in do_get_dqblk()
2517 struct dquot *dquot; in dquot_get_dqblk() local
2519 dquot = dqget(sb, qid); in dquot_get_dqblk()
2520 if (!dquot) in dquot_get_dqblk()
2522 do_get_dqblk(dquot, di); in dquot_get_dqblk()
2523 dqput(dquot); in dquot_get_dqblk()
2535 static int do_set_dqblk(struct dquot *dquot, struct qc_dqblk *di) in do_set_dqblk() argument
2537 struct mem_dqblk *dm = &dquot->dq_dqb; in do_set_dqblk()
2539 struct mem_dqinfo *dqi = &sb_dqopt(dquot->dq_sb)->info[dquot->dq_id.type]; in do_set_dqblk()
2558 set_bit(DQ_LASTSET_B + QIF_SPACE_B, &dquot->dq_flags); in do_set_dqblk()
2567 set_bit(DQ_LASTSET_B + QIF_BLIMITS_B, &dquot->dq_flags); in do_set_dqblk()
2573 set_bit(DQ_LASTSET_B + QIF_INODES_B, &dquot->dq_flags); in do_set_dqblk()
2582 set_bit(DQ_LASTSET_B + QIF_ILIMITS_B, &dquot->dq_flags); in do_set_dqblk()
2588 set_bit(DQ_LASTSET_B + QIF_BTIME_B, &dquot->dq_flags); in do_set_dqblk()
2594 set_bit(DQ_LASTSET_B + QIF_ITIME_B, &dquot->dq_flags); in do_set_dqblk()
2601 clear_bit(DQ_BLKS_B, &dquot->dq_flags); in do_set_dqblk()
2610 clear_bit(DQ_INODES_B, &dquot->dq_flags); in do_set_dqblk()
2617 clear_bit(DQ_FAKE_B, &dquot->dq_flags); in do_set_dqblk()
2619 set_bit(DQ_FAKE_B, &dquot->dq_flags); in do_set_dqblk()
2621 mark_dquot_dirty(dquot); in do_set_dqblk()
2629 struct dquot *dquot; in dquot_set_dqblk() local
2632 dquot = dqget(sb, qid); in dquot_set_dqblk()
2633 if (!dquot) { in dquot_set_dqblk()
2637 rc = do_set_dqblk(dquot, di); in dquot_set_dqblk()
2638 dqput(dquot); in dquot_set_dqblk()
2852 sizeof(struct dquot), sizeof(unsigned long) * 4, in dquot_init()