From patchwork Tue Nov 14 08:44:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryusuke Konishi X-Patchwork-Id: 164759 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1727401vqg; Tue, 14 Nov 2023 00:46:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IF58XNtDm9S1g84QQeC90Ipq/5fvd/Lr+EGAmOp81brXLHBycayaGK5nAEjVpWaBnIW4vQ5 X-Received: by 2002:a17:903:130f:b0:1cc:5dd4:7cf8 with SMTP id iy15-20020a170903130f00b001cc5dd47cf8mr1445369plb.27.1699951604008; Tue, 14 Nov 2023 00:46:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699951603; cv=none; d=google.com; s=arc-20160816; b=Tfg2ZOec2HY3Qm6xFpFG+915wSPbwJZTfOdPZMZ8nMMOmZvOTm+//VZRBjy2I2Gb2t DnBOcPWw8r6TnJ7sIl/Z898au6NOkM8bjKuUhjXuOsCEtcOreigSnZvNcf98FuCMTgXO /YsNrgbFO8frgjAtLfboY3NvDOfXR9NH0R9/WoJDVi9dbb2YFI39NqAqRTnp7eIk9nzQ f6E34mLScdvsOMKUcu1A4udwLiYS1aDMPupYkbCiS7CWO6++G/uc9+pMF/QVQnMRgdZA Ol/JCJ16eKwrsM3MZcrjkDlP2DQIdStR4jg3Q/0O3+gxF9K35a6tysxwRfsFW0N63hLb VKQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qsODlSSSo65NAC+DA2frAnS4pga3MJdWGA/tkcnA7Uo=; fh=c4gLbwT9pvttlQWxFI2VesWIZ95B4IQ3bBh75IOono4=; b=XYX0j/N6dPQ3wz13U/FYBt7UFvpYscISjqvUGxsT7NQ2aTBznyRV2XpR7Tq5zkjftb /ae59nF4UD0WhJ8kTeUTaAd4CkH9t9D+SjRg+YhEsbRBI/WvdM5TKBdTotGuDOk6BzLH v37XBQ29y7or+ZV9+T4liVaTFAhvM4G/vyz47bznWeM+GK/KiQxb+k+8qZoKfpmP8AqA cmR2nvNAz8lAZl6exT4Ubv7jew1B5W/AVmH+CorKkVlVgJI/kP15D9J/CmVbV3m1LAkt erHFk8nkdoufXf7bUVpDU6WYh2KvgLUElDer0EFX3DieTl6Lj6Zqe4dnGfDiAW1jvUcR WG5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Me6WJPKI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id p7-20020a1709026b8700b001b9c1821f6bsi7284082plk.98.2023.11.14.00.46.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 00:46:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Me6WJPKI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id AE2718041950; Tue, 14 Nov 2023 00:46:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232168AbjKNIqA (ORCPT + 30 others); Tue, 14 Nov 2023 03:46:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232416AbjKNIpq (ORCPT ); Tue, 14 Nov 2023 03:45:46 -0500 Received: from mail-oo1-xc2a.google.com (mail-oo1-xc2a.google.com [IPv6:2607:f8b0:4864:20::c2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADDA51AD; Tue, 14 Nov 2023 00:45:42 -0800 (PST) Received: by mail-oo1-xc2a.google.com with SMTP id 006d021491bc7-586ba7cdb6bso3058720eaf.2; Tue, 14 Nov 2023 00:45:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1699951542; x=1700556342; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=qsODlSSSo65NAC+DA2frAnS4pga3MJdWGA/tkcnA7Uo=; b=Me6WJPKINwOlt8beNUWkrP143YEOT2s90A06OXfnOz/0SiJ7mpaYcG9bB2Z+BQYM5e BLW5t0G5ebOJVk/AAB6wz61EhTHTRcetUfbKVskaLdX7l8EgvzkW4xCuLyMzTTEd9KvZ tf7oWX5tjLVizRPSIqkTNS2iqtmzn+zXLk6gL7v/znjWcaozUt/S1XlzIbFhMOrJsB9H 5bW54ABbl17/xk/7K4UDWL7I34Alnd+zPRqfLxpxjGKontZMXGc9N9Gc0qCK/qtKaxWr IHtHBPjYP+AB61eReG5PJ/VVxnrSg58Th731gyGnT2rPjbSZVUuJbdHw2AcavjV3MaEx YNOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699951542; x=1700556342; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qsODlSSSo65NAC+DA2frAnS4pga3MJdWGA/tkcnA7Uo=; b=bvX+B+Cp7v+vYFy0qj2XdVH8pHWerQRJzp1oOj7JZhjrspl34paMeaCk/hoC79WQpA h0oll3fkyqKFLJZE9yL/oxfH9pTbqlio5d6p6riU68psmJQHYw+1CB1JtA+g1PazX41l aBKeEq6CRhPnVpZKMY2BEgiHKVLbi6c+bRt+W3EjPta6Ae8v7Sq/bjI/53PmfIsLFOFg wZN+7ToolpNYo2uqcjTWgMYMrTd2zJwR/3UpEuNbO38FVb8uFtw74XEacv5b+PgyuCt/ lHmNHoqzet3McEdv7kZYwoV1IfcPg0w31PPTYqFQgY0I1zdiqnIRSCD6HHI6XeDaPoYl 8nLA== X-Gm-Message-State: AOJu0Yzh7IcoCN57CQIij5I2LB5XaKe4onwg1f6l6kiJJ/3DAo0BEAao t9kvUpdKbKsqfJxOkE/enM1vhMghtp8= X-Received: by 2002:a05:6871:5d2:b0:1e9:af81:54b6 with SMTP id v18-20020a05687105d200b001e9af8154b6mr12509563oan.55.1699951541863; Tue, 14 Nov 2023 00:45:41 -0800 (PST) Received: from carrot.. (i223-218-133-131.s42.a014.ap.plala.or.jp. [223.218.133.131]) by smtp.gmail.com with ESMTPSA id u17-20020a056a00159100b006c4d2479c1asm748083pfk.219.2023.11.14.00.45.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 00:45:41 -0800 (PST) From: Ryusuke Konishi To: Andrew Morton Cc: linux-nilfs@vger.kernel.org, Matthew Wilcox , linux-kernel@vger.kernel.org Subject: [PATCH 05/20] nilfs2: Convert to nilfs_folio_buffers_clean() Date: Tue, 14 Nov 2023 17:44:21 +0900 Message-Id: <20231114084436.2755-6-konishi.ryusuke@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231114084436.2755-1-konishi.ryusuke@gmail.com> References: <20231114084436.2755-1-konishi.ryusuke@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 14 Nov 2023 00:46:34 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782528452988773817 X-GMAIL-MSGID: 1782528452988773817 From: "Matthew Wilcox (Oracle)" All callers of nilfs_page_buffers_clean() now have a folio, so convert it to take a folio. While I'm at it, make it return a bool. Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Ryusuke Konishi --- fs/nilfs2/page.c | 18 +++++++++--------- fs/nilfs2/page.h | 2 +- fs/nilfs2/segment.c | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c index 3882acde1b3e..29799a49c234 100644 --- a/fs/nilfs2/page.c +++ b/fs/nilfs2/page.c @@ -81,7 +81,7 @@ void nilfs_forget_buffer(struct buffer_head *bh) lock_buffer(bh); set_mask_bits(&bh->b_state, clear_bits, 0); - if (nilfs_page_buffers_clean(&folio->page)) + if (nilfs_folio_buffers_clean(folio)) __nilfs_clear_page_dirty(&folio->page); bh->b_blocknr = -1; @@ -131,23 +131,23 @@ void nilfs_copy_buffer(struct buffer_head *dbh, struct buffer_head *sbh) } /** - * nilfs_page_buffers_clean - check if a page has dirty buffers or not. - * @page: page to be checked + * nilfs_folio_buffers_clean - Check if a folio has dirty buffers or not. + * @folio: Folio to be checked. * - * nilfs_page_buffers_clean() returns zero if the page has dirty buffers. - * Otherwise, it returns non-zero value. + * nilfs_folio_buffers_clean() returns false if the folio has dirty buffers. + * Otherwise, it returns true. */ -int nilfs_page_buffers_clean(struct page *page) +bool nilfs_folio_buffers_clean(struct folio *folio) { struct buffer_head *bh, *head; - bh = head = page_buffers(page); + bh = head = folio_buffers(folio); do { if (buffer_dirty(bh)) - return 0; + return false; bh = bh->b_this_page; } while (bh != head); - return 1; + return true; } void nilfs_page_bug(struct page *page) diff --git a/fs/nilfs2/page.h b/fs/nilfs2/page.h index d249ea1cefff..a8ab800e689c 100644 --- a/fs/nilfs2/page.h +++ b/fs/nilfs2/page.h @@ -36,7 +36,7 @@ struct buffer_head *nilfs_grab_buffer(struct inode *, struct address_space *, unsigned long, unsigned long); void nilfs_forget_buffer(struct buffer_head *); void nilfs_copy_buffer(struct buffer_head *, struct buffer_head *); -int nilfs_page_buffers_clean(struct page *); +bool nilfs_folio_buffers_clean(struct folio *); void nilfs_page_bug(struct page *); int nilfs_copy_dirty_pages(struct address_space *, struct address_space *); diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 2a058aad5c2d..888b8606a1e8 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -1759,7 +1759,7 @@ static void nilfs_end_folio_io(struct folio *folio, int err) * all the buffers get cleaned later. */ folio_lock(folio); - if (nilfs_page_buffers_clean(&folio->page)) + if (nilfs_folio_buffers_clean(folio)) __nilfs_clear_page_dirty(&folio->page); folio_unlock(folio); } @@ -1767,7 +1767,7 @@ static void nilfs_end_folio_io(struct folio *folio, int err) } if (!err) { - if (!nilfs_page_buffers_clean(&folio->page)) + if (!nilfs_folio_buffers_clean(folio)) filemap_dirty_folio(folio->mapping, folio); folio_clear_error(folio); } else {