Skip to contentSkip to conversation

erofs: fold in used-once helper erofs_workgroup_unfreeze_final()

PATCH In review Gao Xiang 3 participants 3 messages Jul 29, 2020 – Jul 31, 2020 EROFS file system

lore
Share & tools
lore

Gao Xiang

author
#0 lore raw

PATCH 1/1 erofs: fold in used-once helper erofs_workgroup_unfreeze_final()

It's expected that erofs_workgroup_unfreeze_final() won't be used in other places. Let's fold it to simplify the code.

---
 fs/erofs/utils.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
fs/erofs/utils.c +3 -11
index 52d0be10f1aa..14485a621862 100644
@@ -127,12 +127,6 @@ int erofs_workgroup_put(struct erofs_workgroup *grp)
 	return count;
 }
 
-static void erofs_workgroup_unfreeze_final(struct erofs_workgroup *grp)
-{
-	erofs_workgroup_unfreeze(grp, 0);
-	__erofs_workgroup_free(grp);
-}
-
 static bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi,
 					   struct erofs_workgroup *grp)
 {
@@ -162,11 +156,9 @@ static bool erofs_try_to_release_workgroup(struct erofs_sb_info *sbi,
 	 */
 	DBG_BUGON(xa_erase(&sbi->managed_pslots, grp->index) != grp);
 
-	/*
-	 * If managed cache is on, last refcount should indicate
-	 * the related workstation.
-	 */
-	erofs_workgroup_unfreeze_final(grp);
+	/* last refcount should be connected with its managed pslot.  */
+	erofs_workgroup_unfreeze(grp, 0);
+	__erofs_workgroup_free(grp);
 	return true;
 }
 
Signature · 1 line
2.18.1