All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Cheng <crquan@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: fuse-devel@lists.sourceforge.net, viro@zeniv.linux.org.uk,
	linux-kernel@vger.kernel.org, Denis Cheng <crquan@gmail.com>
Subject: [PATCH] fs/fuse/dev.c: use zero_user_page instead
Date: Fri, 20 Jul 2007 17:37:50 +0800	[thread overview]
Message-ID: <11849242706-git-send-email-crquan@gmail.com> (raw)

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);
+
 	while (count) {
 		int err;
 		if (!cs->len && (err = fuse_copy_fill(cs)))
-- 
1.5.2.2


             reply	other threads:[~2007-07-20  9:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-20  9:37 Denis Cheng [this message]
2007-07-20 10:09 ` [PATCH] fs/fuse/dev.c: use zero_user_page instead Dave Young
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=11849242706-git-send-email-crquan@gmail.com \
    --to=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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.