Commit 0c9084c
rbd: remove ensureImageCleanup and use ID-based trash removal
In DeleteTempImage(), use the volume's parent info (ParentImageID) to
identify a trashed temp clone by ID instead of scanning the trash list.
This works because cleanupRBDImage() calls DeleteTempImage() before
rbdVol.Delete(), so the child image still exists and GetParent() data
is valid.
When parent info is unavailable (temp clone not in trash), treat it as
already removed and return success.
Remove ensureImageCleanup() entirely - the O(n) GetTrashList scan is no
longer needed. All volume/snapshot image IDs are stored in OMAP at
creation time and backfilled by storeImageID() on first access, so
ImageID is always available for direct O(1) trash removal.
Assisted-by: Claude <noreply@anthropic.com>
Signed-off-by: Rakshith R <rar@redhat.com>1 parent 1529daf commit 0c9084c
1 file changed
Lines changed: 13 additions & 29 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
723 | 723 | | |
724 | 724 | | |
725 | 725 | | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | | - | |
732 | | - | |
733 | | - | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | | - | |
739 | | - | |
740 | | - | |
741 | | - | |
742 | | - | |
743 | | - | |
744 | | - | |
745 | | - | |
746 | | - | |
747 | | - | |
748 | | - | |
749 | | - | |
750 | | - | |
751 | 726 | | |
752 | 727 | | |
753 | 728 | | |
| |||
876 | 851 | | |
877 | 852 | | |
878 | 853 | | |
879 | | - | |
880 | | - | |
881 | | - | |
882 | | - | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
883 | 865 | | |
| 866 | + | |
| 867 | + | |
884 | 868 | | |
885 | 869 | | |
886 | 870 | | |
| |||
0 commit comments