본문 바로가기
【Fundamental Tech】/→ 🐧Kernel

BKL-free 관련 이슈로 ioctl 인터페이스가 변경

반응형

BKL-free 관련 이슈로 ioctl 인터페이스가 2.6.35부터 변경되었다.

http://lwn.net/Articles/119652/ The new way of ioctl()
http://lwn.net/Articles/384855/ Might 2.6.35 be BKL-free?
http://lwn.net/Articles/406246/ BKL-free in 2.6.37 (maybe)


커널 버전에 따라 조건부 처리로 해결
https://bbs.archlinux.org/viewtopic.php?pid=862670
  1. static struct file_operations fops = {
  2.     .owner        = THIS_MODULE,
  3.     .read        = irctl_read,
  4.     .write        = irctl_write,
  5.     .poll        = irctl_poll,
  6. #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
  7.     .ioctl        = irctl_ioctl,
  8. #else
  9.     .unlocked_ioctl    = irctl_ioctl,
  10. #endif
  11. #ifdef CONFIG_COMPAT
  12.     .compat_ioctl    = irctl_compat_ioctl,
  13. #endif
  14.     .open        = irctl_open,
  15.     .release    = irctl_close
반응형