已有数据同步功能完成
This commit is contained in:
@@ -263,7 +263,7 @@ int kvs_hash_exist_bin(kvs_hash_t *hash, const void *key, uint32_t key_len) {
|
||||
}
|
||||
|
||||
// 0 suc, <0 error
|
||||
int kvs_hash_save(kvs_hash_t *inst, const char* filename){
|
||||
int kvs_hash_save(iouring_ctx_t *uring, kvs_hash_t *inst, const char* filename){
|
||||
if(!inst || !filename) return -1;
|
||||
int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);
|
||||
if(fd < 0) return -2;
|
||||
@@ -307,7 +307,7 @@ int kvs_hash_save(kvs_hash_t *inst, const char* filename){
|
||||
for (int i = 0; i < count; i++) total += lens[i];
|
||||
|
||||
|
||||
task_t *t = submit_write(&global_uring_ctx, fd, bufs, lens, count, current_off);
|
||||
task_t *t = submit_write(uring, fd, bufs, lens, count, current_off);
|
||||
|
||||
if (!t) { close(fd); return -4; }
|
||||
int res = task_wait(t);
|
||||
|
||||
Reference in New Issue
Block a user