Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2259585ybz; Sun, 26 Apr 2020 14:52:06 -0700 (PDT) X-Google-Smtp-Source: APiQypJsXZ0Z6dNV/6eWLfQv4dz9ySfGBoSoeOKvpVBWsGVCQg65dUX4OTtPHycruUtbAjBOt1tp X-Received: by 2002:a17:906:70f:: with SMTP id y15mr17266156ejb.276.1587937926580; Sun, 26 Apr 2020 14:52:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587937926; cv=none; d=google.com; s=arc-20160816; b=Np6SBbR530ENq7ipjjQKyyIGoRULU4G0NDK6tBbwojfbmwLiz9s5YM4ETydWj6V9Wr 4Rsfrt4pe6DxqelsyfckyT1A/eepbm6b7wGeKrr7+CauTxDxRYANq7Y8I3GDwj5oHEBl 2JNtOqdPKpPBGvpdEXOcWTZeitRNMRHJRWHiIWWCT7U3vACefHKcexNmgAL9Rf6VaXUU 0tKKoVVOMCiSkIh4WTkvvod0+hhQiQZ6MuZJ6xpXnrgUIRQ0yh5b3kuRPjMr57vNJJ+e Yh8loz81T0v/YOWJGTmpngteEJK8GsYyTLgttAZLNq1giOilIQwH8u8S60OFqvSDGAoI f6pA== 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=Nk7EV8qONapDcMrz48oPwtLT8Zin9+cq+j0iMab0m4A=; b=kdWeDjCrqB2aQZJB7TSm2qbinyMDT67KLfxg6B8j6DdCxVZbJb5iNa9qNgyvbUlruh Kd+Ql/+VO7F41nh0glF9YMjOyH4ZTXOqzO3Y+5Xma+otX3Eq8WeII3eVkjGWpouneC7K 7M+709/jfL60y8zNTI5YHi0PlQ3ecJRDSbv4kk3xss1yC2l5pC3AhsKGMhvgCtoGLm6X RpdwVx1pnDo2XAE73OZHKHK/dqd1BsyuLopgVOYtvBPzJOyCuJ1JS4fB5SVXeWju6Ht8 OUuSDN12+NYBXxu4/tG4/omCZ8phM1/VTx+LoDQUmm4nOhmDDdYgU1Z1sAKvJW+NIRHm Cdvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cloud.ionos.com header.s=google header.b=Jp65FI7L; 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 t27si7216425edt.100.2020.04.26.14.51.43; Sun, 26 Apr 2020 14:52:06 -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=Jp65FI7L; 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 S1726420AbgDZVt4 (ORCPT + 99 others); Sun, 26 Apr 2020 17:49:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726369AbgDZVtw (ORCPT ); Sun, 26 Apr 2020 17:49:52 -0400 Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E260CC061A10 for ; Sun, 26 Apr 2020 14:49:51 -0700 (PDT) Received: by mail-ej1-x644.google.com with SMTP id pg17so12450496ejb.9 for ; Sun, 26 Apr 2020 14:49:51 -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=Nk7EV8qONapDcMrz48oPwtLT8Zin9+cq+j0iMab0m4A=; b=Jp65FI7Lo+Cn8/FOgWCuXZHNnKbn3DioxWHStDkNrmH2gVOtVcURqIHsod5j6u5BLR /bzkNSBHvR65E7Cc8qY4fKAkGe64M3OAQyMWt4e89dAlgVvLImCOAq02qBwmXSn+VHvK T3Ei+CxAHR2A+azyaRyZCEtKDP0LyhjtDBp4T4MPxOCW8FBvLTK1mMFO06vPCAhZC/UZ 4Y365TApm81j5lGrkPGBW0G54qzQUXcDXG2jNf7vIprZiYAlXUdj7DbHP0JH2jfk4bsF p7Jkpb1gKLj0A7hYSunF2Dox+xkU5KikPl1Pl0jESVe7A/kkxilmSAif+MqAH2hA6/up oM+w== 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=Nk7EV8qONapDcMrz48oPwtLT8Zin9+cq+j0iMab0m4A=; b=kDJcjl26REnKpsl5tUr2AMGG32mNwKCMxy74nZb02BMFfOKOK+0UIQaQLes00MdutR OFajnVASbgyf/PDstVRi/2x5T6WNQl6jV2eZwH4jH/0bsbdraTZ0iItRgrQstIC8gAyE zDiKkEo+xAmdSM8bCNUdAElC0i7LlSK9Jw8KGmuxAh2MOtdrqXVzZ851a84YsErH50e9 s8zABPFtlph6B+cA30JbTFrAkZQMOuCD1EJCDGMGfxors9H+LlVAprXgYoaXEmyan6ko RtLL8tF7yZi4jAApfJNky2yLzbju78Y0PwIgDPXWmS9Bm/d87SElG8IOnlVvRwScw9AC Bwrw== X-Gm-Message-State: AGi0PubvbkUEDXuRFNemy4aGS05VsbBDwEKi1vxTSlfswuGkSBdw+Bir 6hOWEP0hNVvFU5l0pvlZRY4QcA== X-Received: by 2002:a17:906:6b05:: with SMTP id q5mr16557099ejr.329.1587937790675; Sun, 26 Apr 2020 14:49:50 -0700 (PDT) Received: from ls00508.pb.local ([2001:1438:4010:2540:fab1:56ff:feab:56b1]) by smtp.gmail.com with ESMTPSA id ce18sm2270108ejb.61.2020.04.26.14.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Apr 2020 14:49:50 -0700 (PDT) From: Guoqing Jiang To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: hch@infradead.org, david@fromorbit.com, willy@infradead.org, Guoqing Jiang , Alexander Viro Subject: [RFC PATCH 4/9] fs/buffer.c: use set/clear_fs_page_private Date: Sun, 26 Apr 2020 23:49:20 +0200 Message-Id: <20200426214925.10970-5-guoqing.jiang@cloud.ionos.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200426214925.10970-1-guoqing.jiang@cloud.ionos.com> References: <20200426214925.10970-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 Since the new pair function is introduced, we can call them to clean the code in buffer.c. Cc: Alexander Viro Signed-off-by: Guoqing Jiang --- fs/buffer.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/fs/buffer.c b/fs/buffer.c index a60f60396cfa..1d9b32e77c2b 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -123,14 +123,6 @@ void __wait_on_buffer(struct buffer_head * bh) } EXPORT_SYMBOL(__wait_on_buffer); -static void -__clear_page_buffers(struct page *page) -{ - ClearPagePrivate(page); - set_page_private(page, 0); - put_page(page); -} - static void buffer_io_error(struct buffer_head *bh, char *msg) { if (!test_bit(BH_Quiet, &bh->b_state)) @@ -906,7 +898,7 @@ link_dev_buffers(struct page *page, struct buffer_head *head) bh = bh->b_this_page; } while (bh); tail->b_this_page = head; - attach_page_buffers(page, head); + set_fs_page_private(page, head); } static sector_t blkdev_max_block(struct block_device *bdev, unsigned int size) @@ -1580,7 +1572,7 @@ void create_empty_buffers(struct page *page, bh = bh->b_this_page; } while (bh != head); } - attach_page_buffers(page, head); + set_fs_page_private(page, head); spin_unlock(&page->mapping->private_lock); } EXPORT_SYMBOL(create_empty_buffers); @@ -2567,7 +2559,7 @@ static void attach_nobh_buffers(struct page *page, struct buffer_head *head) bh->b_this_page = head; bh = bh->b_this_page; } while (bh != head); - attach_page_buffers(page, head); + set_fs_page_private(page, head); spin_unlock(&page->mapping->private_lock); } @@ -3227,7 +3219,7 @@ drop_buffers(struct page *page, struct buffer_head **buffers_to_free) bh = next; } while (bh != head); *buffers_to_free = head; - __clear_page_buffers(page); + clear_fs_page_private(page); return 1; failed: return 0; -- 2.17.1