From: Tvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
To: Peng Yu <pengyu.ut@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Which one corresponds to ioctl in the file_operations struct in linux/fs.h?
Date: Thu, 1 Dec 2011 10:22:12 +0000 [thread overview]
Message-ID: <201112011022.12686.tvrtko.ursulin@onelan.co.uk> (raw)
In-Reply-To: <CABrM6wnDgRd0N5eSGffj51KR6-axAoFMNRWMZs2pFQ8dN94t0A@mail.gmail.com>
On Thursday 01 Dec 2011 07:40:49 Peng Yu wrote:
> Hi,
>
> I have some driver code for older version of kernel. It refers to
> ioctl in the file_operations struct. But this field is change in
> kernel 3.0.0-13
>
> I find the following in linux/fs.h
>
> 1566 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
> 1567 long (*compat_ioctl) (struct file *, unsigned int, unsigned long);
>
> Does anybody know which one I should use in order to migrate the
> driver code to the newer version of kernel? Thanks!
>From Documentation/filesystems/vfs.txt:
unlocked_ioctl: called by the ioctl(2) system call.
compat_ioctl: called by the ioctl(2) system call when 32 bit system calls
are used on 64 bit kernels.
You don't need compat_ioctl if your ioctl arguments are 32/64-bit safe.
For both your code needs to be re-entrant or take appropriate locks
internally.
Hope this helps,
Tvrtko
next prev parent reply other threads:[~2011-12-01 10:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-01 7:40 Peng Yu
2011-12-01 10:22 ` Tvrtko Ursulin [this message]
2011-12-01 12:45 ` Arnd Bergmann
2011-12-01 18:55 ` Peng Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201112011022.12686.tvrtko.ursulin@onelan.co.uk \
--to=tvrtko.ursulin@onelan.co.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=pengyu.ut@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome