]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_copy: store data buf alignment in buf data structure
authorBrian Foster <bfoster@redhat.com>
Tue, 13 Oct 2015 23:58:25 +0000 (10:58 +1100)
committerDave Chinner <david@fromorbit.com>
Tue, 13 Oct 2015 23:58:25 +0000 (10:58 +1100)
The write buffer data structure stores various characteristics of the
write buffer, such as I/O alignment requirements, etc., but does not
include the required data buffer alignment.

Data buffer alignment is a required buffer initialization parameter and
the v5 log format support code would like to initialize an independent
log buffer based on the predetermined alignment constraints encoded into
the global write buffer. Update the write buffer data structure to store
the provided data alignment value such that it can be accessed
throughout the codebase. This patch does not change existing behavior.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
copy/xfs_copy.c
copy/xfs_copy.h

index 0481ecef7a30cacdfed0ebd60e1d8984467ad092..e03796a86ad7ed528300f872b426e41b60257cd7 100644 (file)
@@ -352,6 +352,7 @@ wbuf_init(wbuf *buf, int data_size, int data_align, int min_io_size, int id)
                        return NULL;
        }
        ASSERT(min_io_size % BBSIZE == 0);
+       buf->data_align = data_align;
        buf->min_io_size = min_io_size;
        buf->size = data_size;
        buf->id = id;
index e76b937a3da77fd09a2264226c6d3f8ffae36e98..6b94130e28bd30dfdd6bedcc89ea8443dd42c0b3 100644 (file)
@@ -54,6 +54,7 @@ typedef struct {
        int             id;             /* buffer ID */
        size_t          size;           /* size of buffer -- fixed */
        size_t          min_io_size;    /* for direct I/O */
+       int             data_align;     /* data buffer alignment */
        xfs_off_t       position;       /* requested position (bytes) */
        size_t          length;         /* requested length (bytes) */
        char            *data;          /* pointer to data buffer */