diff options
author | 2021-09-27 15:21:45 +0800 | |
---|---|---|
committer | 2021-10-26 19:08:03 +0200 | |
commit | 9e895a8f7e12326f6bd02e2910073d764320966b (patch) | |
tree | e2c2a9ff916d7c1b9db891e751b84e012bcf94fd /tools/perf/scripts/python/export-to-postgresql.py | |
parent | btrfs: remove unnecessary parameter delalloc_start for writepage_delalloc() (diff) | |
download | wireguard-linux-9e895a8f7e12326f6bd02e2910073d764320966b.tar.xz wireguard-linux-9e895a8f7e12326f6bd02e2910073d764320966b.zip |
btrfs: use async_chunk::async_cow to replace the confusing pending pointer
For structure async_chunk, we use a very strange member layout to grab
structure async_cow who owns this async_chunk.
At initialization, it goes like this:
async_chunk[i].pending = &ctx->num_chunks;
Then at async_cow_free() we do a super weird freeing:
/*
* Since the pointer to 'pending' is at the beginning of the array of
* async_chunk's, freeing it ensures the whole array has been freed.
*/
if (atomic_dec_and_test(async_chunk->pending))
kvfree(async_chunk->pending);
This is absolutely an abuse of kvfree().
Replace async_chunk::pending with async_chunk::async_cow, so that we can
grab the async_cow structure directly, without this strange dancing.
And with this change, there is no requirement for any specific member
location.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tools/perf/scripts/python/export-to-postgresql.py')
0 files changed, 0 insertions, 0 deletions