From: Brian Foster Date: Tue, 13 Oct 2015 23:58:25 +0000 (+1100) Subject: xfs_copy: store data buf alignment in buf data structure X-Git-Tag: v4.3.0-rc1~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=08f2b8364e40051393b40c3d7d9df14b2ba8f5fd;p=thirdparty%2Fxfsprogs-dev.git xfs_copy: store data buf alignment in buf data structure 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 Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- diff --git a/copy/xfs_copy.c b/copy/xfs_copy.c index 0481ecef7..e03796a86 100644 --- a/copy/xfs_copy.c +++ b/copy/xfs_copy.c @@ -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; diff --git a/copy/xfs_copy.h b/copy/xfs_copy.h index e76b937a3..6b94130e2 100644 --- a/copy/xfs_copy.h +++ b/copy/xfs_copy.h @@ -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 */