*/
__erofs_workgroup_get(grp);
- err = radix_tree_insert(&sbi->workstn_tree,
- grp->index, grp);
+ err = radix_tree_insert(&sbi->workstn_tree, grp->index, grp);
if (unlikely(err))
/*
* it's safe to decrease since the workgroup isn't visible
bool cleanup)
{
/*
- * for managed cache enabled, the refcount of workgroups
- * themselves could be < 0 (freezed). So there is no guarantee
- * that all refcount > 0 if managed cache is enabled.
+ * If managed cache is on, refcount of workgroups
+ * themselves could be < 0 (freezed). In other words,
+ * there is no guarantee that all refcounts > 0.
*/
if (!erofs_workgroup_try_to_freeze(grp, 1))
return false;
/*
- * note that all cached pages should be unlinked
- * before delete it from the radix tree.
- * Otherwise some cached pages of an orphan old workgroup
- * could be still linked after the new one is available.
+ * Note that all cached pages should be unattached
+ * before deleted from the radix tree. Otherwise some
+ * cached pages could be still attached to the orphan
+ * old workgroup when the new one is available in the tree.
*/
if (erofs_try_to_free_all_cached_pages(sbi, grp)) {
erofs_workgroup_unfreeze(grp, 1);
}
/*
- * it is impossible to fail after the workgroup is freezed,
+ * It's impossible to fail after the workgroup is freezed,
* however in order to avoid some race conditions, add a
* DBG_BUGON to observe this in advance.
*/
grp->index)) != grp);
/*
- * if managed cache is enable, the last refcount
- * should indicate the related workstation.
+ * If managed cache is on, last refcount should indicate
+ * the related workstation.
*/
erofs_workgroup_unfreeze_final(grp);
return true;
unsigned long freed = 0;
spin_lock(&erofs_sb_list_lock);
- do
+ do {
run_no = ++shrinker_run_no;
- while (run_no == 0);
+ } while (run_no == 0);
/* Iterate over all mounted superblocks and try to shrink them */
p = erofs_sb_list.next;