mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 19:01:57 -04:00
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:
parent
b86e06f415
commit
d65450dda8
1 changed files with 2 additions and 8 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue