btrfs-progs: tests: move do_mmap under HAVE_SYS_MMAN_H in fsstress.c

Move the entire 'do_mmap' function under the 'HAVE_SYS_MMAN_H' define
and fix the following warnings. This function is called only when
'HAVE_SYS_MMAN_H' is defined.

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

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Anand Jain 2023-06-23 15:59:00 +08:00 committed by David Sterba
parent 3b8a552fd7
commit 282c05698a

View file

@ -4359,10 +4359,10 @@ struct print_flags mmap_flags[] = {
({translate_flags(flags, "|", mmap_flags);})
#endif
#ifdef HAVE_SYS_MMAN_H
static void
do_mmap(opnum_t opno, long r, int prot)
{
#ifdef HAVE_SYS_MMAN_H
char *addr;
int e;
pathname_t f;
@ -4454,8 +4454,8 @@ do_mmap(opnum_t opno, long r, int prot)
free_pathname(&f);
close(fd);
#endif
}
#endif
void
mread_f(opnum_t opno, long r)