Skip to content

Commit

Permalink
md: add __acquires/__releases annotations to (un)lock_two_stripes
Browse files Browse the repository at this point in the history
This tells sparse that we acquire/release the two stripe locks and
avoids a warning.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Song Liu <songliubraving@fb.com>
  • Loading branch information
Christoph Hellwig authored and Song Liu committed Apr 10, 2019
1 parent 2b598ee commit 368ecad
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,8 @@ static bool is_full_stripe_write(struct stripe_head *sh)
}

static void lock_two_stripes(struct stripe_head *sh1, struct stripe_head *sh2)
__acquires(&sh1->stripe_lock)
__acquires(&sh2->stripe_lock)
{
if (sh1 > sh2) {
spin_lock_irq(&sh2->stripe_lock);
Expand All @@ -722,6 +724,8 @@ static void lock_two_stripes(struct stripe_head *sh1, struct stripe_head *sh2)
}

static void unlock_two_stripes(struct stripe_head *sh1, struct stripe_head *sh2)
__releases(&sh1->stripe_lock)
__releases(&sh2->stripe_lock)
{
spin_unlock(&sh1->stripe_lock);
spin_unlock_irq(&sh2->stripe_lock);
Expand Down

0 comments on commit 368ecad

Please sign in to comment.