add same changes to pgdir_walk()