lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090604043208.GB15682@localhost>
Date:	Thu, 4 Jun 2009 12:32:08 +0800
From:	Wu Fengguang <fengguang.wu@...el.com>
To:	Andi Kleen <andi@...stfloor.org>
Cc:	"npiggin@...e.de" <npiggin@...e.de>,
	"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>
Subject: Re: [PATCH] [12/16] Refactor truncate to allow direct truncating
	of page

On Thu, Jun 04, 2009 at 02:46:46AM +0800, Andi Kleen wrote:
> 
> From: Nick Piggin <npiggin@...e.de>
> 
> Extract out truncate_inode_page() out of the truncate path so that
> it can be used by memory-failure.c
> 
> [AK: description, headers, fix typos]
> 
> Signed-off-by: Andi Kleen <ak@...ux.intel.com>
> 
> ---
>  include/linux/mm.h |    2 ++
>  mm/truncate.c      |   24 ++++++++++++------------
>  2 files changed, 14 insertions(+), 12 deletions(-)
> 
> Index: linux/mm/truncate.c
> ===================================================================
> --- linux.orig/mm/truncate.c	2009-06-03 19:37:38.000000000 +0200
> +++ linux/mm/truncate.c	2009-06-03 20:13:43.000000000 +0200
> @@ -135,6 +135,16 @@
>  	return ret;
>  }
>  
> +void truncate_inode_page(struct address_space *mapping, struct page *page)
> +{
> +	if (page_mapped(page)) {
> +		unmap_mapping_range(mapping,
> +		  (loff_t)page->index<<PAGE_CACHE_SHIFT,
> +		  PAGE_CACHE_SIZE, 0);
> +	}
> +	truncate_complete_page(mapping, page);
> +}
> +

Small style cleanup:

---
 mm/truncate.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- sound-2.6.orig/mm/truncate.c
+++ sound-2.6/mm/truncate.c
@@ -139,8 +139,8 @@ void truncate_inode_page(struct address_
 {
 	if (page_mapped(page)) {
 		unmap_mapping_range(mapping,
-		  (loff_t)page->index<<PAGE_CACHE_SHIFT,
-		  PAGE_CACHE_SIZE, 0);
+				    (loff_t)page->index << PAGE_CACHE_SHIFT,
+				    PAGE_CACHE_SIZE, 0);
 	}
 	truncate_complete_page(mapping, page);
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ