]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: remove duplicate vector memalign from xfs_io
authorMark Tinguely <tinguely@sgi.com>
Thu, 27 Sep 2012 12:47:36 +0000 (12:47 +0000)
committerMark Tinguely <tinguely@eagdhcp-232-125.americas.sgi.com>
Fri, 28 Sep 2012 16:30:18 +0000 (11:30 -0500)
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@sgi.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
io/pread.c

index f6e4ca20afec9299ad17461c9fcd133d33a23be1..0b9454badb6449ea15a0bae5efe814ca2e85d442 100644 (file)
@@ -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);