linux-erofs.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()
@ 2021-04-19 10:26 Yue Hu
  2021-04-19 10:56 ` Gao Xiang
  2021-05-21  1:59 ` Gao Xiang
  0 siblings, 2 replies; 4+ messages in thread
From: Yue Hu @ 2021-04-19 10:26 UTC (permalink / raw)
  To: xiang, chao; +Cc: huyue2, linux-erofs, zbestahu

From: Yue Hu <huyue2@yulong.com>

No any behavior to variable occupied in z_erofs_attach_page() which
is only caller to z_erofs_pagevec_enqueue().

Signed-off-by: Yue Hu <huyue2@yulong.com>
---
 fs/erofs/zdata.c | 4 +---
 fs/erofs/zpvec.h | 5 +----
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
index 3851e1a..e9231da 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -298,7 +298,6 @@ static int z_erofs_attach_page(struct z_erofs_collector *clt,
 			       enum z_erofs_page_type type)
 {
 	int ret;
-	bool occupied;
 
 	/* give priority for inplaceio */
 	if (clt->mode >= COLLECT_PRIMARY &&
@@ -306,8 +305,7 @@ static int z_erofs_attach_page(struct z_erofs_collector *clt,
 	    z_erofs_try_inplace_io(clt, page))
 		return 0;
 
-	ret = z_erofs_pagevec_enqueue(&clt->vector,
-				      page, type, &occupied);
+	ret = z_erofs_pagevec_enqueue(&clt->vector, page, type);
 	clt->cl->vcnt += (unsigned int)ret;
 
 	return ret ? 0 : -EAGAIN;
diff --git a/fs/erofs/zpvec.h b/fs/erofs/zpvec.h
index 1d67cbd..95a6207 100644
--- a/fs/erofs/zpvec.h
+++ b/fs/erofs/zpvec.h
@@ -107,10 +107,8 @@ static inline void z_erofs_pagevec_ctor_init(struct z_erofs_pagevec_ctor *ctor,
 
 static inline bool z_erofs_pagevec_enqueue(struct z_erofs_pagevec_ctor *ctor,
 					   struct page *page,
-					   enum z_erofs_page_type type,
-					   bool *occupied)
+					   enum z_erofs_page_type type)
 {
-	*occupied = false;
 	if (!ctor->next && type)
 		if (ctor->index + 1 == ctor->nr)
 			return false;
@@ -125,7 +123,6 @@ static inline bool z_erofs_pagevec_enqueue(struct z_erofs_pagevec_ctor *ctor,
 	/* should remind that collector->next never equal to 1, 2 */
 	if (type == (uintptr_t)ctor->next) {
 		ctor->next = page;
-		*occupied = true;
 	}
 	ctor->pages[ctor->index++] = tagptr_fold(erofs_vtptr_t, page, type);
 	return true;
-- 
1.9.1


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

* Re: [PATCH] erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()
  2021-04-19 10:26 [PATCH] erofs: remove the occupied parameter from z_erofs_pagevec_enqueue() Yue Hu
@ 2021-04-19 10:56 ` Gao Xiang
  2021-04-19 11:01   ` Yue Hu
  2021-05-21  1:59 ` Gao Xiang
  1 sibling, 1 reply; 4+ messages in thread
From: Gao Xiang @ 2021-04-19 10:56 UTC (permalink / raw)
  To: Yue Hu; +Cc: xiang, linux-erofs, huyue2, zbestahu

Hi Yue,

On Mon, Apr 19, 2021 at 06:26:23PM +0800, Yue Hu wrote:
> From: Yue Hu <huyue2@yulong.com>
> 
> No any behavior to variable occupied in z_erofs_attach_page() which
> is only caller to z_erofs_pagevec_enqueue().
> 
> Signed-off-by: Yue Hu <huyue2@yulong.com>

Thanks for your patch :) the variable `occupied' also has its usage
from pagevec implementation itself. But I agree with you on this
since it's actually unused now.

As we're in final-rc of 5.12 now, I've freezed the patches for 5.13.
I'll put off this cleanup to the next merge queue...

(btw, for erofs kernel patches, could you kindly Cc: linux-kernel
 mailing list next time as well... since it's part of linux kernel
 as well.)

Thanks,
Gao Xiang

> ---
>  fs/erofs/zdata.c | 4 +---
>  fs/erofs/zpvec.h | 5 +----
>  2 files changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
> index 3851e1a..e9231da 100644
> --- a/fs/erofs/zdata.c
> +++ b/fs/erofs/zdata.c
> @@ -298,7 +298,6 @@ static int z_erofs_attach_page(struct z_erofs_collector *clt,
>  			       enum z_erofs_page_type type)
>  {
>  	int ret;
> -	bool occupied;
>  
>  	/* give priority for inplaceio */
>  	if (clt->mode >= COLLECT_PRIMARY &&
> @@ -306,8 +305,7 @@ static int z_erofs_attach_page(struct z_erofs_collector *clt,
>  	    z_erofs_try_inplace_io(clt, page))
>  		return 0;
>  
> -	ret = z_erofs_pagevec_enqueue(&clt->vector,
> -				      page, type, &occupied);
> +	ret = z_erofs_pagevec_enqueue(&clt->vector, page, type);
>  	clt->cl->vcnt += (unsigned int)ret;
>  
>  	return ret ? 0 : -EAGAIN;
> diff --git a/fs/erofs/zpvec.h b/fs/erofs/zpvec.h
> index 1d67cbd..95a6207 100644
> --- a/fs/erofs/zpvec.h
> +++ b/fs/erofs/zpvec.h
> @@ -107,10 +107,8 @@ static inline void z_erofs_pagevec_ctor_init(struct z_erofs_pagevec_ctor *ctor,
>  
>  static inline bool z_erofs_pagevec_enqueue(struct z_erofs_pagevec_ctor *ctor,
>  					   struct page *page,
> -					   enum z_erofs_page_type type,
> -					   bool *occupied)
> +					   enum z_erofs_page_type type)
>  {
> -	*occupied = false;
>  	if (!ctor->next && type)
>  		if (ctor->index + 1 == ctor->nr)
>  			return false;
> @@ -125,7 +123,6 @@ static inline bool z_erofs_pagevec_enqueue(struct z_erofs_pagevec_ctor *ctor,
>  	/* should remind that collector->next never equal to 1, 2 */
>  	if (type == (uintptr_t)ctor->next) {
>  		ctor->next = page;
> -		*occupied = true;
>  	}
>  	ctor->pages[ctor->index++] = tagptr_fold(erofs_vtptr_t, page, type);
>  	return true;
> -- 
> 1.9.1
> 


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

* Re: [PATCH] erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()
  2021-04-19 10:56 ` Gao Xiang
@ 2021-04-19 11:01   ` Yue Hu
  0 siblings, 0 replies; 4+ messages in thread
From: Yue Hu @ 2021-04-19 11:01 UTC (permalink / raw)
  To: Gao Xiang; +Cc: xiang, linux-erofs, huyue2, zbestahu

On Mon, 19 Apr 2021 18:56:55 +0800
Gao Xiang <hsiangkao@redhat.com> wrote:

> Hi Yue,
> 
> On Mon, Apr 19, 2021 at 06:26:23PM +0800, Yue Hu wrote:
> > From: Yue Hu <huyue2@yulong.com>
> > 
> > No any behavior to variable occupied in z_erofs_attach_page() which
> > is only caller to z_erofs_pagevec_enqueue().
> > 
> > Signed-off-by: Yue Hu <huyue2@yulong.com>  
> 
> Thanks for your patch :) the variable `occupied' also has its usage
> from pagevec implementation itself. But I agree with you on this
> since it's actually unused now.
> 
> As we're in final-rc of 5.12 now, I've freezed the patches for 5.13.
> I'll put off this cleanup to the next merge queue...
> 
> (btw, for erofs kernel patches, could you kindly Cc: linux-kernel
>  mailing list next time as well... since it's part of linux kernel
>  as well.)

ok, keep in mind.

Thanks.

> 
> Thanks,
> Gao Xiang
> 
> > ---
> >  fs/erofs/zdata.c | 4 +---
> >  fs/erofs/zpvec.h | 5 +----
> >  2 files changed, 2 insertions(+), 7 deletions(-)
> > 
> > diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
> > index 3851e1a..e9231da 100644
> > --- a/fs/erofs/zdata.c
> > +++ b/fs/erofs/zdata.c
> > @@ -298,7 +298,6 @@ static int z_erofs_attach_page(struct z_erofs_collector *clt,
> >  			       enum z_erofs_page_type type)
> >  {
> >  	int ret;
> > -	bool occupied;
> >  
> >  	/* give priority for inplaceio */
> >  	if (clt->mode >= COLLECT_PRIMARY &&
> > @@ -306,8 +305,7 @@ static int z_erofs_attach_page(struct z_erofs_collector *clt,
> >  	    z_erofs_try_inplace_io(clt, page))
> >  		return 0;
> >  
> > -	ret = z_erofs_pagevec_enqueue(&clt->vector,
> > -				      page, type, &occupied);
> > +	ret = z_erofs_pagevec_enqueue(&clt->vector, page, type);
> >  	clt->cl->vcnt += (unsigned int)ret;
> >  
> >  	return ret ? 0 : -EAGAIN;
> > diff --git a/fs/erofs/zpvec.h b/fs/erofs/zpvec.h
> > index 1d67cbd..95a6207 100644
> > --- a/fs/erofs/zpvec.h
> > +++ b/fs/erofs/zpvec.h
> > @@ -107,10 +107,8 @@ static inline void z_erofs_pagevec_ctor_init(struct z_erofs_pagevec_ctor *ctor,
> >  
> >  static inline bool z_erofs_pagevec_enqueue(struct z_erofs_pagevec_ctor *ctor,
> >  					   struct page *page,
> > -					   enum z_erofs_page_type type,
> > -					   bool *occupied)
> > +					   enum z_erofs_page_type type)
> >  {
> > -	*occupied = false;
> >  	if (!ctor->next && type)
> >  		if (ctor->index + 1 == ctor->nr)
> >  			return false;
> > @@ -125,7 +123,6 @@ static inline bool z_erofs_pagevec_enqueue(struct z_erofs_pagevec_ctor *ctor,
> >  	/* should remind that collector->next never equal to 1, 2 */
> >  	if (type == (uintptr_t)ctor->next) {
> >  		ctor->next = page;
> > -		*occupied = true;
> >  	}
> >  	ctor->pages[ctor->index++] = tagptr_fold(erofs_vtptr_t, page, type);
> >  	return true;
> > -- 
> > 1.9.1
> >   
> 


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

* Re: [PATCH] erofs: remove the occupied parameter from z_erofs_pagevec_enqueue()
  2021-04-19 10:26 [PATCH] erofs: remove the occupied parameter from z_erofs_pagevec_enqueue() Yue Hu
  2021-04-19 10:56 ` Gao Xiang
@ 2021-05-21  1:59 ` Gao Xiang
  1 sibling, 0 replies; 4+ messages in thread
From: Gao Xiang @ 2021-05-21  1:59 UTC (permalink / raw)
  To: Yue Hu; +Cc: huyue2, linux-erofs, zbestahu

On Mon, Apr 19, 2021 at 06:26:23PM +0800, Yue Hu wrote:
> From: Yue Hu <huyue2@yulong.com>
> 
> No any behavior to variable occupied in z_erofs_attach_page() which
> is only caller to z_erofs_pagevec_enqueue().
> 
> Signed-off-by: Yue Hu <huyue2@yulong.com>

Last time forget to add:

Reviewed-by: Gao Xiang <xiang@kernel.org>

Thanks,
Gao Xiang


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

end of thread, other threads:[~2021-05-21  1:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 10:26 [PATCH] erofs: remove the occupied parameter from z_erofs_pagevec_enqueue() Yue Hu
2021-04-19 10:56 ` Gao Xiang
2021-04-19 11:01   ` Yue Hu
2021-05-21  1:59 ` Gao Xiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).