adaptation of previous commits for 3.0 kernel