[systemd-devel] [PATCH 1/3] blkio bandwidth: don't clean up all of entries in blockio_device_bandwidths list

Gao feng gaofeng at cn.fujitsu.com
Tue Sep 10 18:19:15 PDT 2013


On 09/10/2013 11:13 PM, Lennart Poettering wrote:
> On Fri, 30.08.13 10:56, Gao feng (gaofeng at cn.fujitsu.com) wrote:
> 
>> if we get BlockIOReadBandwidth="", we should only remove the
>> read-bandwidth-entries in blockio_device_bandwidths list.
> 
> Thanks! Applied, though with one change:
> 
>> +        read = streq("BlockIOReadBandwidth", lvalue);
>> +
>>          if (isempty(rvalue)) {
>> -                while (c->blockio_device_bandwidths)
>> -                        cgroup_context_free_blockio_device_bandwidth(c, c->blockio_device_bandwidths);
>> +                CGroupBlockIODeviceBandwidth *next;
>> +
>> +                LIST_FOREACH_SAFE (device_bandwidths, b, next, c->blockio_device_bandwidths) {
>> +                        if (b->read == read) {
>> +                                LIST_REMOVE(CGroupBlockIODeviceBandwidth, device_bandwidths, c->blockio_device_bandwidths, b);
>> +                                free(b->path);
>> +                                free(b);
> 
> I replaced the three previous lines with an invocation of
> cgroup_context_free_blockio_device_bandwidth() again.
> 
>

Thanks for your help!

Gao



More information about the systemd-devel mailing list