1) what's wrong with using middle bits of dentry as index? What the hell is that thing about pid for? 2) part in d_add_ci() might be worth a comment re d_lookup_done() coming for the original dentry, no matter what. 3) the dance with conditional __wake_up() is worth a helper, IMO.