lkml.org 
[lkml]   [2010]   [Aug]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/6] btrfs: update stats when allocating from a cluster
>>  	spin_unlock(&cluster->lock);
>>
>> + if (!ret)
>> + return 0;
>> +
>> + spin_lock(&block_group->tree_lock);
>> +
>> + block_group->free_space -= bytes;
>> + if (entry->bytes == 0) {
>> + block_group->free_extents--;
>> + kfree(entry);
>> + }
>> +
>> + spin_unlock(&block_group->tree_lock);
>> +
>
> Move this part up so we don't drop the spinlock and then re-grab it. Thanks,
>

But they are 2 different locks. ;)

And we can't grab block_group->tree_lock when holding cluster->lock.


\
 
 \ /
  Last update: 2010-08-24 02:49    [W:0.396 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site