modified pgdir_walk()