summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-08-24 20:17:51 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-08-24 20:17:51 +0200
commit5c340eee0020717c793fd9d7e74e5f065225a8f3 (patch)
treea05a7e0bfc55a962461b63fbe1dda4232734b207
parent014124ef6c43f2eadbf07318c03691c5305b6183 (diff)
downloadcryptodev-linux-5c340eee0020717c793fd9d7e74e5f065225a8f3.tar.gz
cryptodev-linux-5c340eee0020717c793fd9d7e74e5f065225a8f3.tar.xz
cryptodev-linux-5c340eee0020717c793fd9d7e74e5f065225a8f3.zip
Provide file_operations::unlocked_ioctl.
file_operations::ioctl is no longer supported in recent kernels. compat_ioctl is not running under the BKL, so the code has to do its own locking anyway (although not everything currently does).
-rw-r--r--cryptodev_main.c9
-rw-r--r--ncr-int.h2
-rw-r--r--ncr.c2
3 files changed, 6 insertions, 7 deletions
diff --git a/cryptodev_main.c b/cryptodev_main.c
index da75672..541f177 100644
--- a/cryptodev_main.c
+++ b/cryptodev_main.c
@@ -768,9 +768,8 @@ clonefd(struct file *filp)
return ret;
}
-static int
-cryptodev_ioctl(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg_)
+static long
+cryptodev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg_)
{
void __user *arg = (void __user *)arg_;
int __user *p = arg;
@@ -907,7 +906,7 @@ cryptodev_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg_)
case CIOCASYMFEAT:
case CRIOGET:
case CIOCFSESSION:
- return cryptodev_ioctl(NULL, file, cmd, arg_);
+ return cryptodev_ioctl(file, cmd, arg_);
case COMPAT_CIOCGSESSION:
if (unlikely(copy_from_user(&compat_sop, arg,
@@ -955,7 +954,7 @@ static const struct file_operations cryptodev_fops = {
.owner = THIS_MODULE,
.open = cryptodev_open,
.release = cryptodev_release,
- .ioctl = cryptodev_ioctl,
+ .unlocked_ioctl = cryptodev_ioctl,
#ifdef CONFIG_COMPAT
.compat_ioctl = cryptodev_compat_ioctl,
#endif /* CONFIG_COMPAT */
diff --git a/ncr-int.h b/ncr-int.h
index 53df9df..6277619 100644
--- a/ncr-int.h
+++ b/ncr-int.h
@@ -104,7 +104,7 @@ struct ncr_lists {
void* ncr_init_lists(void);
void ncr_deinit_lists(struct ncr_lists *lst);
-int ncr_ioctl(struct ncr_lists *lst, unsigned int cmd, unsigned long arg);
+long ncr_ioctl(struct ncr_lists *lst, unsigned int cmd, unsigned long arg);
/* key derivation */
int ncr_key_derive(struct ncr_lists *lst, void __user* arg);
diff --git a/ncr.c b/ncr.c
index 81e3fa3..615b29d 100644
--- a/ncr.c
+++ b/ncr.c
@@ -116,7 +116,7 @@ struct ncr_master_key_st st;
return 0;
}
-int
+long
ncr_ioctl(struct ncr_lists *lst, unsigned int cmd, unsigned long arg_)
{
void __user *arg = (void __user *)arg_;