From e66b6014eeebbc3d4a064302386c3be765f4fe0d Mon Sep 17 00:00:00 2001 From: Patrick Farrell Date: Sun, 17 Sep 2023 16:31:31 -0400 Subject: [PATCH] LU-13814 llite: add to/from to ll_dio_pages ll_dio_pages is the main way we package pages for a DIO, so as we work on removing cl_page for DIO, we need to put some of the info in this struct. This puts the 'to, from' page offsets for incomplete pages in the package. This works because all pages except the first and the last must be complete (the first and last can be the same page). Test-Parameters: trivial Test-Parameters: forjanitoronly Test-Parameters: fortestonly Signed-off-by: Patrick Farrell Change-Id: I0ae4d617cb2f1310ae5981a9f9eb1480d13e1054 --- lustre/include/cl_object.h | 7 ++++++- lustre/llite/rw26.c | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/lustre/include/cl_object.h b/lustre/include/cl_object.h index c961a7f..7f75148 100644 --- a/lustre/include/cl_object.h +++ b/lustre/include/cl_object.h @@ -2569,7 +2569,12 @@ struct ll_dio_pages { /** # of pages in the array. */ size_t ldp_count; /* the file offset of the first page. */ - loff_t ldp_file_offset; + loff_t ldp_file_offset; + /* the first and last page can be incomplete, this records the + * offsets + */ + int ldp_from; + int ldp_to; }; /* Top level struct used for AIO and DIO */ diff --git a/lustre/llite/rw26.c b/lustre/llite/rw26.c index a66d052..04c1b98 100644 --- a/lustre/llite/rw26.c +++ b/lustre/llite/rw26.c @@ -378,6 +378,9 @@ ll_direct_rw_pages(const struct lu_env *env, struct cl_io *io, size_t size, ENTRY; + pv->ldp_from = offset & ~PAGE_MASK; + pv->ldp_to = (offset + size) & ~PAGE_MASK; + cl_2queue_init(queue); while (size > 0) { size_t from = offset & ~PAGE_MASK; -- 1.8.3.1