[linux-cifs-client] Backporting cifs 1.50 to an old kernel (2.6.11)

Seb James seb at esfnet.co.uk
Tue Feb 5 15:59:24 GMT 2008


On Tue, 2008-02-05 at 15:39 +0000, Seb James wrote:
> I downloaded cifs 1.50 and want to try backporting it to the rather
> ancient kernel 2.6.11.
> 
> First problem:
> 
> What to do about the mutexes in fs/cifs/file.c? For example in file.c
> line 877. This is new code compared with fs/cifs/file.c in kernel
> 2.6.11. file.c (and the rest of cifs) actually compiles if all the
> mutex_lock() and mutex_unlock() functions are commented out and I see
> there are several other locations in the code which deal with testing
> for particular kernel versions.
> 
> What to replace them with? Semaphores? What would the equivalent
> function call be for kernels < 2.6.17 (which I think is the version to
> which Ingo Molnar's mutex code was added)?

Ok, I just replaced mutex_lock() with down() if kernel version is <
2.6.17 and and mutex_unlock() with up(), but without considering what
the implications of this change would be. With the attached patch
applied, cifs 1.50 compiles and links on kernel 2.6.11. Whether or not
it will work is another matter of course.

Seb James.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file.c.patch
Type: text/x-patch
Size: 1585 bytes
Desc: not available
Url : http://lists.samba.org/archive/linux-cifs-client/attachments/20080205/d0f5dea3/file.c.bin


More information about the linux-cifs-client mailing list