From alsa-devel-owner@alsa.jcu.cz  Fri Mar 12 09:25:54 1999
Received: from entry.jcu.cz (IDENT:perex@entry.jcu.cz [160.217.1.111])
	by marvin.jcu.cz (8.9.1a/8.9.1) with SMTP id JAA17546;
	Fri, 12 Mar 1999 09:24:52 +0100
Date: Fri, 12 Mar 1999 09:24:52 +0100 (CET)
From: Jaroslav Kysela <perex@jcu.cz>
To: Paul Barton-Davis <pbd@op.net>
cc: alsa-devel@alsa.jcu.cz
Subject: Re: oss/mmap problem hint
In-Reply-To: <199903120606.BAA22498@op.net>
Message-ID: <Pine.LNX.3.96.990312092359.1133B-100000@entry.jcu.cz>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Reply-To: alsa-devel@alsa.jcu.cz
Sender: alsa-devel-owner@alsa.jcu.cz
Precedence: list

On Fri, 12 Mar 1999, Paul Barton-Davis wrote:

> just posted to linux-kernel, by Tigran Aivazian <tigran@aivazian.demon.co.uk>:
> 
> ---------------------------------------------------------------
> Ok, I have just fixed it.
> The problem was _not_ in the kernel (shame on me that I doubted Linus for
> even a microsecond!).
> 
> The bug is in the 3dfx_driver.c - in mmap_3dfx() function comment out the
> f_count++:
> 
> The code at the end should look like this:
> 
> #ifdef KERNEL_VER_2_1
>         vma->vm_file = file;
>         /* file->f_count++; */
> #else
>         vma->vm_inode = inode;
>         inode->i_count++;
> #endif
> 
> Until now it was ok because it was driver's responsibility to increment
> f_count, but now do_mmap() does it.
> ----------------------------------------------------------------------    

Thanks. I added following patch to the ALSA CVS tree:

Index: pcm1_oss.c
===================================================================
RCS file: /home/alsa/cvsroot/alsa-driver/kernel/pcm1/pcm1_oss.c,v
retrieving revision 1.21
diff -u -r1.21 pcm1_oss.c
--- pcm1_oss.c  1999/02/13 13:44:30     1.21
+++ pcm1_oss.c  1999/03/12 08:23:34
@@ -1945,7 +1945,9 @@
        inode->i_count++;
 #else
        vma->vm_file = file;
+#if LinuxVersionCode(2, 2, 3) > LINUX_VERSION_CODE
        file->f_count++;
+#endif
 #endif
        vma->vm_ops = &snd_pcm1_oss_vm_ops;
        MOD_INC_USE_COUNT;


						Jaroslav

-----
Jaroslav Kysela <perex@jcu.cz>
Academic Computer Centre, University of South Bohemia
Branisovska 31, C. Budejovice, CZ-370 05 Czech Republic


