From patchwork Mon Mar 18 12:14:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 13595322 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64097381AD for ; Mon, 18 Mar 2024 12:15:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710764100; cv=none; b=VSIxrr6SeZSNi60bzAzQL5UaopLobRwkidQ1oj0QHZD0D1y+aUhrZooTTeaE0IQ4cCYBGYe3mpbuV/Z+zDoIdlrjdWREsjqJqyaTNW8s0d0uLAehIXO/sZgx96TjvkYAhdenqYLfaeO7SjO4b7mbstvQX9Y7lnrVlTijxrJfXJ4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710764100; c=relaxed/simple; bh=8c8N/KTDaDcOwuW3ZEUwlOBPq8LmVmRZFJTVFUi2p3c=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZFGiRiQhMmif1F9vmttPwciKszCthxzz0Bywy3x/tez2H96iRJGunGHqCEFFz61JdbqeRakTqv1d6HO5IxUG2vdlnwenW/l5fXGsmj0sp3Xs15MeH/hDKCwDWI3egC35bQ2RgWGpvrK956s/0QjOrTi6PsT6i75WL42FB3rGj2M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XVuRoxaY; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XVuRoxaY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2A3EC433F1 for ; Mon, 18 Mar 2024 12:14:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710764100; bh=8c8N/KTDaDcOwuW3ZEUwlOBPq8LmVmRZFJTVFUi2p3c=; h=From:To:Subject:Date:In-Reply-To:References:From; b=XVuRoxaYf1jIUOGf+8Gh+TnBjegEMaLzQ8ABMyYNdSQ5UlSGfkoQR5s/me0bn8FKP tgRgq/pkNJEDbEyCRcJBQqB7TG88kLfb7JHybsUbu3txM7ka57m47EpJ1EyvlXoEpJ 2Ey5B09H+rYa4e/fZfo7dmOdoRSDozkHNuzEBcweh5HsoM78CG32ZgYtf1QZfEqb28 BHCRY+4c22IIVnENSAob7Z2laYgkZKub9PbkTK7JQNkL7nAUr1LOfRvPWAdJVLqrZL EBLllkZs/doSmTlIWfdBgwx/o9pHIFvMEG4WyHRVQ9sNyoFgWVAT8DEcKETFkOgA57 dY3V5+ByQDhHg== From: fdmanana@kernel.org To: linux-btrfs@vger.kernel.org Subject: [PATCH 1/2] btrfs: remove pointless readahead callback wrapper Date: Mon, 18 Mar 2024 12:14:55 +0000 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Filipe Manana There's no point in having a static readahead callback in inode.c that does nothing besides calling extent_readahead() from extent_io.c. So just remove the callback at inode.c and rename extent_readahead() to btrfs_readahead(). Signed-off-by: Filipe Manana --- fs/btrfs/extent_io.c | 2 +- fs/btrfs/extent_io.h | 2 +- fs/btrfs/inode.c | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 7441245b1ceb..47a299b0fa2d 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2277,7 +2277,7 @@ int extent_writepages(struct address_space *mapping, return ret; } -void extent_readahead(struct readahead_control *rac) +void btrfs_readahead(struct readahead_control *rac) { struct btrfs_bio_ctrl bio_ctrl = { .opf = REQ_OP_READ | REQ_RAHEAD }; struct page *pagepool[16]; diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index e3530d427e1f..eb123b0499e1 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -241,7 +241,7 @@ int extent_writepages(struct address_space *mapping, struct writeback_control *wbc); int btree_write_cache_pages(struct address_space *mapping, struct writeback_control *wbc); -void extent_readahead(struct readahead_control *rac); +void btrfs_readahead(struct readahead_control *rac); int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, u64 start, u64 len); int set_folio_extent_mapped(struct folio *folio); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 37701531eeb1..e447a4f1d926 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7919,11 +7919,6 @@ static int btrfs_writepages(struct address_space *mapping, return extent_writepages(mapping, wbc); } -static void btrfs_readahead(struct readahead_control *rac) -{ - extent_readahead(rac); -} - /* * For release_folio() and invalidate_folio() we have a race window where * folio_end_writeback() is called but the subpage spinlock is not yet released. From patchwork Mon Mar 18 12:14:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Filipe Manana X-Patchwork-Id: 13595323 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 56626381CD for ; Mon, 18 Mar 2024 12:15:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710764101; cv=none; b=g/GV9PUYCNy6CaXdyTRov20CtdbOWoirRI0EDXsSZmTZPcamPoIajPytf7+jhxWEakkSf/8I3VK2rKh2znrare/OmozdaD20+L8NJuIFElrqDBCFsWtBQ3L7CIZJLp4RrRkN1XCSp/tNEBExJ/dnHaODdb0QGj4uL/gHQDsVf7M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710764101; c=relaxed/simple; bh=RH71WcPEamHSx6e7r6FxnRbbIvtTCwEcEhYWJBznk1s=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JySVzAdxL8l1UJBnEaQLKmvQKETvRWhbUegLq/5QL7UrJmGFRjy6AQyIFSxgECDcfq/wEYmFGlJzgI4nZ058H+EQOdakeSJv1drFLD2hJB8o457lIKVy3MYSSE/82SipifcYIH7hLxI5Olgh3CSPqJP+jWP0DJYiu0cgcZAWvhQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y1/grPR0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y1/grPR0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A555BC433C7 for ; Mon, 18 Mar 2024 12:15:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710764101; bh=RH71WcPEamHSx6e7r6FxnRbbIvtTCwEcEhYWJBznk1s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Y1/grPR0QaZlpymefpUCxB3rEZKoWiQ16im7cjwiAQjFHGF4z95lr4SD7vqGBcFm6 6bXP4F8+VdD6xbi4fhDx406FlcYeJfpbYyPAkVLAsEQVX+f0f8Kv5Rt5f4RmZPKg5a BfZOGWNfg1rwncRS0/Jh5TPz1ryXf6MhcbESFLgm88tVR/+ROoO3hO97R8g/rf+twU N1NrfAhq0zFzck/ZHaP9C2bsUXyPgFi5cM7Y7L+LIe6RsXnOYeMJnI0lJC+9tSp4KM bcaPe6xRBSYbrDycW3Z6FulM2LVUldig7mS+xoEbpHDuyMQks0OtdJryMoWNxpE3Lt iZVQIGKeE1Gpg== From: fdmanana@kernel.org To: linux-btrfs@vger.kernel.org Subject: [PATCH 2/2] btrfs: remove pointless writepages callback wrapper Date: Mon, 18 Mar 2024 12:14:56 +0000 Message-Id: <12ee7ad204aa7f76ca28df5d6eb2f0dcdc85ce64.1710763611.git.fdmanana@suse.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-btrfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Filipe Manana There's no point in having a static writepages callback in inode.c that does nothing besides calling extent_writepages from extent_io.c. So just remove the callback at inode.c and rename extent_writepages() to btrfs_writepages(). Signed-off-by: Filipe Manana --- fs/btrfs/extent_io.c | 3 +-- fs/btrfs/extent_io.h | 3 +-- fs/btrfs/inode.c | 6 ------ 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c index 47a299b0fa2d..4a684251fd96 100644 --- a/fs/btrfs/extent_io.c +++ b/fs/btrfs/extent_io.c @@ -2256,8 +2256,7 @@ void extent_write_locked_range(struct inode *inode, struct page *locked_page, submit_write_bio(&bio_ctrl, found_error ? ret : 0); } -int extent_writepages(struct address_space *mapping, - struct writeback_control *wbc) +int btrfs_writepages(struct address_space *mapping, struct writeback_control *wbc) { struct inode *inode = mapping->host; int ret = 0; diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h index eb123b0499e1..818431b37124 100644 --- a/fs/btrfs/extent_io.h +++ b/fs/btrfs/extent_io.h @@ -237,8 +237,7 @@ int btrfs_read_folio(struct file *file, struct folio *folio); void extent_write_locked_range(struct inode *inode, struct page *locked_page, u64 start, u64 end, struct writeback_control *wbc, bool pages_dirty); -int extent_writepages(struct address_space *mapping, - struct writeback_control *wbc); +int btrfs_writepages(struct address_space *mapping, struct writeback_control *wbc); int btree_write_cache_pages(struct address_space *mapping, struct writeback_control *wbc); void btrfs_readahead(struct readahead_control *rac); diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e447a4f1d926..1fd2ea80caef 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -7913,12 +7913,6 @@ static int btrfs_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, return ret; } -static int btrfs_writepages(struct address_space *mapping, - struct writeback_control *wbc) -{ - return extent_writepages(mapping, wbc); -} - /* * For release_folio() and invalidate_folio() we have a race window where * folio_end_writeback() is called but the subpage spinlock is not yet released.