[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()
- To: Matthew Wilcox <willy@xxxxxxxxxxxxx>
- From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 13 Oct 2020 21:01:49 +0100
- Cc: Dan Williams <dan.j.williams@xxxxxxxxx>, "Weiny, Ira" <ira.weiny@xxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Nicolas Pitre <nico@xxxxxxxxxxx>, X86 ML <x86@xxxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, Fenghua Yu <fenghua.yu@xxxxxxxxx>, Linux Doc Mailing List <linux-doc@xxxxxxxxxxxxxxx>, Linux Kernel Mailing List <linux-kernel@xxxxxxxxxxxxxxx>, linux-nvdimm <linux-nvdimm@xxxxxxxxxxxx>, linux-fsdevel <linux-fsdevel@xxxxxxxxxxxxxxx>, Linux MM <linux-mm@xxxxxxxxx>, linux-kselftest@xxxxxxxxxxxxxxx, linuxppc-dev <linuxppc-dev@xxxxxxxxxxxxxxxx>, KVM list <kvm@xxxxxxxxxxxxxxx>, Netdev <netdev@xxxxxxxxxxxxxxx>, bpf@xxxxxxxxxxxxxxx, Kexec Mailing List <kexec@xxxxxxxxxxxxxxxxxxx>, linux-bcache@xxxxxxxxxxxxxxx, linux-mtd@xxxxxxxxxxxxxxxxxxx, devel@xxxxxxxxxxxxxxxxxxxx, linux-efi <linux-efi@xxxxxxxxxxxxxxx>, linux-mmc@xxxxxxxxxxxxxxx, linux-scsi <linux-scsi@xxxxxxxxxxxxxxx>, target-devel@xxxxxxxxxxxxxxx, linux-nfs@xxxxxxxxxxxxxxx, ceph-devel@xxxxxxxxxxxxxxx, linux-ext4 <linux-ext4@xxxxxxxxxxxxxxx>, linux-aio@xxxxxxxxx, io-uring@xxxxxxxxxxxxxxx, linux-erofs@xxxxxxxxxxxxxxxx, linux-um@xxxxxxxxxxxxxxxxxxx, linux-ntfs-dev@xxxxxxxxxxxxxxxxxxxxx, reiserfs-devel@xxxxxxxxxxxxxxx, linux-f2fs-devel@xxxxxxxxxxxxxxxxxxxxx, linux-nilfs@xxxxxxxxxxxxxxx, cluster-devel@xxxxxxxxxx, ecryptfs@xxxxxxxxxxxxxxx, linux-cifs@xxxxxxxxxxxxxxx, linux-btrfs <linux-btrfs@xxxxxxxxxxxxxxx>, linux-afs@xxxxxxxxxxxxxxxxxxx, linux-rdma <linux-rdma@xxxxxxxxxxxxxxx>, amd-gfx list <amd-gfx@xxxxxxxxxxxxxxxxxxxxx>, Maling list - DRI developers <dri-devel@xxxxxxxxxxxxxxxxxxxxx>, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, drbd-dev@xxxxxxxxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, linux-cachefs@xxxxxxxxxx, samba-technical@xxxxxxxxxxxxxxx, intel-wired-lan@xxxxxxxxxxxxxxxx
- Delivery-date: Tue, 13 Oct 2020 20:02:59 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On Tue, Oct 13, 2020 at 08:36:43PM +0100, Matthew Wilcox wrote:
> static inline void copy_to_highpage(struct page *to, void *vfrom, unsigned
> int size)
> {
> char *vto = kmap_atomic(to);
>
> memcpy(vto, vfrom, size);
> kunmap_atomic(vto);
> }
>
> in linux/highmem.h ?
You mean, like
static void memcpy_from_page(char *to, struct page *page, size_t offset, size_t
len)
{
char *from = kmap_atomic(page);
memcpy(to, from + offset, len);
kunmap_atomic(from);
}
static void memcpy_to_page(struct page *page, size_t offset, const char *from,
size_t len)
{
char *to = kmap_atomic(page);
memcpy(to + offset, from, len);
kunmap_atomic(to);
}
static void memzero_page(struct page *page, size_t offset, size_t len)
{
char *addr = kmap_atomic(page);
memset(addr + offset, 0, len);
kunmap_atomic(addr);
}
in lib/iov_iter.c? FWIW, I don't like that "highpage" in the name and
highmem.h as location - these make perfect sense regardless of highmem;
they are normal memory operations with page + offset used instead of
a pointer...
|