Re: [PATCH 1/5] Madvise NOSYNC flag only if available

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




Reviewed-by: Steven Dake <sdake@xxxxxxxxxx>

On 03/21/2012 09:23 AM, Jan Friesse wrote:
> Signed-off-by: Jan Friesse <jfriesse@xxxxxxxxxx>
> ---
>  exec/coroipcs.c |    6 +++---
>  exec/logsys.c   |    4 ++--
>  lib/coroipcc.c  |    6 +++---
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/exec/coroipcs.c b/exec/coroipcs.c
> index 2227c07..67ff0e7 100644
> --- a/exec/coroipcs.c
> +++ b/exec/coroipcs.c
> @@ -250,7 +250,7 @@ memory_map (
>  		munmap(addr_orig, bytes);
>  		goto error_close_unlink;
>  	}
> -#ifdef COROSYNC_BSD
> +#if (defined COROSYNC_BSD && defined MADV_NOSYNC)
>  	madvise(addr, bytes, MADV_NOSYNC);
>  #endif
>  
> @@ -305,7 +305,7 @@ circular_memory_map (
>  		munmap(addr_orig, bytes);
>  		goto error_close_unlink;
>  	}
> -#ifdef COROSYNC_BSD
> +#if (defined COROSYNC_BSD && defined MADV_NOSYNC)
>  	madvise(addr_orig, bytes, MADV_NOSYNC);
>  #endif
>  
> @@ -317,7 +317,7 @@ circular_memory_map (
>  		munmap(addr, bytes);
>  		goto error_close_unlink;
>  	}
> -#ifdef COROSYNC_BSD
> +#if (defined COROSYNC_BSD && defined MADV_NOSYNC)
>  	madvise(((char *)addr_orig) + bytes, bytes, MADV_NOSYNC);
>  #endif
>  
> diff --git a/exec/logsys.c b/exec/logsys.c
> index 7b7d2a5..4c3e11a 100644
> --- a/exec/logsys.c
> +++ b/exec/logsys.c
> @@ -273,7 +273,7 @@ retry_write:
>  		error_return = -1;
>  		goto mmap_exit;
>  	}
> -	#ifdef COROSYNC_BSD
> +	#if (defined COROSYNC_BSD && defined MADV_NOSYNC)
>  		madvise(addr_orig, bytes, MADV_NOSYNC);
>  	#endif
>  
> @@ -284,7 +284,7 @@ retry_write:
>  		error_return = -1;
>  		goto mmap_exit;
>  	}
> -#ifdef COROSYNC_BSD
> +#if (defined COROSYNC_BSD && defined MADV_NOSYNC)
>  	madvise(((char *)addr_orig) + bytes, bytes, MADV_NOSYNC);
>  #endif
>  
> diff --git a/lib/coroipcc.c b/lib/coroipcc.c
> index bbe2817..a1bbbdf 100644
> --- a/lib/coroipcc.c
> +++ b/lib/coroipcc.c
> @@ -353,7 +353,7 @@ retry_write:
>  	if (addr != addr_orig) {
>  		goto error_close_unlink;
>  	}
> -#ifdef COROSYNC_BSD
> +#if (defined COROSYNC_BSD && defined MADV_NOSYNC)
>  	madvise(addr_orig, bytes, MADV_NOSYNC);
>  #endif
>  
> @@ -363,7 +363,7 @@ retry_write:
>  	if (addr == MAP_FAILED) {
>  		goto error_close_unlink;
>  	}
> -#ifdef COROSYNC_BSD
> +#if (defined COROSYNC_BSD && defined MADV_NOSYNC)
>  	madvise(((char *)addr_orig) + bytes, bytes, MADV_NOSYNC);
>  #endif
>  
> @@ -463,7 +463,7 @@ retry_write:
>  	if (addr != addr_orig) {
>  		goto error_close_unlink;
>  	}
> -#ifdef COROSYNC_BSD
> +#if (defined COROSYNC_BSD && defined MADV_NOSYNC)
>  	madvise(addr_orig, bytes, MADV_NOSYNC);
>  #endif
>  

_______________________________________________
discuss mailing list
discuss@xxxxxxxxxxxx
http://lists.corosync.org/mailman/listinfo/discuss


[Corosync Project]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux