diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-02-19 07:27:29 +0100 |
---|---|---|
committer | Chandan Babu R <chandanbabu@kernel.org> | 2024-02-21 11:36:55 +0530 |
commit | ee13fc67205b989c93c89a4800a4b1c84e448dde (patch) | |
tree | 5e20392b59073d95ea604378348af4ad2d304d3a /fs/xfs/scrub/xfarray.h | |
parent | b2fdfe19dfd70ba047ab720eb52f00651ef8a5cd (diff) | |
download | linux-stable-ee13fc67205b989c93c89a4800a4b1c84e448dde.tar.gz linux-stable-ee13fc67205b989c93c89a4800a4b1c84e448dde.tar.bz2 linux-stable-ee13fc67205b989c93c89a4800a4b1c84e448dde.zip |
xfs: convert xfarray_pagesort to deal with large folios
Convert xfarray_pagesort to handle large folios by introducing a new
xfile_get_folio routine that can return a folio of arbitrary size, and
using heapsort on the full folio. This also corrects an off-by-one bug
in the calculation of len in xfarray_pagesort that was papered over by
xfarray_want_pagesort.
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kent Overstreet <kent.overstreet@linux.dev>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
Diffstat (limited to 'fs/xfs/scrub/xfarray.h')
-rw-r--r-- | fs/xfs/scrub/xfarray.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/fs/xfs/scrub/xfarray.h b/fs/xfs/scrub/xfarray.h index 6f2862054e19..ec643cc9fc14 100644 --- a/fs/xfs/scrub/xfarray.h +++ b/fs/xfs/scrub/xfarray.h @@ -105,8 +105,14 @@ struct xfarray_sortinfo { /* XFARRAY_SORT_* flags; see below. */ unsigned int flags; - /* Cache a page here for faster access. */ - struct xfile_page xfpage; + /* Cache a folio here for faster scanning for pivots */ + struct folio *folio; + + /* First array index in folio that is completely readable */ + xfarray_idx_t first_folio_idx; + + /* Last array index in folio that is completely readable */ + xfarray_idx_t last_folio_idx; #ifdef DEBUG /* Performance statistics. */ |