lib_log: also convert to brick_wait

This commit is contained in:
Thomas Schoebel-Theuer 2019-02-11 22:39:47 +01:00 committed by Thomas Schoebel-Theuer
parent e7fa3fa130
commit ad69d1cf79
3 changed files with 5 additions and 2 deletions

View File

@ -31,6 +31,7 @@
//#define IO_DEBUGGING
#include "lib_log.h"
#include "brick_wait.h"
atomic_t global_mref_flying = ATOMIC_INIT(0);
EXPORT_SYMBOL_GPL(global_mref_flying);
@ -133,8 +134,8 @@ void log_write_endio(struct generic_callback *cb)
put_log_cb_info(cb_info);
atomic_dec(&logst->mref_flying);
atomic_dec(&global_mref_flying);
if (logst->signal_event)
wake_up_interruptible(logst->signal_event);
if (logst->signal_event && logst->signal_flag)
brick_wake(logst->signal_event, *(logst->signal_flag));
return;

View File

@ -253,6 +253,7 @@ int log_scan(void *buf, int len, loff_t file_pos, int file_offset, bool sloppy,
struct log_status {
// interfacing
wait_queue_head_t *signal_event;
bool *signal_flag;
// tunables
loff_t start_pos;
loff_t end_pos;

View File

@ -2414,6 +2414,7 @@ void _init_input(struct trans_logger_input *input, loff_t start_pos, loff_t end_
init_logst(logst, (void*)input, start_pos, end_pos);
logst->signal_event = &brick->worker_event;
logst->signal_flag = &brick->worker_flag;
logst->align_size = CONF_TRANS_ALIGN;
logst->chunk_size = CONF_TRANS_CHUNKSIZE;
logst->max_size = CONF_TRANS_MAX_MREF_SIZE;