diff options
author | Mikulas Patocka <mpatocka@redhat.com> | 2012-12-21 15:23:33 -0500 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2012-12-21 15:23:33 -0500 |
commit | 9aa0c0e60ffc2594acaad23127dbea9f3b61821c (patch) | |
tree | 4464d72c53cc977dea9ddf071ed8d88ee6c312d9 /drivers/md | |
parent | 19cbbc60c680e2e404bf55458ad2c4ff60d16076 (diff) |
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>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-snap.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index a143921feaf6..223e7ebf24f7 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c | |||
@@ -198,14 +198,13 @@ static struct dm_snap_tracked_chunk *track_chunk(struct dm_snapshot *s, | |||
198 | { | 198 | { |
199 | struct dm_snap_tracked_chunk *c = mempool_alloc(s->tracked_chunk_pool, | 199 | struct dm_snap_tracked_chunk *c = mempool_alloc(s->tracked_chunk_pool, |
200 | GFP_NOIO); | 200 | GFP_NOIO); |
201 | unsigned long flags; | ||
202 | 201 | ||
203 | c->chunk = chunk; | 202 | c->chunk = chunk; |
204 | 203 | ||
205 | spin_lock_irqsave(&s->tracked_chunk_lock, flags); | 204 | spin_lock_irq(&s->tracked_chunk_lock); |
206 | hlist_add_head(&c->node, | 205 | hlist_add_head(&c->node, |
207 | &s->tracked_chunk_hash[DM_TRACKED_CHUNK_HASH(chunk)]); | 206 | &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); |
209 | 208 | ||
210 | return c; | 209 | return c; |
211 | } | 210 | } |