Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[PATCH] dm: snapshot: abstract memory release

Move the code that releases memory used by a snapshot into a separate function.

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Milan Broz and committed by
Linus Torvalds
31c93a0c 45e15720

+12 -7
+12 -7
drivers/md/dm-snap.c
··· 564 564 return r; 565 565 } 566 566 567 + static void __free_exceptions(struct dm_snapshot *s) 568 + { 569 + kcopyd_client_destroy(s->kcopyd_client); 570 + s->kcopyd_client = NULL; 571 + 572 + exit_exception_table(&s->pending, pending_cache); 573 + exit_exception_table(&s->complete, exception_cache); 574 + 575 + s->store.destroy(&s->store); 576 + } 577 + 567 578 static void snapshot_dtr(struct dm_target *ti) 568 579 { 569 580 struct dm_snapshot *s = (struct dm_snapshot *) ti->private; ··· 585 574 /* After this returns there can be no new kcopyd jobs. */ 586 575 unregister_snapshot(s); 587 576 588 - kcopyd_client_destroy(s->kcopyd_client); 589 - 590 - exit_exception_table(&s->pending, pending_cache); 591 - exit_exception_table(&s->complete, exception_cache); 592 - 593 - /* Deallocate memory used */ 594 - s->store.destroy(&s->store); 577 + __free_exceptions(s); 595 578 596 579 dm_put_device(ti, s->origin); 597 580 dm_put_device(ti, s->cow);