Remove lock_kernel/unlock_kernel from cfs_daemonize.
Remove HAVE_UNLOCKED_IOCTL check as it is defined after 2.6.12.
Signed-off-by: Liu Xuezhao <xuezhao.liu@emc.com>
Change-Id: I6e41c0c3fa76c33dae4f820a63bd3ba62ff704ec
Reviewed-on: http://review.whamcloud.com/2950
Tested-by: Hudson
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
if (in_interrupt()) {
cfs_trace_debug_print();
} else {
- while (current->lock_depth >= 0)
- unlock_kernel();
-
+# ifdef HAVE_KERNEL_LOCKED
+ while (kernel_locked())
+ unlock_kernel();
+# endif
libcfs_debug_dumplog_internal((void *)(long)cfs_curproc_pid());
}
#endif
return rc;
}
-
-#ifdef HAVE_UNLOCKED_IOCTL
static long libcfs_ioctl(struct file *file,
- unsigned int cmd, unsigned long arg)
-#else
-static int libcfs_ioctl(struct inode *inode, struct file *file,
- unsigned int cmd, unsigned long arg)
-#endif
+ unsigned int cmd, unsigned long arg)
{
struct cfs_psdev_file pfile;
int rc = 0;
}
static struct file_operations libcfs_fops = {
-#ifdef HAVE_UNLOCKED_IOCTL
- unlocked_ioctl: libcfs_ioctl,
-#else
- ioctl: libcfs_ioctl,
-#endif
- open : libcfs_psdev_open,
- release : libcfs_psdev_release
+ unlocked_ioctl: libcfs_ioctl,
+ open : libcfs_psdev_open,
+ release : libcfs_psdev_release
};
cfs_psdev_t libcfs_dev = {
void cfs_daemonize(char *str) {
unsigned long flags;
- lock_kernel();
daemonize(str);
SIGNAL_MASK_LOCK(current, flags);
sigfillset(¤t->blocked);
RECALC_SIGPENDING;
SIGNAL_MASK_UNLOCK(current, flags);
- unlock_kernel();
}
int cfs_daemonize_ctxt(char *str) {
goto out_fd;
}
- set_fs(KERNEL_DS);
-#ifdef HAVE_UNLOCKED_IOCTL
- if (sock_filp->f_op->unlocked_ioctl)
- rc = sock_filp->f_op->unlocked_ioctl(sock_filp, cmd, arg);
-#else
- lock_kernel();
- rc = sock_filp->f_op->ioctl(sock_filp->f_dentry->d_inode,
- sock_filp, cmd, arg);
- unlock_kernel();
-#endif
- set_fs(oldmm);
+ set_fs(KERNEL_DS);
+ if (sock_filp->f_op->unlocked_ioctl)
+ rc = sock_filp->f_op->unlocked_ioctl(sock_filp, cmd, arg);
+ set_fs(oldmm);
fput(sock_filp);
}
/* to control /dev/obd */
-#ifdef HAVE_UNLOCKED_IOCTL
static long obd_class_ioctl(struct file *filp, unsigned int cmd,
- unsigned long arg)
-#else
-static int obd_class_ioctl(struct inode *inode, struct file *filp,
- unsigned int cmd, unsigned long arg)
-#endif
+ unsigned long arg)
{
int err = 0;
ENTRY;
/* declare character device */
static struct file_operations obd_psdev_fops = {
- .owner = THIS_MODULE,
-#if HAVE_UNLOCKED_IOCTL
- .unlocked_ioctl = obd_class_ioctl, /* unlocked_ioctl */
-#else
- .ioctl = obd_class_ioctl, /* ioctl */
-#endif
- .open = obd_class_open, /* open */
- .release = obd_class_release, /* release */
+ .owner = THIS_MODULE,
+ .unlocked_ioctl = obd_class_ioctl, /* unlocked_ioctl */
+ .open = obd_class_open, /* open */
+ .release = obd_class_release, /* release */
};
/* modules setup */