--- ../../../alsa-kmirror/core/oss/pcm_oss.c	2009-04-08 12:30:58.000000000 +0200
+++ pcm_oss.c	2009-04-08 16:08:18.000000000 +0200
@@ -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>
@@ -1903,9 +1905,13 @@ static int snd_pcm_oss_set_fragment(stru
 
 static int snd_pcm_oss_nonblock(struct file * file)
 {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
 	spin_lock(&file->f_lock);
+#endif
 	file->f_flags |= O_NONBLOCK;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
 	spin_unlock(&file->f_lock);
+#endif
 	return 0;
 }
 
@@ -2617,13 +2623,26 @@ static long snd_pcm_oss_ioctl(struct fil
 	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;
@@ -2656,8 +2675,14 @@ static ssize_t snd_pcm_oss_write(struct
 	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(KERN_DEBUG "pcm_oss: write %li bytes (wrote %li bytes)\n",
 	       (long)count, (long)result);
@@ -2774,7 +2799,11 @@ static int snd_pcm_oss_mmap(struct file
 		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);
@@ -2954,14 +2983,20 @@ static void snd_pcm_oss_proc_done(struct
 
 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,
 };
 
@@ -3075,3 +3110,5 @@ static void __exit alsa_pcm_oss_exit(voi
 
 module_init(alsa_pcm_oss_init)
 module_exit(alsa_pcm_oss_exit)
+
+EXPORT_NO_SYMBOLS;
