Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1093721ybj; Thu, 7 May 2020 14:48:31 -0700 (PDT) X-Google-Smtp-Source: APiQypIZ/OynCL30x1ukL4kwvInaMPI4gBN+gBYjAnJX2PppltPXfb91vc6ShYrzpWHj0FijYM7T X-Received: by 2002:a17:906:3004:: with SMTP id 4mr14284578ejz.381.1588888111124; Thu, 07 May 2020 14:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588888111; cv=none; d=google.com; s=arc-20160816; b=mJVlLfnRVIMK8PfID59hUSvveh7Onainl3URI00qXLRSrFHSaXyyKrHHqhBBuRJN8m ohehsNjWWEnAeB11Tv7tgf+a7r3fjvF1QDNCFOXFWCApF5doyzvNocxkqWpzhhe4ySFY 3vWAUtfINvDsPCygR1wcz3vSVdbL/MzZL6gzTemTJ+quxo7hMLVQIuHjL+u0+dm2P65u RC82Z25vNTegU/W7m+QBVgzmv0+RfQ6svecS215APO9xUJbuVB+SLFoF+EUkeZQRIjVR vmFxpRTXDWqtsfI3oafdOLJZtrqM3vlvitw51OlKXD23HQSIgmVkapZnBSGRlmlIurfW eNUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=p3qBa9K9MbgLEfhWUqlAktM7PPXv8tgud53nGFCyYG0=; b=dm7Ufzusgd1j6GSmX08kNh4lpzysZ0w5QzsydopaO9LeaQ/iuiq8Fp4CBGgAuElzVS PzOF1zRdYBddogI6tKnXQh3M14XSiNTBfoVCf0J4TscXpkPyU8WkayyO6vPhNOXeE0U2 +Q/CvkJUGfXaJOY9mHsTz8mVGIoutsq7VGiDW5pbkZ4gYUrcsTXbfJ+tkeoc9hXV7zC4 YP0b114S57Hr6RFzYUOIZnVdsWM4u7oRrOqCjNL+0WGSzQElO5tXVwj28wBgvqAa055/ 9Rct2ndt7awxZSMWvu7cAWhHH2tDgyeUkcebfZr8ouwPUVP5MneDa4lDDLaAbo46ofIs 8Lng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=dkeBq94O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk4si3743727ejb.529.2020.05.07.14.48.08; Thu, 07 May 2020 14:48:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=dkeBq94O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727819AbgEGVok (ORCPT + 99 others); Thu, 7 May 2020 17:44:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727783AbgEGVob (ORCPT ); Thu, 7 May 2020 17:44:31 -0400 Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com [IPv6:2a00:1450:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0ACFC05BD43 for ; Thu, 7 May 2020 14:44:29 -0700 (PDT) Received: by mail-ej1-x62b.google.com with SMTP id nv1so5915909ejb.0 for ; Thu, 07 May 2020 14:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.ionos.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=p3qBa9K9MbgLEfhWUqlAktM7PPXv8tgud53nGFCyYG0=; b=dkeBq94OBb3NF7kVoAbkVx2HSO3CU2chuvwHNFGEWXV0yhNdXxm/WFjxCC0MkuBwOQ ukTQVmH3uUPgYCweOd1LQwPUAiwXSwuEHHA3DGaAzdHCj7mD6A77knGTR2DbyLLaoMmr P9/xT7V4BL2slYRI2haV4GFVTBcxtTPf1JtlHWg9BSOm7kTAMgWRJ5oRuiN5qcHOOlyX BNtTA6Fe24s8s4Oa3ZVX5xjq6Kj2yZ8P5YLEXdWpAx+lfEA+3pPnLlKxThXhKsFv5fWe zkNndfIoksb9SEG4OkxblR24QSkvS1+qVaCorcEY8RlAtYD1QYFhXRzyfiZlmBPsE72S mwbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=p3qBa9K9MbgLEfhWUqlAktM7PPXv8tgud53nGFCyYG0=; b=eMo2coVjEoYI+5epQlBZL2yApjFlF6P+em17TlyHz82JEJL3MyN2AvZZ6a99IaMrX8 h9/sm1frio9ptsP4HHDIy9NiP0KqKfR1zOOJDmB97kzFCQLC/ixwWOSZz2bcYIsjLUdS MbfjNTOLlbWC8FHIdP9wlYf7fX+3Wyqp52k22Ryu4xZdWZa0W8Jb331WZVJ+GxoufoxQ kwqR9lQeFXeXyCcHHJcMjf2GCEveP6+S4AsV0EUe/MeqZvPtiFd3uOnI0GuN3L1IrXYK /UKc35hoS3kygNrtD8xZia1zp554baC5FyZviYnzdZlpVP1G3xSSQhldQ9hAlKFWyJfN Ksxg== X-Gm-Message-State: AGi0PuaqIUbornj6LiS7t5026uMxOkk2GqA+Ww0yPqDTw1PqRiOe141E zrmHJPwctDTHmAOoEVWTiHt/lw== X-Received: by 2002:a17:906:a857:: with SMTP id dx23mr14469278ejb.52.1588887868069; Thu, 07 May 2020 14:44:28 -0700 (PDT) Received: from ls00508.pb.local ([2001:1438:4010:2540:a1ee:a39a:b93a:c084]) by smtp.gmail.com with ESMTPSA id k3sm613530edi.60.2020.05.07.14.44.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 14:44:27 -0700 (PDT) From: Guoqing Jiang To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: david@fromorbit.com, hch@infradead.org, willy@infradead.org, Guoqing Jiang , Andrew Morton , linux-mm@kvack.org Subject: [RFC PATCH V3 10/10] mm/migrate.c: call detach_page_private to cleanup code Date: Thu, 7 May 2020 23:44:00 +0200 Message-Id: <20200507214400.15785-11-guoqing.jiang@cloud.ionos.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200507214400.15785-1-guoqing.jiang@cloud.ionos.com> References: <20200507214400.15785-1-guoqing.jiang@cloud.ionos.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We can cleanup code a little by call detach_page_private here. Cc: Andrew Morton Cc: linux-mm@kvack.org Signed-off-by: Guoqing Jiang --- Added 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 7160c1556f79..f214adfb3fa4 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -797,10 +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); + set_page_private(newpage, detach_page_private(page)); get_page(newpage); bh = head; -- 2.17.1