From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: Fabian Frederick <fabf@skynet.be>, Chris Mason <clm@fb.com>,
Josef Bacik <jbacik@fb.com>,
linux-btrfs@vger.kernel.org
Subject: [RFC 1/1 linux-next] btrfs: don't opencode zero_user_segment
Date: Tue, 14 Oct 2014 19:46:14 +0200 [thread overview]
Message-ID: <1413308774-9985-1-git-send-email-fabf@skynet.be> (raw)
use function defined in include/linux/highmem.h
Note that this reverts 2 last function call order
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
fs/btrfs/scrub.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index efa0831..fa063cd 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -1503,13 +1503,9 @@ static int scrub_write_page_to_dev_replace(struct scrub_block *sblock,
struct scrub_page *spage = sblock->pagev[page_num];
BUG_ON(spage->page == NULL);
- if (spage->io_error) {
- void *mapped_buffer = kmap_atomic(spage->page);
+ if (spage->io_error)
+ zero_user_segment(spage->page, 0, PAGE_CACHE_SIZE);
- memset(mapped_buffer, 0, PAGE_CACHE_SIZE);
- flush_dcache_page(spage->page);
- kunmap_atomic(mapped_buffer);
- }
return scrub_add_page_to_wr_bio(sblock->sctx, spage);
}
--
1.9.3
next reply other threads:[~2014-10-14 17:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-14 17:46 Fabian Frederick [this message]
2014-10-14 19:15 ` [RFC 1/1 linux-next] btrfs: don't opencode zero_user_segment Zach Brown
2014-10-14 20:18 ` Fabian Frederick
2014-10-15 17:08 ` Zach Brown
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=1413308774-9985-1-git-send-email-fabf@skynet.be \
--to=fabf@skynet.be \
--cc=clm@fb.com \
--cc=jbacik@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).