cluster-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
From: Steven Whitehouse <swhiteho@redhat.com>
To: cluster-devel.redhat.com
Subject: [Cluster-devel] Re: [PATCH] GFS2: Use shorter form of zero_user_page() in code.
Date: Tue, 10 Jul 2007 14:12:48 +0100	[thread overview]
Message-ID: <1184073168.8765.214.camel@quoit> (raw)
In-Reply-To: <Pine.LNX.4.64.0707100903480.20260@localhost.localdomain>

Hi,

I'll add this in as soon as Linus has pulled the current tree. Thanks,

Steve.

On Tue, 2007-07-10 at 09:05 -0400, Robert P. J. Day wrote:
> Signed-off-by: Robert P. J. Day <rpjday@mindspring.com>
> 
> ---
> 
> AFAICT, the following should be entirely equivalent, but shorter,
> based on the zero_user_page macro defined in highmem.h.
> 
>  fs/gfs2/bmap.c        |    6 ++----
>  fs/gfs2/ops_address.c |    6 ++----
>  2 files changed, 4 insertions(+), 8 deletions(-)
> 
> diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c
> index c53a5d2..8fd90b3 100644
> --- a/fs/gfs2/bmap.c
> +++ b/fs/gfs2/bmap.c
> @@ -14,6 +14,7 @@
>  #include <linux/gfs2_ondisk.h>
>  #include <linux/crc32.h>
>  #include <linux/lm_interface.h>
> +#include <linux/highmem.h>
> 
>  #include "gfs2.h"
>  #include "incore.h"
> @@ -933,10 +934,7 @@ static int gfs2_block_truncate_page(struct address_space *mapping)
>  	if (sdp->sd_args.ar_data == GFS2_DATA_ORDERED || gfs2_is_jdata(ip))
>  		gfs2_trans_add_bh(ip->i_gl, bh, 0);
> 
> -	kaddr = kmap_atomic(page, KM_USER0);
> -	memset(kaddr + offset, 0, length);
> -	flush_dcache_page(page);
> -	kunmap_atomic(kaddr, KM_USER0);
> +	zero_user_page(page, offset, length, KM_USER0);
> 
>  unlock:
>  	unlock_page(page);
> diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
> index 30c1562..d90ce06 100644
> --- a/fs/gfs2/ops_address.c
> +++ b/fs/gfs2/ops_address.c
> @@ -19,6 +19,7 @@
>  #include <linux/writeback.h>
>  #include <linux/gfs2_ondisk.h>
>  #include <linux/lm_interface.h>
> +#include <linux/highmem.h>
> 
>  #include "gfs2.h"
>  #include "incore.h"
> @@ -203,10 +204,7 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
>  	 * so we need to supply one here. It doesn't happen often.
>  	 */
>  	if (unlikely(page->index)) {
> -		kaddr = kmap_atomic(page, KM_USER0);
> -		memset(kaddr, 0, PAGE_CACHE_SIZE);
> -		kunmap_atomic(kaddr, KM_USER0);
> -		flush_dcache_page(page);
> +		zero_user_page(page, 0, PAGE_CACHE_SIZE, KM_USER0);
>  		SetPageUptodate(page);
>  		return 0;
>  	}
> 



  reply	other threads:[~2007-07-10 13:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-10 13:05 [Cluster-devel] [PATCH] GFS2: Use shorter form of zero_user_page() in code Robert P. J. Day
2007-07-10 13:12 ` Steven Whitehouse [this message]
2007-07-11 10:43   ` [Cluster-devel] " Steven Whitehouse
2007-07-11 10:59     ` Robert P. J. Day

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=1184073168.8765.214.camel@quoit \
    --to=swhiteho@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).