mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-05 06:10:13 -05:00
Some comments about the use of posix_advise().
This commit is contained in:
parent
81f14d1dfb
commit
637789d11b
3 changed files with 20 additions and 3 deletions
8
handle.c
8
handle.c
|
|
@ -256,6 +256,11 @@ int handle_read(struct snapraid_handle* handle, struct snapraid_block* block, un
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Here isn't needed to call posix_fadvise(..., POSIX_FADV_DONTNEED) because */
|
||||
/* we already advised sequential access with POSIX_FADV_SEQUENTIAL. */
|
||||
/* In Linux 2.6.33 it's enough to ensure that data is not kept in the cache. */
|
||||
/* Better to do nothing and save a syscall for each block. */
|
||||
|
||||
return read_size;
|
||||
}
|
||||
|
||||
|
|
@ -284,6 +289,9 @@ int handle_write(struct snapraid_handle* handle, struct snapraid_block* block, u
|
|||
return -1;
|
||||
}
|
||||
|
||||
/* Here doesn't make sense to call posix_fadvise(..., POSIX_FADV_DONTNEED) because */
|
||||
/* at this time the data is still in not yet written and it cannot be discharged. */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue