Skip to content

Commit 9aa0c0e

Browse files
Mikulas Patockakergon
authored andcommitted
dm snapshot: optimize track_chunk
track_chunk is always called with interrupts enabled. Consequently, we do not need to save and restore interrupt state in "flags" variable. This patch changes spin_lock_irqsave to spin_lock_irq and spin_unlock_irqrestore to spin_unlock_irq. Signed-off-by: Mikulas Patocka <mpatocka@redhat.com> Signed-off-by: Alasdair G Kergon <agk@redhat.com>
1 parent 19cbbc6 commit 9aa0c0e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/md/dm-snap.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,13 @@ static struct dm_snap_tracked_chunk *track_chunk(struct dm_snapshot *s,
198198
{
199199
struct dm_snap_tracked_chunk *c = mempool_alloc(s->tracked_chunk_pool,
200200
GFP_NOIO);
201-
unsigned long flags;
202201

203202
c->chunk = chunk;
204203

205-
spin_lock_irqsave(&s->tracked_chunk_lock, flags);
204+
spin_lock_irq(&s->tracked_chunk_lock);
206205
hlist_add_head(&c->node,
207206
&s->tracked_chunk_hash[DM_TRACKED_CHUNK_HASH(chunk)]);
208-
spin_unlock_irqrestore(&s->tracked_chunk_lock, flags);
207+
spin_unlock_irq(&s->tracked_chunk_lock);
209208

210209
return c;
211210
}

0 commit comments

Comments
 (0)