dquot.c (f01387d2693813eb5271a3448e6a082322c7d75d) dquot.c (d68aab6b8f572406aa93b45ef6483934dd3b54a6)
1/*
2 * Implementation of the diskquota system for the LINUX operating system. QUOTA
3 * is implemented using the BSD system call interface as the means of
4 * communication with the user level. This file contains the generic routines
5 * called by the different filesystems on allocation of an inode or block.
6 * These routines take care of the administration needed to have a consistent
7 * diskquota tracking system. The ideas of both user and group quotas are based
8 * on the Melbourne quota system as used on BSD derived systems. The internal

--- 688 unchanged lines hidden (view full) ---

697
698static unsigned long
699dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
700{
701 struct list_head *head;
702 struct dquot *dquot;
703 unsigned long freed = 0;
704
1/*
2 * Implementation of the diskquota system for the LINUX operating system. QUOTA
3 * is implemented using the BSD system call interface as the means of
4 * communication with the user level. This file contains the generic routines
5 * called by the different filesystems on allocation of an inode or block.
6 * These routines take care of the administration needed to have a consistent
7 * diskquota tracking system. The ideas of both user and group quotas are based
8 * on the Melbourne quota system as used on BSD derived systems. The internal

--- 688 unchanged lines hidden (view full) ---

697
698static unsigned long
699dqcache_shrink_scan(struct shrinker *shrink, struct shrink_control *sc)
700{
701 struct list_head *head;
702 struct dquot *dquot;
703 unsigned long freed = 0;
704
705 spin_lock(&dq_list_lock);
705 head = free_dquots.prev;
706 while (head != &free_dquots && sc->nr_to_scan) {
707 dquot = list_entry(head, struct dquot, dq_free);
708 remove_dquot_hash(dquot);
709 remove_free_dquot(dquot);
710 remove_inuse(dquot);
711 do_destroy_dquot(dquot);
712 sc->nr_to_scan--;
713 freed++;
714 head = free_dquots.prev;
715 }
706 head = free_dquots.prev;
707 while (head != &free_dquots && sc->nr_to_scan) {
708 dquot = list_entry(head, struct dquot, dq_free);
709 remove_dquot_hash(dquot);
710 remove_free_dquot(dquot);
711 remove_inuse(dquot);
712 do_destroy_dquot(dquot);
713 sc->nr_to_scan--;
714 freed++;
715 head = free_dquots.prev;
716 }
717 spin_unlock(&dq_list_lock);
716 return freed;
717}
718
719static unsigned long
720dqcache_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
721{
722 return vfs_pressure_ratio(
723 percpu_counter_read_positive(&dqstats.counter[DQST_FREE_DQUOTS]));

--- 2044 unchanged lines hidden ---
718 return freed;
719}
720
721static unsigned long
722dqcache_shrink_count(struct shrinker *shrink, struct shrink_control *sc)
723{
724 return vfs_pressure_ratio(
725 percpu_counter_read_positive(&dqstats.counter[DQST_FREE_DQUOTS]));

--- 2044 unchanged lines hidden ---