Skip to content

Commit 176571a

Browse files
committed
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: David Sterba <[email protected]>
1 parent a81b747 commit 176571a

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

fs/btrfs/raid56.c

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -507,32 +507,21 @@ static void run_xor(void **pages, int src_cnt, ssize_t len)
507507
}
508508

509509
/*
510-
* returns true if the bio list inside this rbio
511-
* covers an entire stripe (no rmw required).
512-
* Must be called with the bio list lock held, or
513-
* at a time when you know it is impossible to add
514-
* new bios into the list
510+
* Returns true if the bio list inside this rbio covers an entire stripe (no
511+
* rmw required).
515512
*/
516-
static int __rbio_is_full(struct btrfs_raid_bio *rbio)
513+
static int rbio_is_full(struct btrfs_raid_bio *rbio)
517514
{
515+
unsigned long flags;
518516
unsigned long size = rbio->bio_list_bytes;
519517
int ret = 1;
520518

519+
spin_lock_irqsave(&rbio->bio_list_lock, flags);
521520
if (size != rbio->nr_data * rbio->stripe_len)
522521
ret = 0;
523-
524522
BUG_ON(size > rbio->nr_data * rbio->stripe_len);
525-
return ret;
526-
}
527-
528-
static int rbio_is_full(struct btrfs_raid_bio *rbio)
529-
{
530-
unsigned long flags;
531-
int ret;
532-
533-
spin_lock_irqsave(&rbio->bio_list_lock, flags);
534-
ret = __rbio_is_full(rbio);
535523
spin_unlock_irqrestore(&rbio->bio_list_lock, flags);
524+
536525
return ret;
537526
}
538527

0 commit comments

Comments
 (0)