Don't allow ENOSYS for fadvise(DONT_NEED)

We want to know if it's failing. In case, a different
advise method has to be used.
This commit is contained in:
Andrea Mazzoleni 2016-10-29 08:08:52 +02:00
parent b86e06f415
commit d65450dda8

View file

@ -1120,10 +1120,7 @@ int advise_write(struct advise_struct* advise, int f, data_off_t offset, data_of
/* flush the data from the cache */
ret = posix_fadvise(f, discard_offset, discard_size, POSIX_FADV_DONTNEED);
if (ret == ENOSYS) {
/* call is not supported, like in armhf, see posix_fadvise manpage */
ret = 0;
}
/* for POSIX_FADV_DONTNEED we don't allow failure with ENOSYS */
if (ret != 0) {
/* LCOV_EXCL_START */
errno = ret; /* posix_fadvise return the error code */
@ -1151,10 +1148,7 @@ int advise_read(struct advise_struct* advise, int f, data_off_t offset, data_off
/* flush the data from the cache */
ret = posix_fadvise(f, offset, size, POSIX_FADV_DONTNEED);
if (ret == ENOSYS) {
/* call is not supported, like in armhf, see posix_fadvise manpage */
ret = 0;
}
/* for POSIX_FADV_DONTNEED we don't allow failure with ENOSYS */
if (ret != 0) {
/* LCOV_EXCL_START */
errno = ret; /* posix_fadvise return the error code */