title: get fd from file pointer in kernel space
body: <p>Given a struct file, is it possible to get the associated file descriptor in linux kernel space? I am trying to change permissions using either sys_chmod or sys_fchmod. One takes a file descriptor the other expects a filename from user space. I can figure out how to get the filename but how would I cast it to a user space pointer?</p>
  
  <p>Thanks</p>