Skip to content

Commit 5fe0fc9

Browse files
flying-122Miklos Szeredi
authored andcommitted
fuse: use kmap_local_page()
Due to the introduction of kmap_local_*, the storage of slots used for short-term mapping has changed from per-CPU to per-thread. kmap_atomic() disable preemption, while kmap_local_*() only disable migration. There is no need to disable preemption in several kamp_atomic places used in fuse. Link: https://lwn.net/Articles/836144/ Signed-off-by: Peng Hao <[email protected]> Signed-off-by: Miklos Szeredi <[email protected]>
1 parent bda9a71 commit 5fe0fc9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

fs/fuse/dev.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -756,15 +756,15 @@ static int fuse_copy_do(struct fuse_copy_state *cs, void **val, unsigned *size)
756756
{
757757
unsigned ncpy = min(*size, cs->len);
758758
if (val) {
759-
void *pgaddr = kmap_atomic(cs->pg);
759+
void *pgaddr = kmap_local_page(cs->pg);
760760
void *buf = pgaddr + cs->offset;
761761

762762
if (cs->write)
763763
memcpy(buf, *val, ncpy);
764764
else
765765
memcpy(*val, buf, ncpy);
766766

767-
kunmap_atomic(pgaddr);
767+
kunmap_local(pgaddr);
768768
*val += ncpy;
769769
}
770770
*size -= ncpy;
@@ -949,10 +949,10 @@ static int fuse_copy_page(struct fuse_copy_state *cs, struct page **pagep,
949949
}
950950
}
951951
if (page) {
952-
void *mapaddr = kmap_atomic(page);
952+
void *mapaddr = kmap_local_page(page);
953953
void *buf = mapaddr + offset;
954954
offset += fuse_copy_do(cs, &buf, &count);
955-
kunmap_atomic(mapaddr);
955+
kunmap_local(mapaddr);
956956
} else
957957
offset += fuse_copy_do(cs, NULL, &count);
958958
}

fs/fuse/ioctl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,11 @@ long fuse_do_ioctl(struct file *file, unsigned int cmd, unsigned long arg,
286286
in_iovs + out_iovs > FUSE_IOCTL_MAX_IOV)
287287
goto out;
288288

289-
vaddr = kmap_atomic(ap.pages[0]);
289+
vaddr = kmap_local_page(ap.pages[0]);
290290
err = fuse_copy_ioctl_iovec(fm->fc, iov_page, vaddr,
291291
transferred, in_iovs + out_iovs,
292292
(flags & FUSE_IOCTL_COMPAT) != 0);
293-
kunmap_atomic(vaddr);
293+
kunmap_local(vaddr);
294294
if (err)
295295
goto out;
296296

fs/fuse/readdir.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ static void fuse_add_dirent_to_cache(struct file *file,
7676
WARN_ON(fi->rdc.pos != pos))
7777
goto unlock;
7878

79-
addr = kmap_atomic(page);
79+
addr = kmap_local_page(page);
8080
if (!offset)
8181
clear_page(addr);
8282
memcpy(addr + offset, dirent, reclen);
83-
kunmap_atomic(addr);
83+
kunmap_local(addr);
8484
fi->rdc.size = (index << PAGE_SHIFT) + offset + reclen;
8585
fi->rdc.pos = dirent->off;
8686
unlock:

0 commit comments

Comments
 (0)