Skip to contentSkip to conversation

xfs_io: make MADV_SOFT_OFFLINE conditional

PATCH In review Bastian Germann 3 participants 4 messages May 31, 2024 – Jun 17, 2024

lore
Share & tools
lore
#0 lore raw

v3 cover xfs_io: make MADV_SOFT_OFFLINE conditional

v2:
Suppress -o on the help message

v3:
Address Christoph Hellwig's comment that I should add a comment that this is because of the missing definition on mips.

Bastian Germann (1):
xfs_io: make MADV_SOFT_OFFLINE conditional

 io/madvise.c | 5 +++++
 1 file changed, 5 insertions(+)
Signature · 1 line
2.45.1
#1 lore raw

PATCH v3 1/1 xfs_io: make MADV_SOFT_OFFLINE conditional

mips64el does not have the symbol MADV_SOFT_OFFLINE, so wrap it in an ifdef.

---
 io/madvise.c | 5 +++++
 1 file changed, 5 insertions(+)
io/madvise.c +5 -0
index ede23395..f26c03f1 100644
@@ -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 */
 		case 'o':	/* offline */
 			advise = MADV_SOFT_OFFLINE;
 			break;
+#endif
 		case 'p':	/* punch hole */
 			advise = MADV_REMOVE;
 			break;
Signature · 1 line
2.45.1
Reviewed-by on v3 1/1
#2 lore raw

io/madvise.c madvise_f( · line 107

Quoted 2 lines · Bastian Germann
io/madvise.c +2 -0
+#ifdef MADV_SOFT_OFFLINE
+/* MADV_SOFT_OFFLINE is undefined on mips */

... as of Linux 6.9 */

With that (can probably just be fixed when applying):

#3 lore raw
Quoted 5 lines · Christoph Hellwig

io/madvise.c madvise_f( · line 107

Quoted 2 lines · Bastian Germann
io/madvise.c +2 -0
+#ifdef MADV_SOFT_OFFLINE
+/* MADV_SOFT_OFFLINE is undefined on mips */

... as of Linux 6.9 */

no problem.

Carlos

Quoted 6 lines

With that (can probably just be fixed when applying):