From: "Dave Young" <hidave.darkstar@gmail.com>
To: "Denis Cheng" <crquan@gmail.com>
Cc: "Miklos Szeredi" <miklos@szeredi.hu>,
fuse-devel@lists.sourceforge.net, viro@zeniv.linux.org.uk,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fs/fuse/dev.c: use zero_user_page instead
Date: Fri, 20 Jul 2007 10:09:10 +0000 [thread overview]
Message-ID: <a8e1da0707200309n377eca1fwa640eeceb920959b@mail.gmail.com> (raw)
In-Reply-To: <11849242706-git-send-email-crquan@gmail.com>
>On 7/20/07, Denis Cheng <crquan@gmail.com> wrote:
> Signed-off-by: Denis Cheng <crquan@gmail.com>
> ---
> I'm not very sure zero_user_page is correctly used here,
> so please feel free to give comments.
>
> and why here it uses KM_USER1 not KM_USER0, What are the differences?
>
> fs/fuse/dev.c | 8 +++-----
> 1 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/fs/fuse/dev.c b/fs/fuse/dev.c
> index 3ad22be..e55b5e8 100644
> --- a/fs/fuse/dev.c
> +++ b/fs/fuse/dev.c
> @@ -533,11 +533,9 @@ static int fuse_copy_do(struct fuse_copy_state *cs, void **val, unsigned *size)
> static int fuse_copy_page(struct fuse_copy_state *cs, struct page *page,
> unsigned offset, unsigned count, int zeroing)
> {
> - if (page && zeroing && count < PAGE_SIZE) {
> - void *mapaddr = kmap_atomic(page, KM_USER1);
> - memset(mapaddr, 0, PAGE_SIZE);
> - kunmap_atomic(mapaddr, KM_USER1);
> - }
> + if (page && zeroing && count < PAGE_SIZE)
> + zero_user_page(page, 0, PAGE_SIZE, KM_USER1);
Why clear all page? IMHO,only count bytes need to be cleared.
> +
> while (count) {
> int err;
> if (!cs->len && (err = fuse_copy_fill(cs)))
next prev parent reply other threads:[~2007-07-20 10:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-20 9:37 Denis Cheng
2007-07-20 10:09 ` Dave Young [this message]
2007-07-20 10:12 ` rae l
2007-07-20 10:16 ` Dave Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a8e1da0707200309n377eca1fwa640eeceb920959b@mail.gmail.com \
--to=hidave.darkstar@gmail.com \
--cc=crquan@gmail.com \
--cc=fuse-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®