Re: [PATCH] async_tx: use memchr_inv

2012-10-29 Thread Vinod Koul
On Sun, 2012-10-28 at 00:49 +0900, Akinobu Mita wrote:
> Use memchr_inv() to check the specified page is filled with zero.
> 
Applied Thanks

-- 
Vinod Koul
Intel Corp.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] async_tx: use memchr_inv

2012-10-29 Thread Vinod Koul
On Sun, 2012-10-28 at 00:49 +0900, Akinobu Mita wrote:
 Use memchr_inv() to check the specified page is filled with zero.
 
Applied Thanks

-- 
Vinod Koul
Intel Corp.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] async_tx: use memchr_inv

2012-10-28 Thread Vinod Koul
On Sun, 2012-10-28 at 00:49 +0900, Akinobu Mita wrote:
> Use memchr_inv() to check the specified page is filled with zero.
> 
> Signed-off-by: Akinobu Mita 
> Cc: Vinod Koul 
> Cc: Dan Williams 
> ---
Looks fine to me, need Dan;s ack before applying

>  crypto/async_tx/async_xor.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
> index 154cc84..8ade0a0 100644
> --- a/crypto/async_tx/async_xor.c
> +++ b/crypto/async_tx/async_xor.c
> @@ -230,9 +230,7 @@ EXPORT_SYMBOL_GPL(async_xor);
>  
>  static int page_is_zero(struct page *p, unsigned int offset, size_t len)
>  {
> - char *a = page_address(p) + offset;
> - return ((*(u32 *) a) == 0 &&
> - memcmp(a, a + 4, len - 4) == 0);
> + return !memchr_inv(page_address(p) + offset, 0, len);
>  }
>  
>  static inline struct dma_chan *


-- 
Vinod Koul
Intel Corp.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] async_tx: use memchr_inv

2012-10-28 Thread Vinod Koul
On Sun, 2012-10-28 at 00:49 +0900, Akinobu Mita wrote:
 Use memchr_inv() to check the specified page is filled with zero.
 
 Signed-off-by: Akinobu Mita akinobu.m...@gmail.com
 Cc: Vinod Koul vinod.k...@intel.com
 Cc: Dan Williams d...@fb.com
 ---
Looks fine to me, need Dan;s ack before applying

  crypto/async_tx/async_xor.c | 4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
 
 diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
 index 154cc84..8ade0a0 100644
 --- a/crypto/async_tx/async_xor.c
 +++ b/crypto/async_tx/async_xor.c
 @@ -230,9 +230,7 @@ EXPORT_SYMBOL_GPL(async_xor);
  
  static int page_is_zero(struct page *p, unsigned int offset, size_t len)
  {
 - char *a = page_address(p) + offset;
 - return ((*(u32 *) a) == 0 
 - memcmp(a, a + 4, len - 4) == 0);
 + return !memchr_inv(page_address(p) + offset, 0, len);
  }
  
  static inline struct dma_chan *


-- 
Vinod Koul
Intel Corp.

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] async_tx: use memchr_inv

2012-10-27 Thread Akinobu Mita
Use memchr_inv() to check the specified page is filled with zero.

Signed-off-by: Akinobu Mita 
Cc: Vinod Koul 
Cc: Dan Williams 
---
 crypto/async_tx/async_xor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
index 154cc84..8ade0a0 100644
--- a/crypto/async_tx/async_xor.c
+++ b/crypto/async_tx/async_xor.c
@@ -230,9 +230,7 @@ EXPORT_SYMBOL_GPL(async_xor);
 
 static int page_is_zero(struct page *p, unsigned int offset, size_t len)
 {
-   char *a = page_address(p) + offset;
-   return ((*(u32 *) a) == 0 &&
-   memcmp(a, a + 4, len - 4) == 0);
+   return !memchr_inv(page_address(p) + offset, 0, len);
 }
 
 static inline struct dma_chan *
-- 
1.7.11.7

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] async_tx: use memchr_inv

2012-10-27 Thread Akinobu Mita
Use memchr_inv() to check the specified page is filled with zero.

Signed-off-by: Akinobu Mita akinobu.m...@gmail.com
Cc: Vinod Koul vinod.k...@intel.com
Cc: Dan Williams d...@fb.com
---
 crypto/async_tx/async_xor.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/crypto/async_tx/async_xor.c b/crypto/async_tx/async_xor.c
index 154cc84..8ade0a0 100644
--- a/crypto/async_tx/async_xor.c
+++ b/crypto/async_tx/async_xor.c
@@ -230,9 +230,7 @@ EXPORT_SYMBOL_GPL(async_xor);
 
 static int page_is_zero(struct page *p, unsigned int offset, size_t len)
 {
-   char *a = page_address(p) + offset;
-   return ((*(u32 *) a) == 0 
-   memcmp(a, a + 4, len - 4) == 0);
+   return !memchr_inv(page_address(p) + offset, 0, len);
 }
 
 static inline struct dma_chan *
-- 
1.7.11.7

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/