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