Use F_DEPTH() in place of dir.depth.