On 16/01/2017 14:07, Fam Zheng wrote:
> On Fri, 01/13 14:17, Paolo Bonzini wrote:
>> diff --git a/block/qed.c b/block/qed.c
>> index 7f1c508..a21d025 100644
>> --- a/block/qed.c
>> +++ b/block/qed.c
>> @@ -345,10 +345,22 @@ static void qed_need_check_timer_cb(void *opaque)
>>  
>>      trace_qed_need_check_timer_cb(s);
>>  
>> +    qed_acquire(s);
>>      qed_plug_allocating_write_reqs(s);
>>  
>>      /* Ensure writes are on disk before clearing flag */
>>      bdrv_aio_flush(s->bs->file->bs, qed_clear_need_check, s);
>> +    qed_release(s);
>> +}
>> +
>> +void qed_acquire(BDRVQEDState *s)
>> +{
>> +    aio_context_acquire(bdrv_get_aio_context(s->bs));
>> +}
>> +
>> +void qed_release(BDRVQEDState *s)
>> +{
>> +    aio_context_release(bdrv_get_aio_context(s->bs));
>>  }
>>  
>>  static void qed_start_need_check_timer(BDRVQEDState *s)
>> diff --git a/block/qed.h b/block/qed.h
>> index 9676ab9..ce8c314 100644
>> --- a/block/qed.h
>> +++ b/block/qed.h
>> @@ -198,6 +198,9 @@ enum {
>>   */
>>  typedef void QEDFindClusterFunc(void *opaque, int ret, uint64_t offset, 
>> size_t len);
>>  
>> +void qed_acquire(BDRVQEDState *s);
>> +void qed_release(BDRVQEDState *s);
>> +
> 
> Why cannot these be local (static) functions, in block/qed.c?

Patch 13 uses them elsewhere.  Should I put them in a separate patch?

Paolo

>>  /**
>>   * Generic callback for chaining async callbacks
>>   */
> 
> Fam
> 
> 

Reply via email to