Skip to content

Commit

Permalink
fuse: use clear_highpage() and KM_USER0 instead of KM_USER1
Browse files Browse the repository at this point in the history
Commit 7909b1c ("fuse: don't use atomic kmap") removed KM_USER0 usage
from fuse/dev.c.  Switch KM_USER1 uses to KM_USER0 for clarity.  Also
replace open coded clear_highpage().

Signed-off-by: Miklos Szeredi <[email protected]>
Cc: Jan Beulich <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Miklos Szeredi authored and torvalds committed Oct 26, 2010
1 parent 3ecb01d commit b6777c4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions fs/fuse/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,11 +809,9 @@ static int fuse_copy_page(struct fuse_copy_state *cs, struct page **pagep,
int err;
struct page *page = *pagep;

if (page && zeroing && count < PAGE_SIZE) {
void *mapaddr = kmap_atomic(page, KM_USER1);
clear_page(mapaddr);
kunmap_atomic(mapaddr, KM_USER1);
}
if (page && zeroing && count < PAGE_SIZE)
clear_highpage(page);

while (count) {
if (cs->write && cs->pipebufs && page) {
return fuse_ref_page(cs, page, offset, count);
Expand All @@ -830,10 +828,10 @@ static int fuse_copy_page(struct fuse_copy_state *cs, struct page **pagep,
}
}
if (page) {
void *mapaddr = kmap_atomic(page, KM_USER1);
void *mapaddr = kmap_atomic(page, KM_USER0);
void *buf = mapaddr + offset;
offset += fuse_copy_do(cs, &buf, &count);
kunmap_atomic(mapaddr, KM_USER1);
kunmap_atomic(mapaddr, KM_USER0);
} else
offset += fuse_copy_do(cs, NULL, &count);
}
Expand Down

0 comments on commit b6777c4

Please sign in to comment.