mm: swap: Simplify end-of-cluster calculation
Its possible that a swap file will have a partial cluster at the end, if
the swap size is not a multiple of the cluster size. But this partial
cluster will never be marked free and so scan_swap_map_try_ssd_cluster()
will never see it. Therefore it can always consider that a cluster ends
at the next cluster boundary.
This leads to a simplification of the endpoint calculation and removal
of an unnecessary conditional.
This change has the useful side effect of making lock_cluster()
unconditional, which will be used in a later commit.
Signed-off-by:
Ryan Roberts <ryan.roberts@arm.com>
Loading
Please register or sign in to comment