Add storage->instanceOfStorage() - stable6

Backport of #8778 

cc @DeepDiver1975 @PVince81