Effect of longitudinal magnetic fields on critical currents of type II superconductors