]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
fsx: fix compile error for preadv2()
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Tue, 14 Jan 2025 03:48:31 +0000 (12:48 +0900)
committerZorro Lang <zlang@kernel.org>
Sat, 1 Feb 2025 06:04:02 +0000 (14:04 +0800)
commita7d82369dcae0d666e4ef63eef3236f2f7ac7d94
treeaf440006fd06a3d6357fef03ea7f7d8160cb2df1
parentdec8cfb46ba0f19d29d13412841f68ebf119a452
fsx: fix compile error for preadv2()

Commit d6b9d8eff076 ("fsx: add support for RWF_DONTCACHE") introduced
preadv2() calls in ltp/fsx.c. However, sys/uio.h is not included to the
source file, which causes compile errors with the gcc option
-Werror-implicit-function-declaration:

fsx.c: In function 'test_dontcache_io':
fsx.c:1956:15: error: implicit declaration of function 'preadv2'; did you mean 'pread64'? [-Wimplicit-function-declaration]
 1956 |         ret = preadv2(fd, &iov, 1, 0, RWF_DONTCACHE);
      |               ^~~~~~~
      |               pread64
fsx.c: In function 'fsx_rw':
fsx.c:2836:31: error: implicit declaration of function 'pwritev2'; did you mean 'pwrite64'? [-Wimplicit-function-declaration]
 2836 |                         ret = pwritev2(fd, &iov, 1, offset, flags);
      |                               ^~~~~~~~
      |                               pwrite64

To fix it, add the include directive.

Fixes: d6b9d8eff076 ("fsx: add support for RWF_DONTCACHE")
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
ltp/fsx.c