title: 'ioctl' signature for device mapper
body: <p>The question may seem naive, but I'm new to kernel/driver programming. I created a device mapper over a block device, which is working fine. It's constructor/destructor and map methods are called.</p>
  
  <p>Now, I'm trying to write an ioctl for this mapper. When ioctl is written for a device, it has the following signature:</p>
  
  <pre><code>int ioctl(int d, /* other args */);
  </code></pre>
  
  <p>A file structure/descriptor is expected in ioctl. This can be easily used by application process as it has access to file.</p>
  
  <p>But the ioctl for device mapper has the following signature ( in <b>struct target_type</b>):</p>
  
  <pre><code>typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd,
               unsigned long arg);
  </code></pre>
  
  <p>How can user application get access to device mapper with ioctl without having knowledge of <b>struct dm_target</b> ?</p>