Commit 5abbb7b9 authored by David Sterba's avatar David Sterba

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: default avatarIra Weiny <ira.weiny@intel.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 32346491
...@@ -526,7 +526,6 @@ affs_do_readpage_ofs(struct page *page, unsigned to, int create) ...@@ -526,7 +526,6 @@ affs_do_readpage_ofs(struct page *page, unsigned to, int create)
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
struct super_block *sb = inode->i_sb; struct super_block *sb = inode->i_sb;
struct buffer_head *bh; struct buffer_head *bh;
char *data;
unsigned pos = 0; unsigned pos = 0;
u32 bidx, boff, bsize; u32 bidx, boff, bsize;
u32 tmp; u32 tmp;
...@@ -545,15 +544,12 @@ affs_do_readpage_ofs(struct page *page, unsigned to, int create) ...@@ -545,15 +544,12 @@ affs_do_readpage_ofs(struct page *page, unsigned to, int create)
return PTR_ERR(bh); return PTR_ERR(bh);
tmp = min(bsize - boff, to - pos); tmp = min(bsize - boff, to - pos);
BUG_ON(pos + tmp > to || tmp > bsize); BUG_ON(pos + tmp > to || tmp > bsize);
data = kmap_atomic(page); memcpy_to_page(page, pos, AFFS_DATA(bh) + boff, tmp);
memcpy(data + pos, AFFS_DATA(bh) + boff, tmp);
kunmap_atomic(data);
affs_brelse(bh); affs_brelse(bh);
bidx++; bidx++;
pos += tmp; pos += tmp;
boff = 0; boff = 0;
} }
flush_dcache_page(page);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment