mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-20 15:06:34 -05:00
Add bandwidth limit feature --bw-limit
This commit is contained in:
parent
15a5fac6e9
commit
5886923bb1
19 changed files with 205 additions and 5 deletions
|
|
@ -261,6 +261,8 @@ int handle_read(struct snapraid_handle* handle, block_off_t file_pos, unsigned c
|
|||
|
||||
count = 0;
|
||||
do {
|
||||
bw_limit(handle->bw, block_size - count);
|
||||
|
||||
/* read the full block to support O_DIRECT */
|
||||
read_ret = pread(handle->f, block_buffer + count, block_size - count, offset + count);
|
||||
if (read_ret < 0) {
|
||||
|
|
@ -372,6 +374,7 @@ struct snapraid_handle* handle_mapping(struct snapraid_state* state, unsigned* h
|
|||
handle[j].file = 0;
|
||||
handle[j].f = -1;
|
||||
handle[j].valid_size = 0;
|
||||
handle[j].bw = 0;
|
||||
}
|
||||
|
||||
/* set the vector */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue