title: How to get the "file name" from struct file* in the kernel?
body: <p>I want to know on what file in <code>/sys/*</code> the function<code>static ssize_t
  sysfs_write_file(struct file *file, const char __user *buf, size_t count, loff_t *ppos)</code> were called. the question is how to get the file name/path by having <code>struct file *file</code> ?</p>
  
  <pre><code>struct file {
    mode_t f_mode;
    loff_t f_pos;
    unsigned short f_flags;
    unsigned short f_count;
    unsigned long f_reada, f_ramax, f_raend, f_ralen, f_rawin;
    struct file *f_next, *f_prev;
    int f_owner;         /* pid or -pgrp where SIGIO should be sent */
    struct inode * f_inode;
    struct file_operations * f_op;
    unsigned long f_version;
    void *private_data;  /* needed for tty driver, and maybe others */
  };
  </code></pre>
  
  <hr>
  
  <p><em><strong>EDIT:</em></strong>
  I understand there is no one-to-one mapping between inode to a name, but I must know the major/minor/file descriptor and can search for some of the inode's name in the file system.</p>