Skip to content

Commit

Permalink
I could not know if HAVE_FILE_FADVISE is defined
Browse files Browse the repository at this point in the history
or not in file_fadvise.c. Change test program to check
former data_size less or eaqul to latter one.

Signed-off-by: Finix Yan yancw@info2soft.com
  • Loading branch information
Finix1979 committed Aug 12, 2022
1 parent e3f0c1d commit ffc3476
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 0 additions & 4 deletions tests/zfs-tests/cmd/file/file_fadvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,6 @@ main(int argc, char *argv[])
return (1);
}

#ifndef HAVE_FILE_FADVISE
return (1);
#endif

if ((fd = open(filename, O_RDWR, 0666)) < 0) {
perror("open");
return (1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
# 6. latter data_size should be bigger than former one
#

# NOTE: if HAVE_FILE_FADVISE is not defined former data_size
# should less or eaqul to latter one

verify_runnable "global"

FILE=$TESTDIR/$TESTFILE0
Expand All @@ -66,12 +69,12 @@ sync_pool $TESTPOOL

data_size1=$(getstat data_size)

file_fadvise -f $FILE -a 2 || log_unsupported "fadvise support required"
log_must file_fadvise -f $FILE -a 2
sleep 10

data_size2=$(getstat data_size)
log_note "original data_size is $data_size1, final data_size is $data_size2"

log_must [ $data_size1 -lt $data_size2 ]
log_must [ $data_size1 -le $data_size2 ]

log_pass "Ensure data could be prefetched"

0 comments on commit ffc3476

Please sign in to comment.