mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-21 23:46:27 -05:00
Support native advise modes in buffered streams
This commit is contained in:
parent
b762ab9e73
commit
d8ea998eb2
4 changed files with 80 additions and 54 deletions
|
|
@ -4,13 +4,14 @@
|
|||
#ifndef __STREAM_H
|
||||
#define __STREAM_H
|
||||
|
||||
#include "support.h"
|
||||
#include "util.h"
|
||||
|
||||
/****************************************************************************/
|
||||
/* stream */
|
||||
|
||||
#define STREAM_FLAGS_SEQUENTIAL 1 /**< Advise a squential read. */
|
||||
#define STREAM_FLAGS_CRC 2 /**< Enable the CRC computation. */
|
||||
#define STREAM_FLAGS_ADVISE_MASK 0xFF /**< Low bits containing one of ADVISE_*. */
|
||||
#define STREAM_FLAGS_CRC 0x100 /**< Enable the CRC computation. */
|
||||
|
||||
/**
|
||||
* Size of the buffer of the stream.
|
||||
|
|
@ -83,6 +84,8 @@ struct stream {
|
|||
* In writing, it's all the data wrote calling sput() functions.
|
||||
*/
|
||||
uint32_t crc_stream;
|
||||
|
||||
struct advise_struct* advise; /**< Cache advice state for each handle. */
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue