Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1093859ybj; Thu, 7 May 2020 14:48:42 -0700 (PDT) X-Google-Smtp-Source: APiQypIWDG8gSPfGdyEUgskfeD0YGKA02VmmBv5m54U8GRK9wWCnnmJPgfhLmd9BK16BdAVPAIOP X-Received: by 2002:a17:906:ce4b:: with SMTP id se11mr14830549ejb.178.1588888122668; Thu, 07 May 2020 14:48:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588888122; cv=none; d=google.com; s=arc-20160816; b=cdUlIMzEwpHCdgtSfrHX7hVgpvnk4cqrYgKpNiQpH1j6abmWVWNclT57h24zdwthg7 mL2QY8WYn2cNjwf30cMDmIXsC/bx7uPzliPqG7eG3jLC4qWlgvbD61BkHhw3CzMhRBeR hOLij+bKHW+GAGOzv9y+8xKlQTTVuRde44GlR/TBfSWlDT7JLK7E23ijktOojOB57GYm fB0aQ5+Tethvpb5JMLzJRuvJNs8E8S4vTpE+4WKgZOj/5TjYgyK0gavQhq0AbCVhOdi7 NUd1l0Q8qF3SKUy7pgOYgfSF4ifvEYyaokwDUhsKnuJBbzNgctjMVMlO3TVBgEN3O4yS SM1g== 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=nRmHX3IZZP32x36RObq8cJr3jcmYRzNNrV24AaRSD3Q=; b=xj8h/4rh+Ncn/Mqe20i+80ji/SCJFOc82EoPUA4SrrGgtlDhYwb7raSp2TCtcrXzYF 5HVahwvnWrdL1F4GIONpCwk6uQkWIsV+kkCHpPAysgkfhrrZd2cpsM39vRYeekaYk5ro w1yTcVHfLy2i2kkAruJv1E2I7/HZH3kjhn3rCFWw8c7D/U89vU5edwtgsrEyqn29E3Y3 x8xNNJQx921it8geZ9o2uoaDiQHb2ISk40P0+/HRNZ11raJajxhGlLW8E0VcJed13yrS +OHAyH3OP1zJ+bXQ7O0y8oYbWAVuWh8KdlRlqaauB8JMtrhGWsbyZwjhuzSYWGEfuYw2 UocQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b="BwT/Zh3w"; 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 dk10si4071545edb.3.2020.05.07.14.48.19; Thu, 07 May 2020 14:48:42 -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="BwT/Zh3w"; 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 S1727853AbgEGVpE (ORCPT + 99 others); Thu, 7 May 2020 17:45:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726792AbgEGVoV (ORCPT ); Thu, 7 May 2020 17:44:21 -0400 Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56C58C05BD09 for ; Thu, 7 May 2020 14:44:20 -0700 (PDT) Received: by mail-ed1-x542.google.com with SMTP id r7so6725906edo.11 for ; Thu, 07 May 2020 14:44:20 -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=nRmHX3IZZP32x36RObq8cJr3jcmYRzNNrV24AaRSD3Q=; b=BwT/Zh3w5Ab/2fyrWKjcImjnCLggazQc5C+NxIqfPv7fWBCfut0N3l156Zqibr5H47 cI5J4ono9XJ8qJ9rDaMRJlcuwuIZBxSUTRJOrkFEJ9EPJmu38UutefuP0qibEyeDhguL sU5BY7JZW4JNRQrJiYUJtzEVYWJpPYwSQZRdF+8sI3Z+F/CK/fiJAysAbbLy+Vp3naDf gUQvavWsolWGkgXU9XkGB6E5mPg7vARWDkkNfUITP5FYfD30vkbWgx6WwVpiDtHEOUZZ C4ecKMvVonzP+dt4s0jxzpuO3NCSo6CE9eOd9AOyPnNqOtiBMzlmw2TTULpRknpxApAN QLNA== 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=nRmHX3IZZP32x36RObq8cJr3jcmYRzNNrV24AaRSD3Q=; b=CdpBRZmAPjUBlt09md37UO99Eithd9JK3X0qakYC5SZu4pkwe8fZ6Y4oh6QntASes6 0ot6lrUTlsKVZ5DAs/RZBxNCyOOAkPZC3MCviNHhk0VHQiwsGKOqvkNjRCYGEKqOFOP8 PXIltjnljiiwwckKpDGoJNeYqMUMyIIwj/lAI+bn9ha251QHc7FDdgLRtAW07vUm8SBk 4CvIhNvqzVq45jcYhYKwh1mUfq/XlLbCLhPXZiWQjiryM8NBJsE8uyYhq7rI9Ho9KyV4 54pk3xqz2t25VhMsKcZg5PkToqJ/fVV6dxm4tjWrLrK7JfY7EiPCQDy0LIPPjBjHDQu6 hRPA== X-Gm-Message-State: AGi0PubOdtzbWXNgr8R5epRXAAyVhVshCaDVUZKpz1GjztucwKaOodGA PWygGCaxL07wW0YhKSo2GPJsUQ== X-Received: by 2002:a50:88a6:: with SMTP id d35mr8080403edd.238.1588887859059; Thu, 07 May 2020 14:44:19 -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.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 May 2020 14:44:18 -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 , Song Liu , linux-raid@vger.kernel.org Subject: [RFC PATCH V3 02/10] md: remove __clear_page_buffers and use attach/detach_page_private Date: Thu, 7 May 2020 23:43:52 +0200 Message-Id: <20200507214400.15785-3-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 After introduce attach/detach_page_private in pagemap.h, we can remove the duplicat code and call the new functions. Cc: Song Liu Cc: linux-raid@vger.kernel.org Signed-off-by: Guoqing Jiang --- RFC V2 -> RFC V3 1. rename clear_page_private to detach_page_private. RFC -> RFC V2 1. change the name of new functions to attach/clear_page_private. drivers/md/md-bitmap.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c index b952bd45bd6a..95a5f3757fa3 100644 --- a/drivers/md/md-bitmap.c +++ b/drivers/md/md-bitmap.c @@ -324,14 +324,6 @@ static void end_bitmap_write(struct buffer_head *bh, int uptodate) wake_up(&bitmap->write_wait); } -/* copied from buffer.c */ -static void -__clear_page_buffers(struct page *page) -{ - ClearPagePrivate(page); - set_page_private(page, 0); - put_page(page); -} static void free_buffers(struct page *page) { struct buffer_head *bh; @@ -345,7 +337,7 @@ static void free_buffers(struct page *page) free_buffer_head(bh); bh = next; } - __clear_page_buffers(page); + detach_page_private(page); put_page(page); } @@ -374,7 +366,7 @@ static int read_page(struct file *file, unsigned long index, ret = -ENOMEM; goto out; } - attach_page_buffers(page, bh); + attach_page_private(page, bh); blk_cur = index << (PAGE_SHIFT - inode->i_blkbits); while (bh) { block = blk_cur; -- 2.17.1