aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-24 11:01:10 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-24 11:01:10 -0400
commitf13771187b9423b824f32518319f6da85d819003 (patch)
treec431cf16c286065a302d5f3fb43fc1abac7e4047 /drivers/char/ipmi
parent15953654cc312429740fd58fb37a5a3d63a54376 (diff)
parent9f37af654fda88a8dcca74c785f6c20e52758866 (diff)
Merge branch 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing
* 'bkl/ioctl' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/random-tracing: uml: Pushdown the bkl from harddog_kern ioctl sunrpc: Pushdown the bkl from sunrpc cache ioctl sunrpc: Pushdown the bkl from ioctl autofs4: Pushdown the bkl from ioctl uml: Convert to unlocked_ioctls to remove implicit BKL ncpfs: BKL ioctl pushdown coda: Clean-up whitespace problems in pioctl.c coda: BKL ioctl pushdown drivers: Push down BKL into various drivers isdn: Push down BKL into ioctl functions scsi: Push down BKL into ioctl functions dvb: Push down BKL into ioctl functions smbfs: Push down BKL into ioctl function coda/psdev: Remove BKL from ioctl function um/mmapper: Remove BKL usage sn_hwperf: Kill BKL usage hfsplus: Push down BKL into ioctl function
Diffstat (limited to 'drivers/char/ipmi')
-rw-r--r--drivers/char/ipmi/ipmi_devintf.c26
-rw-r--r--drivers/char/ipmi/ipmi_watchdog.c17
2 files changed, 36 insertions, 7 deletions
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index 65545de3dbf4..d8ec92a38980 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -228,8 +228,7 @@ static int handle_send_req(ipmi_user_t user,
228 return rv; 228 return rv;
229} 229}
230 230
231static int ipmi_ioctl(struct inode *inode, 231static int ipmi_ioctl(struct file *file,
232 struct file *file,
233 unsigned int cmd, 232 unsigned int cmd,
234 unsigned long data) 233 unsigned long data)
235{ 234{
@@ -630,6 +629,23 @@ static int ipmi_ioctl(struct inode *inode,
630 return rv; 629 return rv;
631} 630}
632 631
632/*
633 * Note: it doesn't make sense to take the BKL here but
634 * not in compat_ipmi_ioctl. -arnd
635 */
636static long ipmi_unlocked_ioctl(struct file *file,
637 unsigned int cmd,
638 unsigned long data)
639{
640 int ret;
641
642 lock_kernel();
643 ret = ipmi_ioctl(file, cmd, data);
644 unlock_kernel();
645
646 return ret;
647}
648
633#ifdef CONFIG_COMPAT 649#ifdef CONFIG_COMPAT
634 650
635/* 651/*
@@ -802,7 +818,7 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd,
802 if (copy_to_user(precv64, &recv64, sizeof(recv64))) 818 if (copy_to_user(precv64, &recv64, sizeof(recv64)))
803 return -EFAULT; 819 return -EFAULT;
804 820
805 rc = ipmi_ioctl(filep->f_path.dentry->d_inode, filep, 821 rc = ipmi_ioctl(filep,
806 ((cmd == COMPAT_IPMICTL_RECEIVE_MSG) 822 ((cmd == COMPAT_IPMICTL_RECEIVE_MSG)
807 ? IPMICTL_RECEIVE_MSG 823 ? IPMICTL_RECEIVE_MSG
808 : IPMICTL_RECEIVE_MSG_TRUNC), 824 : IPMICTL_RECEIVE_MSG_TRUNC),
@@ -819,14 +835,14 @@ static long compat_ipmi_ioctl(struct file *filep, unsigned int cmd,
819 return rc; 835 return rc;
820 } 836 }
821 default: 837 default:
822 return ipmi_ioctl(filep->f_path.dentry->d_inode, filep, cmd, arg); 838 return ipmi_ioctl(filep, cmd, arg);
823 } 839 }
824} 840}
825#endif 841#endif
826 842
827static const struct file_operations ipmi_fops = { 843static const struct file_operations ipmi_fops = {
828 .owner = THIS_MODULE, 844 .owner = THIS_MODULE,
829 .ioctl = ipmi_ioctl, 845 .unlocked_ioctl = ipmi_unlocked_ioctl,
830#ifdef CONFIG_COMPAT 846#ifdef CONFIG_COMPAT
831 .compat_ioctl = compat_ipmi_ioctl, 847 .compat_ioctl = compat_ipmi_ioctl,
832#endif 848#endif
diff --git a/drivers/char/ipmi/ipmi_watchdog.c b/drivers/char/ipmi/ipmi_watchdog.c
index a4d57e31f713..82bcdb262a3a 100644
--- a/drivers/char/ipmi/ipmi_watchdog.c
+++ b/drivers/char/ipmi/ipmi_watchdog.c
@@ -659,7 +659,7 @@ static struct watchdog_info ident = {
659 .identity = "IPMI" 659 .identity = "IPMI"
660}; 660};
661 661
662static int ipmi_ioctl(struct inode *inode, struct file *file, 662static int ipmi_ioctl(struct file *file,
663 unsigned int cmd, unsigned long arg) 663 unsigned int cmd, unsigned long arg)
664{ 664{
665 void __user *argp = (void __user *)arg; 665 void __user *argp = (void __user *)arg;
@@ -730,6 +730,19 @@ static int ipmi_ioctl(struct inode *inode, struct file *file,
730 } 730 }
731} 731}
732 732
733static long ipmi_unlocked_ioctl(struct file *file,
734 unsigned int cmd,
735 unsigned long arg)
736{
737 int ret;
738
739 lock_kernel();
740 ret = ipmi_ioctl(file, cmd, arg);
741 unlock_kernel();
742
743 return ret;
744}
745
733static ssize_t ipmi_write(struct file *file, 746static ssize_t ipmi_write(struct file *file,
734 const char __user *buf, 747 const char __user *buf,
735 size_t len, 748 size_t len,
@@ -880,7 +893,7 @@ static const struct file_operations ipmi_wdog_fops = {
880 .read = ipmi_read, 893 .read = ipmi_read,
881 .poll = ipmi_poll, 894 .poll = ipmi_poll,
882 .write = ipmi_write, 895 .write = ipmi_write,
883 .ioctl = ipmi_ioctl, 896 .unlocked_ioctl = ipmi_unlocked_ioctl,
884 .open = ipmi_open, 897 .open = ipmi_open,
885 .release = ipmi_close, 898 .release = ipmi_close,
886 .fasync = ipmi_fasync, 899 .fasync = ipmi_fasync,