Lines Matching +full:pre +full:- +full:its

1 // SPDX-License-Identifier: GPL-2.0-only
17 list_del(&page->lru); in erofs_allocpage()
47 return -1; in erofs_workgroup_get()
49 if (atomic_cmpxchg(&grp->refcount, o, o + 1) != o) in erofs_workgroup_get()
66 grp = xa_load(&sbi->managed_pslots, index); in erofs_find_workgroup()
74 DBG_BUGON(index != grp->index); in erofs_find_workgroup()
84 struct erofs_workgroup *pre; in erofs_insert_workgroup() local
91 atomic_inc(&grp->refcount); in erofs_insert_workgroup()
94 xa_lock(&sbi->managed_pslots); in erofs_insert_workgroup()
95 pre = __xa_cmpxchg(&sbi->managed_pslots, grp->index, in erofs_insert_workgroup()
97 if (pre) { in erofs_insert_workgroup()
98 if (xa_is_err(pre)) { in erofs_insert_workgroup()
99 pre = ERR_PTR(xa_err(pre)); in erofs_insert_workgroup()
100 } else if (erofs_workgroup_get(pre)) { in erofs_insert_workgroup()
101 /* try to legitimize the current in-tree one */ in erofs_insert_workgroup()
102 xa_unlock(&sbi->managed_pslots); in erofs_insert_workgroup()
106 atomic_dec(&grp->refcount); in erofs_insert_workgroup()
107 grp = pre; in erofs_insert_workgroup()
109 xa_unlock(&sbi->managed_pslots); in erofs_insert_workgroup()
121 int count = atomic_dec_return(&grp->refcount); in erofs_workgroup_put()
157 DBG_BUGON(xa_erase(&sbi->managed_pslots, grp->index) != grp); in erofs_try_to_release_workgroup()
159 /* last refcount should be connected with its managed pslot. */ in erofs_try_to_release_workgroup()
172 xa_for_each(&sbi->managed_pslots, index, grp) { in erofs_shrink_workstation()
178 if (!--nr_shrink) in erofs_shrink_workstation()
195 mutex_init(&sbi->umount_mutex); in erofs_shrinker_register()
198 list_add(&sbi->list, &erofs_sb_list); in erofs_shrinker_register()
206 mutex_lock(&sbi->umount_mutex); in erofs_shrinker_unregister()
211 list_del(&sbi->list); in erofs_shrinker_unregister()
213 mutex_unlock(&sbi->umount_mutex); in erofs_shrinker_unregister()
228 unsigned long nr = sc->nr_to_scan; in erofs_shrink_scan()
246 if (sbi->shrinker_run_no == run_no) in erofs_shrink_scan()
249 if (!mutex_trylock(&sbi->umount_mutex)) { in erofs_shrink_scan()
250 p = p->next; in erofs_shrink_scan()
255 sbi->shrinker_run_no = run_no; in erofs_shrink_scan()
257 freed += erofs_shrink_workstation(sbi, nr - freed); in erofs_shrink_scan()
261 p = p->next; in erofs_shrink_scan()
267 list_move_tail(&sbi->list, &erofs_sb_list); in erofs_shrink_scan()
268 mutex_unlock(&sbi->umount_mutex); in erofs_shrink_scan()