Fix the "too many fcntl locks" scalability problem raised by tridge.