Irreversibility in random-field ferromagnets and diluted antiferromagnets.