summaryrefslogtreecommitdiffstats
path: root/fs/affs
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2022-07-12 23:30:05 +0200
committerDavid Sterba <dsterba@suse.com>2022-08-01 19:53:31 +0200
commit5abbb7b92820cf6ba9154a35cff6d64b62d7f273 (patch)
treef8a3cb1950ed9e855420ffbb31a7c59fe6849e13 /fs/affs
parent32346491ddf24599decca06190ebca03ff9de7f8 (diff)
downloadlinux-5abbb7b92820cf6ba9154a35cff6d64b62d7f273.tar.gz
linux-5abbb7b92820cf6ba9154a35cff6d64b62d7f273.tar.bz2
linux-5abbb7b92820cf6ba9154a35cff6d64b62d7f273.zip
affs: use memcpy_to_page and remove replace kmap_atomic()
The use of kmap() is being deprecated in favor of kmap_local_page() where it is feasible. For kmap around a memcpy there's a convenience helper memcpy_to_page that also makes the flush_dcache_page() redundant. CC: Fabio M. De Francesco <fmdefrancesco@gmail.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/affs')
-rw-r--r--fs/affs/file.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/fs/affs/file.c b/fs/affs/file.c
index cd00a4c68a12..cefa222f7881 100644
--- a/fs/affs/file.c
+++ b/fs/affs/file.c
@@ -526,7 +526,6 @@ affs_do_readpage_ofs(struct page *page, unsigned to, int create)
struct inode *inode = page->mapping->host;
struct super_block *sb = inode->i_sb;
struct buffer_head *bh;
- char *data;
unsigned pos = 0;
u32 bidx, boff, bsize;
u32 tmp;
@@ -545,15 +544,12 @@ affs_do_readpage_ofs(struct page *page, unsigned to, int create)
return PTR_ERR(bh);
tmp = min(bsize - boff, to - pos);
BUG_ON(pos + tmp > to || tmp > bsize);
- data = kmap_atomic(page);
- memcpy(data + pos, AFFS_DATA(bh) + boff, tmp);
- kunmap_atomic(data);
+ memcpy_to_page(page, pos, AFFS_DATA(bh) + boff, tmp);
affs_brelse(bh);
bidx++;
pos += tmp;
boff = 0;
}
- flush_dcache_page(page);
return 0;
}