xfs
[Top] [All Lists]

[PATCH v2] xfsprog: remove duplicate vector memalign from xfs_io

To: xfs@xxxxxxxxxxx
Subject: [PATCH v2] xfsprog: remove duplicate vector memalign from xfs_io
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Thu, 27 Sep 2012 07:47:36 -0500
Cc: Ben Myers <bpm@xxxxxxx>
References: <20120925142414.660506845@xxxxxxx> <20120925142421.398175185@xxxxxxx> <20120926220434.GG13214@xxxxxxx>
User-agent: quilt/0.51-1
The vector feature of xfs_io uses its own memory buffer in the iov structure
and does not use the buffer entry. Remove the duplicate memalign.

v2: removed global buffer in __dump_buffer() and use passed buf pointer per
    Ben's detection.

Signed-off-by: Mark Tinguely <tinguely@xxxxxxx>
Reviewed-by: Ben Myers <bpm@xxxxxxx>
---
 io/pread.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Index: b/io/pread.c
===================================================================
--- a/io/pread.c
+++ b/io/pread.c
@@ -76,8 +76,7 @@ alloc_iovec(
        buffersize = 0;
        for (i = 0; i < vectors; i++) {
                iov[i].iov_base = memalign(pagesize, bsize);
-               buffer = memalign(pagesize, bsize);
-               if (!buffer) {
+               if (!iov[i].iov_base) {
                        perror("memalign");
                        goto unwind;
                }
@@ -130,7 +129,7 @@ __dump_buffer(
        int             i, j;
        char            *p;
 
-       for (i = 0, p = (char *)buffer; i < len; i += 16) {
+       for (i = 0, p = (char *)buf; i < len; i += 16) {
                char    *s = p;
 
                printf("%08llx:  ", (unsigned long long)offset + i);


<Prev in Thread] Current Thread [Next in Thread>