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...
United States
Great Britain
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Singapore
Hungary
Ukraine
Luxembourg
Estonia
Lithuania
South Korea
Turkey
Switzerland
Colombia
Taiwan
Chile
Norway
Ecuador
Indonesia
New Zealand
Cyprus
Denmark
Finland
Poland
Malta
Czechia
Austria
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Netherlands
Bulgaria
Latvia
South Africa
Malaysia
Japan
Slovakia
Philippines
Mexico
Thailand