add swapfile functions and mapping