|
@@ -5301,22 +5301,22 @@ static struct btrfs_bio *alloc_btrfs_bio(int total_stripes, int real_stripes)
|
|
|
GFP_NOFS|__GFP_NOFAIL);
|
|
|
|
|
|
atomic_set(&bbio->error, 0);
|
|
|
- atomic_set(&bbio->refs, 1);
|
|
|
+ refcount_set(&bbio->refs, 1);
|
|
|
|
|
|
return bbio;
|
|
|
}
|
|
|
|
|
|
void btrfs_get_bbio(struct btrfs_bio *bbio)
|
|
|
{
|
|
|
- WARN_ON(!atomic_read(&bbio->refs));
|
|
|
- atomic_inc(&bbio->refs);
|
|
|
+ WARN_ON(!refcount_read(&bbio->refs));
|
|
|
+ refcount_inc(&bbio->refs);
|
|
|
}
|
|
|
|
|
|
void btrfs_put_bbio(struct btrfs_bio *bbio)
|
|
|
{
|
|
|
if (!bbio)
|
|
|
return;
|
|
|
- if (atomic_dec_and_test(&bbio->refs))
|
|
|
+ if (refcount_dec_and_test(&bbio->refs))
|
|
|
kfree(bbio);
|
|
|
}
|
|
|
|