Some restrictions on normalizers or centralizers in finite p-groups