rem: if (!list_empty(&sf->write_req_list)) { curr_list = sf->write_req_list.prev; list_del(&sf->write_req_list); list_init(&sf->write_req_list); list_add(&write_req_list, curr_list); while (!list_empty(&write_req_list)) pthread_cond_wait(&sf->write_req_finished, &lock);
add: if (!list_empty(&sf->write_reqs)) { curr_list = sf->write_reqs.prev; list_del(&sf->write_reqs); list_init(&sf->write_reqs); list_add(&write_reqs, curr_list); while (!list_empty(&write_reqs)) pthread_cond_wait(&sf->write_finished, &lock);
context: static int sshfs_flush(const char *path, struct fuse_file_info *fi){    int err;    struct sshfs_file *sf = (struct sshfs_file *) fi->fh;    struct list_head write_req_list;    struct list_head *curr_list;    if (sync_write)        return 0;    (void) path;    pthread_mutex_lock(&lock);    if (!list_empty(&sf->write_req_list)) {        curr_list = sf->write_req_list.prev;        list_del(&sf->write_req_list);        list_init(&sf->write_req_list);        list_add(&write_req_list, curr_list);        while (!list_empty(&write_req_list))            pthread_cond_wait(&sf->write_req_finished, &lock);    }    err = sf->write_error;    sf->write_error = 0;    pthread_mutex_unlock(&lock);    return err;}