Commit 176571a1 authored by David Sterba's avatar David Sterba

btrfs: raid56: merge rbio_is_full helpers

There's only one call site of the unlocked helper so it can be folded
into the caller.
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent a81b747d
...@@ -507,32 +507,21 @@ static void run_xor(void **pages, int src_cnt, ssize_t len) ...@@ -507,32 +507,21 @@ static void run_xor(void **pages, int src_cnt, ssize_t len)
} }
/* /*
* returns true if the bio list inside this rbio * Returns true if the bio list inside this rbio covers an entire stripe (no
* covers an entire stripe (no rmw required). * rmw required).
* Must be called with the bio list lock held, or
* at a time when you know it is impossible to add
* new bios into the list
*/ */
static int __rbio_is_full(struct btrfs_raid_bio *rbio) static int rbio_is_full(struct btrfs_raid_bio *rbio)
{ {
unsigned long flags;
unsigned long size = rbio->bio_list_bytes; unsigned long size = rbio->bio_list_bytes;
int ret = 1; int ret = 1;
spin_lock_irqsave(&rbio->bio_list_lock, flags);
if (size != rbio->nr_data * rbio->stripe_len) if (size != rbio->nr_data * rbio->stripe_len)
ret = 0; ret = 0;
BUG_ON(size > rbio->nr_data * rbio->stripe_len); BUG_ON(size > rbio->nr_data * rbio->stripe_len);
return ret;
}
static int rbio_is_full(struct btrfs_raid_bio *rbio)
{
unsigned long flags;
int ret;
spin_lock_irqsave(&rbio->bio_list_lock, flags);
ret = __rbio_is_full(rbio);
spin_unlock_irqrestore(&rbio->bio_list_lock, flags); spin_unlock_irqrestore(&rbio->bio_list_lock, flags);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment