2 * Copyright (C) 2012-2020 all contributors <cmogstored-public@yhbt.net>
3 * License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
5 #if defined(HAVE_POSIX_FADVISE)
6 static inline void mog_fadv_sequential(int fd
, off_t offset
, off_t len
)
8 int rc
= posix_fadvise(fd
, offset
, len
, POSIX_FADV_SEQUENTIAL
);
12 assert(errno
!= EBADF
&& errno
!= ESPIPE
&&
13 "BUG: posix_fadvise(POSIX_FADV_SEQUENTIAL) failed");
16 static inline void mog_fadv_noreuse(int fd
, off_t offset
, off_t len
)
18 int rc
= posix_fadvise(fd
, offset
, len
, POSIX_FADV_NOREUSE
);
22 assert(errno
!= EBADF
&& errno
!= ESPIPE
&&
23 "BUG: posix_fadvise(POSIX_FADV_NOREUSE) failed");
26 static inline void mog_fadv_sequential(int fd
, off_t offset
, off_t len
)
29 static inline void mog_fadv_noreuse(int fd
, off_t offset
, off_t len
)