From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7257EC6FA96 for ; Thu, 1 Sep 2022 22:03:09 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1oTsHE-0000QX-Rh; Thu, 01 Sep 2022 22:03:08 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1oTsHC-0000Py-Vv for linux-f2fs-devel@lists.sourceforge.net; Thu, 01 Sep 2022 22:03:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=STxbhiL9IoQUx8Fgwja3LTFavGfQLVFycqxgyDfQIlo=; b=mkZo1Ci8oRsYkuhv25spBPvrQ9 kWxokz1FyPAbHG0mVHJzgz83ERZNDbQLcsLd9p88V8qr7M+DVZ4YDlKngvSWX2VGp9btTUteX2jWS VVZ5za5xmwpEQNIp7dIw+sdrgcXNn91eW1IVw5fczFbdrpNHTxtxztL2SwOTxty2wfuM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=STxbhiL9IoQUx8Fgwja3LTFavGfQLVFycqxgyDfQIlo=; b=LcaVd4Yf1rlF0dr0ywXqBR1vbn HChGHNbQXqCXAdFxZrIbnZqmToNSK8WGcKd/KIOgMsJhZ2dcJsHGCtzQmzMwGY6uLsUQS9G8D8m6k GOSmw4hOigZNUQfDWOc5IcYWXhJoYWt/Jui4YP/GsuE9aGhZDxaMt+mIO7CKO646gSfw=; Received: from mail-pl1-f176.google.com ([209.85.214.176]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1oTsHC-0007xG-4E for linux-f2fs-devel@lists.sourceforge.net; Thu, 01 Sep 2022 22:03:06 +0000 Received: by mail-pl1-f176.google.com with SMTP id c2so114754plo.3 for ; Thu, 01 Sep 2022 15:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=STxbhiL9IoQUx8Fgwja3LTFavGfQLVFycqxgyDfQIlo=; b=mGc2AoTR/eShDxn1bEGmqvAylW19QjNRk+3TcxKgV4984n2y3D5OuujULmMIC93l/e 994+ww4T76o6BwzB7Dyfg1FF5LjMDxODXBmaL6NBji3traBoNonz2I7oQAmlcfxNHVOA JLdLJqIa03W2Qrsk2PIvMnMysU/ngcbLVN/BRQBiNvcP54q0fdpfZuno15/BTBEyV9zg LqeO6y2P9pncUMeumeGyzoYeeCTEq6ojO8ZrLkKxcxzK4cx52ZP/vQb7lv19FhPcRb0w pXJidnaUHcjIUUhd88lBjjlm5xn6XbNJLDk41pSKS73ei7RFGp2h8pKrtvCI0OhjWSf8 m3FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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; bh=STxbhiL9IoQUx8Fgwja3LTFavGfQLVFycqxgyDfQIlo=; b=kgBlt7xxw6JdWo/qnjr1KPs7MRyWMP2+kMWBJtFIFqUOVwTFAWgVRs28nTuxNI4fAh bniw6dbx6ky4kH3UuAJdquL+wt3eCnL/MGl8ujEPle1xSJ66EqJJUOW4nPfyIFjHcUgf 969sP7T4grrTz1wOHpnbkVjcATTc178o59+Io/tJNr94JeO4prT5g7SV/k1rdQeLN53x UEYSGMkZNUGOv4nchTrFEkpFuX5v8Q33+Gzqi9IXLBuQQdAo0FSMXeaYnTnwiwKZSnB2 YLDpkk9DwWJgInXZJ9Lq+a0e++spm7Zz/xciCdkf9ZO0kAR9i7vT6iHk1IfnwaFN3rgV V7sw== X-Gm-Message-State: ACgBeo3ki6AiGhJGEsBH09wfAz6mIjkqEPpmte7DQHCKvInbli5U6VY+ aEaqb0XkVzAFDVsDE4hnQFU= X-Google-Smtp-Source: AA6agR5hhXeukBftcpo4uj8qt2S1ZJNE07BNY5BMKr4j8Hs713UO7OgYoXkgvfwPLmscDaOkJk3Q/A== X-Received: by 2002:a17:90b:212:b0:1fd:e61b:866a with SMTP id fy18-20020a17090b021200b001fde61b866amr1263582pjb.141.1662069780541; Thu, 01 Sep 2022 15:03:00 -0700 (PDT) Received: from vmfolio.. (c-73-189-111-8.hsd1.ca.comcast.net. [73.189.111.8]) by smtp.googlemail.com with ESMTPSA id fv4-20020a17090b0e8400b001fb350026f1sm128894pjb.4.2022.09.01.15.02.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Sep 2022 15:03:00 -0700 (PDT) From: "Vishal Moola (Oracle)" To: linux-fsdevel@vger.kernel.org Date: Thu, 1 Sep 2022 15:01:33 -0700 Message-Id: <20220901220138.182896-19-vishal.moola@gmail.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220901220138.182896-1-vishal.moola@gmail.com> References: <20220901220138.182896-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Headers-End: 1oTsHC-0007xG-4E Subject: [f2fs-dev] [PATCH 18/23] nilfs2: Convert nilfs_lookup_dirty_data_buffers() to use filemap_get_folios_tag() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-cifs@vger.kernel.org, linux-nilfs@vger.kernel.org, "Vishal Moola \(Oracle\)" , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-mm@kvack.org, ceph-devel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-afs@lists.infradead.org, linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Convert function to use folios throughout. This is in preparation for the removal of find_get_pages_range_tag(). Signed-off-by: Vishal Moola (Oracle) --- fs/nilfs2/segment.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index 0afe0832c754..e95c667bdc8f 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c @@ -680,7 +680,7 @@ static size_t nilfs_lookup_dirty_data_buffers(struct inode *inode, loff_t start, loff_t end) { struct address_space *mapping = inode->i_mapping; - struct pagevec pvec; + struct folio_batch fbatch; pgoff_t index = 0, last = ULONG_MAX; size_t ndirties = 0; int i; @@ -694,23 +694,26 @@ static size_t nilfs_lookup_dirty_data_buffers(struct inode *inode, index = start >> PAGE_SHIFT; last = end >> PAGE_SHIFT; } - pagevec_init(&pvec); + folio_batch_init(&fbatch); repeat: if (unlikely(index > last) || - !pagevec_lookup_range_tag(&pvec, mapping, &index, last, - PAGECACHE_TAG_DIRTY)) + !filemap_get_folios_tag(mapping, &index, last, + PAGECACHE_TAG_DIRTY, &fbatch)) return ndirties; - for (i = 0; i < pagevec_count(&pvec); i++) { + for (i = 0; i < folio_batch_count(&fbatch); i++) { struct buffer_head *bh, *head; - struct page *page = pvec.pages[i]; + struct folio *folio = fbatch.folios[i]; - lock_page(page); - if (!page_has_buffers(page)) - create_empty_buffers(page, i_blocksize(inode), 0); - unlock_page(page); + head = folio_buffers(folio); + folio_lock(folio); + if (!head) { + create_empty_buffers(&folio->page, i_blocksize(inode), 0); + head = folio_buffers(folio); + } + folio_unlock(folio); - bh = head = page_buffers(page); + bh = head; do { if (!buffer_dirty(bh) || buffer_async_write(bh)) continue; @@ -718,13 +721,13 @@ static size_t nilfs_lookup_dirty_data_buffers(struct inode *inode, list_add_tail(&bh->b_assoc_buffers, listp); ndirties++; if (unlikely(ndirties >= nlimit)) { - pagevec_release(&pvec); + folio_batch_release(&fbatch); cond_resched(); return ndirties; } } while (bh = bh->b_this_page, bh != head); } - pagevec_release(&pvec); + folio_batch_release(&fbatch); cond_resched(); goto repeat; } -- 2.36.1 _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel