From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Subject: [PATCH 11/11] f2fs: use kmap_atomic instead of kmap
Date: Sun, 19 Oct 2014 22:19:39 -0700 [thread overview]
Message-ID: <1413782379-11758-11-git-send-email-jaegeuk@kernel.org> (raw)
In-Reply-To: <1413782379-11758-1-git-send-email-jaegeuk@kernel.org>
For better performance, we need to use kmap_atomic instead of kmap.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/inline.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
diff --git a/fs/f2fs/inline.c b/fs/f2fs/inline.c
index 825995f..c03653d 100644
--- a/fs/f2fs/inline.c
+++ b/fs/f2fs/inline.c
@@ -55,11 +55,10 @@ int f2fs_read_inline_data(struct inode *inode, struct page *page)
/* Copy the whole inline data block */
src_addr = inline_data_addr(ipage);
- dst_addr = kmap(page);
+ dst_addr = kmap_atomic(page);
memcpy(dst_addr, src_addr, MAX_INLINE_DATA);
- kunmap(page);
+ kunmap_atomic(dst_addr);
f2fs_put_page(ipage, 1);
-
out:
SetPageUptodate(page);
unlock_page(page);
@@ -105,9 +104,9 @@ static int __f2fs_convert_inline_data(struct inode *inode, struct page *page)
/* Copy the whole inline data block */
src_addr = inline_data_addr(ipage);
- dst_addr = kmap(page);
+ dst_addr = kmap_atomic(page);
memcpy(dst_addr, src_addr, MAX_INLINE_DATA);
- kunmap(page);
+ kunmap_atomic(dst_addr);
SetPageUptodate(page);
/* write data page to try to make data consistent */
@@ -177,10 +176,10 @@ int f2fs_write_inline_data(struct inode *inode,
f2fs_wait_on_page_writeback(ipage, NODE);
zero_user_segment(ipage, INLINE_DATA_OFFSET,
INLINE_DATA_OFFSET + MAX_INLINE_DATA);
- src_addr = kmap(page);
+ src_addr = kmap_atomic(page);
dst_addr = inline_data_addr(ipage);
memcpy(dst_addr, src_addr, size);
- kunmap(page);
+ kunmap_atomic(src_addr);
set_inode_flag(F2FS_I(inode), FI_APPEND_WRITE);
sync_inode_page(&dn);
@@ -351,7 +350,7 @@ int f2fs_convert_inline_dir(struct inode *dir, struct page *ipage,
f2fs_wait_on_page_writeback(page, DATA);
zero_user_segment(page, 0, PAGE_CACHE_SIZE);
- dentry_blk = kmap(page);
+ dentry_blk = kmap_atomic(page);
/* copy data from inline dentry block to new dentry block */
memcpy(dentry_blk->dentry_bitmap, inline_dentry->dentry_bitmap,
@@ -363,7 +362,7 @@ int f2fs_convert_inline_dir(struct inode *dir, struct page *ipage,
memcpy(dentry_blk->filename, inline_dentry->filename,
NR_INLINE_DENTRY * F2FS_SLOT_LEN);
- kunmap(page);
+ kunmap_atomic(dentry_blk);
SetPageUptodate(page);
set_page_dirty(page);
--
2.1.1
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
prev parent reply other threads:[~2014-10-20 5:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 5:19 [PATCH 01/11] f2fs: reuse room_for_filename for inline dentry operation Jaegeuk Kim
2014-10-20 5:19 ` [PATCH 02/11] f2fs: reuse find_in_block code for find_in_inline_dir Jaegeuk Kim
2014-10-20 5:19 ` [PATCH 03/11] f2fs: fix to wait correct block type Jaegeuk Kim
2014-10-20 5:19 ` [PATCH 04/11] f2fs: avoid deadlock on init_inode_metadata Jaegeuk Kim
2014-10-20 5:19 ` [PATCH 05/11] f2fs: add stat info for inline_dentry inodes Jaegeuk Kim
2014-10-20 5:19 ` [PATCH 06/11] f2fs: fix counting inline_data inode numbers Jaegeuk Kim
2014-10-20 5:19 ` [PATCH 07/11] f2fs: reuse core function in f2fs_readdir for inline_dentry Jaegeuk Kim
2014-10-20 5:19 ` [PATCH 08/11] f2fs: should not truncate any inline_dentry Jaegeuk Kim
2014-10-20 5:19 ` [PATCH 09/11] f2fs: introduce f2fs_dentry_ptr structure for code clean-up Jaegeuk Kim
2014-10-20 5:19 ` [PATCH 10/11] f2fs: reuse make_empty_dir code for inline_dentry Jaegeuk Kim
2014-10-20 5:19 ` Jaegeuk Kim [this message]
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=1413782379-11758-11-git-send-email-jaegeuk@kernel.org \
--to=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@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).