Lines Matching full:grp

28 static int erofs_workgroup_get(struct erofs_workgroup *grp)  in erofs_workgroup_get()  argument
33 o = erofs_wait_on_workgroup_freezed(grp); in erofs_workgroup_get()
37 if (atomic_cmpxchg(&grp->refcount, o, o + 1) != o) in erofs_workgroup_get()
50 struct erofs_workgroup *grp; in erofs_find_workgroup() local
54 grp = xa_load(&sbi->managed_pslots, index); in erofs_find_workgroup()
55 if (grp) { in erofs_find_workgroup()
56 if (erofs_workgroup_get(grp)) { in erofs_find_workgroup()
62 DBG_BUGON(index != grp->index); in erofs_find_workgroup()
65 return grp; in erofs_find_workgroup()
69 struct erofs_workgroup *grp) in erofs_insert_workgroup() argument
79 atomic_inc(&grp->refcount); in erofs_insert_workgroup()
83 pre = __xa_cmpxchg(&sbi->managed_pslots, grp->index, in erofs_insert_workgroup()
84 NULL, grp, GFP_NOFS); in erofs_insert_workgroup()
94 atomic_dec(&grp->refcount); in erofs_insert_workgroup()
95 grp = pre; in erofs_insert_workgroup()
98 return grp; in erofs_insert_workgroup()
101 static void __erofs_workgroup_free(struct erofs_workgroup *grp) in __erofs_workgroup_free() argument
104 erofs_workgroup_free_rcu(grp); in __erofs_workgroup_free()
107 int erofs_workgroup_put(struct erofs_workgroup *grp) in erofs_workgroup_put() argument
109 int count = atomic_dec_return(&grp->refcount); in erofs_workgroup_put()
114 __erofs_workgroup_free(grp); in erofs_workgroup_put()
119 struct erofs_workgroup *grp) in erofs_try_to_release_workgroup() argument
126 if (!erofs_workgroup_try_to_freeze(grp, 1)) in erofs_try_to_release_workgroup()
135 if (erofs_try_to_free_all_cached_pages(sbi, grp)) { in erofs_try_to_release_workgroup()
136 erofs_workgroup_unfreeze(grp, 1); in erofs_try_to_release_workgroup()
145 DBG_BUGON(__xa_erase(&sbi->managed_pslots, grp->index) != grp); in erofs_try_to_release_workgroup()
148 erofs_workgroup_unfreeze(grp, 0); in erofs_try_to_release_workgroup()
149 __erofs_workgroup_free(grp); in erofs_try_to_release_workgroup()
156 struct erofs_workgroup *grp; in erofs_shrink_workstation() local
161 xa_for_each(&sbi->managed_pslots, index, grp) { in erofs_shrink_workstation()
163 if (!erofs_try_to_release_workgroup(sbi, grp)) in erofs_shrink_workstation()