All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Sterba <dsterba@suse.com>
To: linux-btrfs@vger.kernel.org
Cc: David Sterba <dsterba@suse.com>
Subject: [PATCH 5/6] btrfs: compression: drop kmap/kunmap from generic helpers
Date: Thu,  8 Jul 2021 13:45:17 +0200	[thread overview]
Message-ID: <f74ceb3249fae88ebe6bc0d288e56bde292ef885.1625043706.git.dsterba@suse.com> (raw)
In-Reply-To: <cover.1625043706.git.dsterba@suse.com>

The pages in compressed_pages are not from highmem anymore so we can
drop the mapping for checksum calculation and inline extent.

Signed-off-by: David Sterba <dsterba@suse.com>
---
 fs/btrfs/compression.c | 3 +--
 fs/btrfs/inode.c       | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/btrfs/compression.c b/fs/btrfs/compression.c
index 8cf5903a5be2..d40c2c878c83 100644
--- a/fs/btrfs/compression.c
+++ b/fs/btrfs/compression.c
@@ -172,10 +172,9 @@ static int check_compressed_csum(struct btrfs_inode *inode, struct bio *bio,
 		/* Hash through the page sector by sector */
 		for (pg_offset = 0; pg_offset < bytes_left;
 		     pg_offset += sectorsize) {
-			kaddr = kmap_atomic(page);
+			kaddr = page_address(page);
 			crypto_shash_digest(shash, kaddr + pg_offset,
 					    sectorsize, csum);
-			kunmap_atomic(kaddr);
 
 			if (memcmp(&csum, cb_sum, csum_size) != 0) {
 				btrfs_print_data_csum_error(inode, disk_start,
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index e6eb20987351..6993f0ffa9f2 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -286,9 +286,8 @@ static int insert_inline_extent(struct btrfs_trans_handle *trans,
 			cur_size = min_t(unsigned long, compressed_size,
 				       PAGE_SIZE);
 
-			kaddr = kmap_atomic(cpage);
+			kaddr = page_address(cpage);
 			write_extent_buffer(leaf, kaddr, ptr, cur_size);
-			kunmap_atomic(kaddr);
 
 			i++;
 			ptr += cur_size;
-- 
2.31.1


  parent reply	other threads:[~2021-07-08 11:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-08 11:45 [PATCH 0/6] Remove highmem allocations, kmap/kunmap David Sterba
2021-07-08 11:45 ` [PATCH 1/6] btrfs: drop from __GFP_HIGHMEM all allocations David Sterba
2021-07-08 11:45 ` [PATCH 2/6] btrfs: compression: drop kmap/kunmap from lzo David Sterba
2021-07-08 11:45 ` [PATCH 3/6] btrfs: compression: drop kmap/kunmap from zlib David Sterba
2021-07-08 11:45 ` [PATCH 4/6] btrfs: compression: drop kmap/kunmap from zstd David Sterba
2021-07-08 11:45 ` David Sterba [this message]
2021-07-08 11:45 ` [PATCH 6/6] btrfs: check-integrity: drop kmap/kunmap for block pages David Sterba
2021-07-08 12:45 ` [PATCH 0/6] Remove highmem allocations, kmap/kunmap Neal Gompa
2021-07-08 12:49   ` David Sterba
2021-07-08 22:24     ` Neal Gompa
2021-07-08 23:53   ` Qu Wenruo
2021-07-09  6:46     ` Christoph Hellwig
2021-07-09  7:12       ` Qu Wenruo
2021-07-09 12:15         ` Neal Gompa
2021-07-10  9:50           ` Qu Wenruo
2021-07-10 11:15             ` Christoph Hellwig
2021-07-10 11:37               ` Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f74ceb3249fae88ebe6bc0d288e56bde292ef885.1625043706.git.dsterba@suse.com \
    --to=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.