diff mbox series

[3/5] iomap: call __clear_page_buffers in iomap_page_release

Message ID 20200418225123.31850-4-guoqing.jiang@cloud.ionos.com (mailing list archive)
State New, archived
Headers show
Series export __clear_page_buffers to cleanup code | expand

Commit Message

Guoqing Jiang April 18, 2020, 10:51 p.m. UTC
After the helper is exported, we can call it to simplify code a little.

Cc: Christoph Hellwig <hch@infradead.org>
Cc: Darrick J. Wong <darrick.wong@oracle.com>
Cc: linux-xfs@vger.kernel.org
Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
---
 fs/iomap/buffered-io.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Christoph Hellwig April 19, 2020, 7:47 a.m. UTC | #1
On Sun, Apr 19, 2020 at 12:51:21AM +0200, Guoqing Jiang wrote:
> After the helper is exported, we can call it to simplify code a little.
> 
> Cc: Christoph Hellwig <hch@infradead.org>
> Cc: Darrick J. Wong <darrick.wong@oracle.com>
> Cc: linux-xfs@vger.kernel.org
> Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
> ---
>  fs/iomap/buffered-io.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
> index 89e21961d1ad..b06568ad9a7a 100644
> --- a/fs/iomap/buffered-io.c
> +++ b/fs/iomap/buffered-io.c
> @@ -74,9 +74,7 @@ iomap_page_release(struct page *page)
>  		return;
>  	WARN_ON_ONCE(atomic_read(&iop->read_count));
>  	WARN_ON_ONCE(atomic_read(&iop->write_count));
> -	ClearPagePrivate(page);
> -	set_page_private(page, 0);
> -	put_page(page);
> +	__clear_page_buffers(page);

We should not call a helper mentioning buffers in code that has
nothing to do with buffers.  If you want to us __clear_page_buffers
more widely please give it a better name first.

You'll also forgot to Cc me on the other patches in the series, which is
a completel no-go as it doesn't allow for a proper review.
Guoqing Jiang April 19, 2020, 1:18 p.m. UTC | #2
On 19.04.20 09:47, Christoph Hellwig wrote:
> On Sun, Apr 19, 2020 at 12:51:21AM +0200, Guoqing Jiang wrote:
>> After the helper is exported, we can call it to simplify code a little.
>>
>> Cc: Christoph Hellwig <hch@infradead.org>
>> Cc: Darrick J. Wong <darrick.wong@oracle.com>
>> Cc: linux-xfs@vger.kernel.org
>> Signed-off-by: Guoqing Jiang <guoqing.jiang@cloud.ionos.com>
>> ---
>>   fs/iomap/buffered-io.c | 4 +---
>>   1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
>> index 89e21961d1ad..b06568ad9a7a 100644
>> --- a/fs/iomap/buffered-io.c
>> +++ b/fs/iomap/buffered-io.c
>> @@ -74,9 +74,7 @@ iomap_page_release(struct page *page)
>>   		return;
>>   	WARN_ON_ONCE(atomic_read(&iop->read_count));
>>   	WARN_ON_ONCE(atomic_read(&iop->write_count));
>> -	ClearPagePrivate(page);
>> -	set_page_private(page, 0);
>> -	put_page(page);
>> +	__clear_page_buffers(page);
> We should not call a helper mentioning buffers in code that has
> nothing to do with buffers.  If you want to us __clear_page_buffers
> more widely please give it a better name first.

Yes, I will rename it to clear_page_private as Matthew suggested.

> You'll also forgot to Cc me on the other patches in the series, which is
> a completel no-go as it doesn't allow for a proper review.

Sorry, will cc you with the series next time.

Thanks,
Guoqing
diff mbox series

Patch

diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 89e21961d1ad..b06568ad9a7a 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -74,9 +74,7 @@  iomap_page_release(struct page *page)
 		return;
 	WARN_ON_ONCE(atomic_read(&iop->read_count));
 	WARN_ON_ONCE(atomic_read(&iop->write_count));
-	ClearPagePrivate(page);
-	set_page_private(page, 0);
-	put_page(page);
+	__clear_page_buffers(page);
 	kfree(iop);
 }