unlocked_ioctl vs normal ioctl

后端 未结 3 1642
难免孤独
难免孤独 2021-02-05 12:33

In my driver\'s file_operations structure, I have:

struct file_operations Fops = {
  read:    device_read,
  write:   device_write,
  unlocked_ioctl:   device_io         


        
3条回答
  •  半阙折子戏
    2021-02-05 12:49

    Read this LWN article: http://lwn.net/Articles/119652/

    Also sometime between 2.6.33 and a 2.6.35 rc (use git-diff to find out which commit) the kernel now WARNs when only .ioctl is defined.

    This is a move towards more explicit and fine-grained locking. Also note only changing the function signature and pointer will compile but will introduce the possibility of race conditions (two userspace apps doing ioctl calls at same time).

提交回复
热议问题