All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] erofs: fold in used-once helper erofs_workgroup_unfreeze_final()
@ 2020-07-29 18:02 ` Gao Xiang
  0 siblings, 0 replies; 6+ messages in thread
From: Gao Xiang @ 2020-07-29 18:02 UTC (permalink / raw)
  To: linux-erofs, Chao Yu; +Cc: LKML, Chao Yu, Gao Xiang

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

Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
---
 fs/erofs/utils.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/fs/erofs/utils.c b/fs/erofs/utils.c
index 52d0be10f1aa..14485a621862 100644
--- a/fs/erofs/utils.c
+++ b/fs/erofs/utils.c
@@ -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;
 }
 
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] erofs: fold in used-once helper erofs_workgroup_unfreeze_final()
@ 2020-07-29 18:02 ` Gao Xiang
  0 siblings, 0 replies; 6+ messages in thread
From: Gao Xiang @ 2020-07-29 18:02 UTC (permalink / raw)
  To: linux-erofs, Chao Yu; +Cc: LKML

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

Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
---
 fs/erofs/utils.c | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)

diff --git a/fs/erofs/utils.c b/fs/erofs/utils.c
index 52d0be10f1aa..14485a621862 100644
--- a/fs/erofs/utils.c
+++ b/fs/erofs/utils.c
@@ -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;
 }
 
-- 
2.18.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] erofs: fold in used-once helper erofs_workgroup_unfreeze_final()
  2020-07-29 18:02 ` Gao Xiang
@ 2020-07-31  3:49   ` Chao Yu
  -1 siblings, 0 replies; 6+ messages in thread
From: Chao Yu @ 2020-07-31  3:49 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs; +Cc: LKML, Chao Yu

On 2020/7/30 2:02, Gao Xiang wrote:
> It's expected that erofs_workgroup_unfreeze_final() won't
> be used in other places. Let's fold it to simplify the code.
> 
> Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] erofs: fold in used-once helper erofs_workgroup_unfreeze_final()
@ 2020-07-31  3:49   ` Chao Yu
  0 siblings, 0 replies; 6+ messages in thread
From: Chao Yu @ 2020-07-31  3:49 UTC (permalink / raw)
  To: Gao Xiang, linux-erofs; +Cc: LKML

On 2020/7/30 2:02, Gao Xiang wrote:
> It's expected that erofs_workgroup_unfreeze_final() won't
> be used in other places. Let's fold it to simplify the code.
> 
> Signed-off-by: Gao Xiang <hsiangkao@redhat.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] erofs: fold in used-once helper erofs_workgroup_unfreeze_final()
  2020-07-31  3:49   ` Chao Yu
@ 2020-07-31  3:54     ` Gao Xiang via Linux-erofs
  -1 siblings, 0 replies; 6+ messages in thread
From: Gao Xiang @ 2020-07-31  3:54 UTC (permalink / raw)
  To: Chao Yu; +Cc: Gao Xiang, linux-erofs, LKML

On Fri, Jul 31, 2020 at 11:49:04AM +0800, Chao Yu wrote:
> On 2020/7/30 2:02, Gao Xiang wrote:
> > It's expected that erofs_workgroup_unfreeze_final() won't
> > be used in other places. Let's fold it to simplify the code.
> > 
> > Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
> 
> Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks for the review :)

Thanks,
Gao Xiang

> 
> Thanks,

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] erofs: fold in used-once helper erofs_workgroup_unfreeze_final()
@ 2020-07-31  3:54     ` Gao Xiang via Linux-erofs
  0 siblings, 0 replies; 6+ messages in thread
From: Gao Xiang via Linux-erofs @ 2020-07-31  3:54 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-erofs, LKML

On Fri, Jul 31, 2020 at 11:49:04AM +0800, Chao Yu wrote:
> On 2020/7/30 2:02, Gao Xiang wrote:
> > It's expected that erofs_workgroup_unfreeze_final() won't
> > be used in other places. Let's fold it to simplify the code.
> > 
> > Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
> 
> Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks for the review :)

Thanks,
Gao Xiang

> 
> Thanks,

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-07-31  3:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-29 18:02 [PATCH] erofs: fold in used-once helper erofs_workgroup_unfreeze_final() Gao Xiang
2020-07-29 18:02 ` Gao Xiang
2020-07-31  3:49 ` Chao Yu
2020-07-31  3:49   ` Chao Yu
2020-07-31  3:54   ` Gao Xiang
2020-07-31  3:54     ` Gao Xiang via Linux-erofs

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.