mirror of
https://github.com/amadvance/snapraid.git
synced 2026-12-05 14:20:05 -05:00
Adds a new file_mode setting to control the access flags.
This commit is contained in:
parent
6d4d75ad0b
commit
d1d4abaf31
10 changed files with 53 additions and 29 deletions
|
|
@ -70,7 +70,7 @@ static void import_file(struct snapraid_state* state, const char* path, uint64_t
|
|||
/* open for read */
|
||||
/* O_SEQUENTIAL: opening in sequential mode in Windows */
|
||||
flags = O_RDONLY | O_BINARY;
|
||||
if (!state->opt.skip_sequential)
|
||||
if ((state->file_mode & MODE_SEQUENTIAL) != 0)
|
||||
flags |= O_SEQUENTIAL;
|
||||
f = open(path, flags);
|
||||
if (f == -1) {
|
||||
|
|
@ -81,7 +81,7 @@ static void import_file(struct snapraid_state* state, const char* path, uint64_t
|
|||
}
|
||||
|
||||
#if HAVE_POSIX_FADVISE
|
||||
if (!state->opt.skip_sequential) {
|
||||
if ((state->file_mode & MODE_SEQUENTIAL) != 0) {
|
||||
/* advise sequential access */
|
||||
ret = posix_fadvise(f, 0, 0, POSIX_FADV_SEQUENTIAL);
|
||||
if (ret != 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue