Re: [PATCH] shmem : remove redundant code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 8 Mar 2010, Huang Shijie wrote:

> The  prep_new_page() will call set_page_private(page, 0) to initiate
> the page.
> 
> So the code is redundant.
> 
> Signed-off-by: Huang Shijie <shijie8@xxxxxxxxx>

Acked-by: Hugh Dickins <hugh.dickins@xxxxxxxxxxxxx>

I didn't feel too enthusiastic at first, since private used not to be initialized
by page allocation, and I don't know of a strong reason why it should be: we do
strongly demand that page->mapping be NULL on allocation, but we leave page->index
with whatever it already contains, and I had thought page->_private the same.

But it seems we have been initializing private to 0 for nearly seven years now,
and it was done intentionally for something (XFS) to depend upon, so yes,
let's rely on that here too - thanks.

Hugh

> ---
>  mm/shmem.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/shmem.c b/mm/shmem.c
> index eef4ebe..dde4363 100644
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -433,8 +433,6 @@ static swp_entry_t *shmem_swp_alloc(struct shmem_inode_info *info, unsigned long
>  
>  		spin_unlock(&info->lock);
>  		page = shmem_dir_alloc(mapping_gfp_mask(inode->i_mapping));
> -		if (page)
> -			set_page_private(page, 0);
>  		spin_lock(&info->lock);
>  
>  		if (!page) {
> -- 
> 1.6.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxxx  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]