]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_io: make MADV_SOFT_OFFLINE conditional
authorBastian Germann <bage@debian.org>
Fri, 31 May 2024 19:57:51 +0000 (21:57 +0200)
committerCarlos Maiolino <cem@kernel.org>
Mon, 17 Jun 2024 11:43:47 +0000 (13:43 +0200)
mips64el does not have the symbol MADV_SOFT_OFFLINE, so wrap it in an
ifdef.

Signed-off-by: Bastian Germann <bage@debian.org>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
io/madvise.c

index ede233955ced0ea29be514e8a1ab9c13b25f16d0..6d3623b6d8f8ec3f7176071070f50d7d2b62b9ea 100644 (file)
@@ -40,7 +40,9 @@ madvise_help(void)
 " -H -- enable transparent hugepages (MADV_HUGEPAGE)\n"
 " -m -- mark the range mergeable (MADV_MERGEABLE)\n"
 " -M -- mark the range unmergeable (MADV_UNMERGEABLE)\n"
+#ifdef MADV_SOFT_OFFLINE
 " -o -- mark the range offline (MADV_SOFT_OFFLINE)\n"
+#endif
 " -p -- punch a hole in the file (MADV_REMOVE)\n"
 " -P -- poison the page cache (MADV_HWPOISON)\n"
 #ifdef MADV_POPULATE_READ
@@ -101,9 +103,12 @@ madvise_f(
                case 'M':       /* disable merging */
                        advise = MADV_UNMERGEABLE;
                        break;
+#ifdef MADV_SOFT_OFFLINE
+/* MADV_SOFT_OFFLINE is undefined on mips as if Linux 6.9 */
                case 'o':       /* offline */
                        advise = MADV_SOFT_OFFLINE;
                        break;
+#endif
                case 'p':       /* punch hole */
                        advise = MADV_REMOVE;
                        break;