diff mbox series

[3/4] btrfs-progs: tests/fsstress.c: move do_fallocate under HAVE_LINUX_FALLOC_H

Message ID 7ad5a1e75bb3008bb3fae67dba7ec9318301e418.1687485959.git.anand.jain@oracle.com (mailing list archive)
State New, archived
Headers show
Series btrfs-progs: tests: fix warnings during make test | expand

Commit Message

Anand Jain June 23, 2023, 7:59 a.m. UTC
Move the entire 'do_fallocate' function under the 'HAVE_LINUX_FALLOC_H'
define and fix the following warnings. This function is called only when
'HAVE_LINUX_FALLOC_H' is defined.

tests/fsstress.c:3814:1: warning: ‘do_fallocate’ defined but not used [-Wunused-function]
 3814 | do_fallocate(opnum_t opno, long r, int mode)

Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
 tests/fsstress.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/tests/fsstress.c b/tests/fsstress.c
index 692d7cfacaf4..5fd347ccf1d4 100644
--- a/tests/fsstress.c
+++ b/tests/fsstress.c
@@ -3810,10 +3810,10 @@  struct print_flags falloc_flags [] = {
 	({translate_flags(mode, "|", falloc_flags);})
 #endif
 
+#ifdef HAVE_LINUX_FALLOC_H
 static void
 do_fallocate(opnum_t opno, long r, int mode)
 {
-#ifdef HAVE_LINUX_FALLOC_H
 	int		e;
 	pathname_t	f;
 	int		fd;
@@ -3870,8 +3870,8 @@  do_fallocate(opnum_t opno, long r, int mode)
 		       f.path, st, (long long)off, (long long)len, e);
 	free_pathname(&f);
 	close(fd);
-#endif
 }
+#endif
 
 void
 fallocate_f(opnum_t opno, long r)