In the previous section, we saw that the kernel driver will have to initialize its file_operations structure to include the ioctl method. There is more to this, though: the Linux kernel keeps evolving; in early kernel versions, the developers used a very coarse granularity lock that, though it worked, quite severely hurt its performance (we will discuss locking in detail in Chapter 6, Kernel Synchronization - Part 1, and Chapter 7, Kernel Synchronization - Part 2). It was so bad that it was nicknamed the Big Kernel Lock (BKL)! The good news is that by kernel release 2.6.36, the developers got rid of this infamous lock. Doing so had some side effects, though: one of them was that the number of parameters that get sent to the ioctl method within the kernel and thus within our file_operations data structure changed from four to three with the newer method – christened unlocked_ioctl. Thus, for our demo driver, we will initialize...
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia