[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <906f7469-492d-febc-c7ed-b01830ae900d@cloud.ionos.com>
Date: Fri, 22 May 2020 09:18:25 +0200
From: Guoqing Jiang <guoqing.jiang@...ud.ionos.com>
To: Dave Chinner <david@...morbit.com>
Cc: akpm@...ux-foundation.org, viro@...iv.linux.org.uk,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
hch@...radead.org, willy@...radead.org
Subject: Re: [PATCH 10/10] mm/migrate.c: call detach_page_private to cleanup
code
Hi Dave,
On 5/22/20 12:52 AM, Dave Chinner wrote:
> On Sun, May 17, 2020 at 11:47:18PM +0200, Guoqing Jiang wrote:
>> We can cleanup code a little by call detach_page_private here.
>>
>> Signed-off-by: Guoqing Jiang <guoqing.jiang@...ud.ionos.com>
>> ---
>> No change since RFC V3.
>>
>> mm/migrate.c | 5 +----
>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> diff --git a/mm/migrate.c b/mm/migrate.c
>> index 5fed0305d2ec..f99502bc113c 100644
>> --- a/mm/migrate.c
>> +++ b/mm/migrate.c
>> @@ -804,10 +804,7 @@ static int __buffer_migrate_page(struct address_space *mapping,
>> if (rc != MIGRATEPAGE_SUCCESS)
>> goto unlock_buffers;
>>
>> - ClearPagePrivate(page);
>> - set_page_private(newpage, page_private(page));
>> - set_page_private(page, 0);
>> - put_page(page);
>> + set_page_private(newpage, detach_page_private(page));
> attach_page_private(newpage, detach_page_private(page));
Mattew had suggested it as follows, but not sure if we can reorder of
the setup of
the bh and setting PagePrivate, so I didn't want to break the original
syntax.
@@ -797,11 +797,7 @@ static int __buffer_migrate_page(struct address_space *mapping,
if (rc != MIGRATEPAGE_SUCCESS)
goto unlock_buffers;
- ClearPagePrivate(page);
- set_page_private(newpage, page_private(page));
- set_page_private(page, 0);
- put_page(page);
- get_page(newpage);
+ attach_page_private(newpage, detach_page_private(page));
bh = head;
do {
@@ -810,8 +806,6 @@ static int __buffer_migrate_page(struct address_space *mapping,
} while (bh != head);
- SetPagePrivate(newpage);
-
if (mode != MIGRATE_SYNC_NO_COPY)
[1].
https://lore.kernel.org/lkml/20200502004158.GD29705@bombadil.infradead.org/
[2].
https://lore.kernel.org/lkml/e4d5ddc0-877f-6499-f697-2b7c0ddbf386@cloud.ionos.com/
Thanks,
Guoqing
Powered by blists - more mailing lists