lib/raid6: replace custom zero page with ZERO_PAGE

Use the system-wide zero page instead of a custom zero page.

[herbert@gondor.apana.org.au: update lib/raid6/recov_rvv.c, per Klara]
  Link: https://lkml.kernel.org/r/aFkUnXWtxcgOTVkw@gondor.apana.org.au
Link: https://lkml.kernel.org/r/Z9flJNkWQICx0PXk@gondor.apana.org.au
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Song Liu <song@kernel.org>
Cc: Yu Kuai <yukuai3@huawei.com>
Cc: Klara Modin <klarasmodin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
Herbert Xu
2025-03-17 17:02:28 +08:00
committed by Andrew Morton
parent 41a7f73768
commit 1857fcc847
11 changed files with 38 additions and 31 deletions

View File

@@ -11,8 +11,13 @@
#ifdef __KERNEL__
#include <linux/blkdev.h>
#include <linux/mm.h>
extern const char raid6_empty_zero_page[PAGE_SIZE];
/* This should be const but the raid6 code is too convoluted for that. */
static inline void *raid6_get_zero_page(void)
{
return page_address(ZERO_PAGE(0));
}
#else /* ! __KERNEL__ */
/* Used for testing in user space */
@@ -191,6 +196,11 @@ static inline uint32_t raid6_jiffies(void)
return tv.tv_sec*1000 + tv.tv_usec/1000;
}
static inline void *raid6_get_zero_page(void)
{
return raid6_empty_zero_page;
}
#endif /* ! __KERNEL__ */
#endif /* LINUX_RAID_RAID6_H */