--- ../../alsa-kernel/core/oss/pcm_oss.c	2007-12-20 10:19:07.000000000 +0100
+++ pcm_oss.c	2007-12-20 10:46:23.000000000 +0100
@@ -1,3 +1,4 @@
+#include "adriver.h"
 /*
  *  Digital Audio (PCM) abstract layer / OSS compatible
  *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
@@ -27,6 +28,7 @@
 #endif
 
 #include <linux/init.h>
+#include <linux/smp_lock.h>
 #include <linux/slab.h>
 #include <linux/time.h>
 #include <linux/vmalloc.h>
@@ -2588,13 +2590,26 @@
 	return -EINVAL;
 }
 
-#ifdef CONFIG_COMPAT
+#if defined(CONFIG_COMPAT) && defined(CONFIG_SND_HAVE_NEW_IOCTL)
 /* all compatible */
 #define snd_pcm_oss_ioctl_compat	snd_pcm_oss_ioctl
 #else
 #define snd_pcm_oss_ioctl_compat	NULL
 #endif
 
+#ifndef CONFIG_SND_HAVE_NEW_IOCTL
+/* need to unlock BKL to allow preemption */
+static int snd_pcm_oss_ioctl_old(struct inode *inode, struct file * file,
+				 unsigned int cmd, unsigned long arg)
+{
+	int err;
+	unlock_kernel();
+	err = snd_pcm_oss_ioctl(file, cmd, arg);
+	lock_kernel();
+	return err;
+}
+#endif
+
 static ssize_t snd_pcm_oss_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
 {
 	struct snd_pcm_oss_file *pcm_oss_file;
@@ -2626,8 +2641,14 @@
 	substream = pcm_oss_file->streams[SNDRV_PCM_STREAM_PLAYBACK];
 	if (substream == NULL)
 		return -ENXIO;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
+	up(&file->f_dentry->d_inode->i_sem);
+#endif
 	substream->f_flags = file->f_flags & O_NONBLOCK;
 	result = snd_pcm_oss_write1(substream, buf, count);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 0)
+	down(&file->f_dentry->d_inode->i_sem);
+#endif
 #ifdef OSS_DEBUG
 	printk("pcm_oss: write %li bytes (wrote %li bytes)\n", (long)count, (long)result);
 #endif
@@ -2743,7 +2764,11 @@
 		return -EIO;
 #endif
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 25)
 	if (area->vm_pgoff != 0)
+#else
+	if (area->vm_offset != 0)
+#endif
 		return -EINVAL;
 
 	err = snd_pcm_mmap_data(substream, file, area);
@@ -2922,14 +2947,20 @@
 
 static const struct file_operations snd_pcm_oss_f_reg =
 {
+#ifndef LINUX_2_2
 	.owner =	THIS_MODULE,
+#endif
 	.read =		snd_pcm_oss_read,
 	.write =	snd_pcm_oss_write,
 	.open =		snd_pcm_oss_open,
 	.release =	snd_pcm_oss_release,
 	.poll =		snd_pcm_oss_poll,
+#ifdef CONFIG_SND_HAVE_NEW_IOCTL
 	.unlocked_ioctl =	snd_pcm_oss_ioctl,
 	.compat_ioctl =	snd_pcm_oss_ioctl_compat,
+#else
+	.ioctl =	snd_pcm_oss_ioctl_old,
+#endif
 	.mmap =		snd_pcm_oss_mmap,
 };
 
@@ -3043,3 +3074,5 @@
 
 module_init(alsa_pcm_oss_init)
 module_exit(alsa_pcm_oss_exit)
+
+EXPORT_NO_SYMBOLS;
