From 08f2b8364e40051393b40c3d7d9df14b2ba8f5fd Mon Sep 17 00:00:00 2001 From: Brian Foster Date: Wed, 14 Oct 2015 10:58:25 +1100 Subject: [PATCH] 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 --- copy/xfs_copy.c | 1 + copy/xfs_copy.h | 1 + 2 files changed, 2 insertions(+) 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 */ -- 2.47.2