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

Jeff Layton jlayton at poochiereds.net
Tue Feb 5 23:25:32 GMT 2008


On Tue, 05 Feb 2008 21:00:21 +0000
Seb James <seb at esfnet.co.uk> wrote:

> On Tue, 2008-02-05 at 13:08 -0500, Jeff Layton wrote:
> > On Tue, 05 Feb 2008 15:59:24 +0000
> > Seb James <seb at esfnet.co.uk> wrote:
> > 
> > > 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.
> > 
> > I posted a patchset a month ago or so that contains some patches that I
> > needed to make that work with a 2.6.9 based kernel. See this email on
> > this list:
> > 
> >       Subject: [linux-cifs-client] a few patches for backported kernel
> > tarballs...
> > 
> > ...they may be helpful.
> 
> Yes, really helpful! That's great. I'll let you know if I notice any
> problems. Those four patches 0022... to 0025... applied ok with a few
> lines of offset on my 2.6.11 kernel. Compiled fine. I got lots of
> warnings from inode.c:
> 
> fs/cifs/inode.c: In function `cifs_get_inode_info_unix':
> fs/cifs/inode.c:203: warning: assignment discards qualifiers from pointer target type
> fs/cifs/inode.c:207: warning: assignment discards qualifiers from pointer target type
> ...etc
> 
> line 203 is this:
> 
>    inode->i_op = &cifs_file_inode_ops;
> 
> and also in readdir.c:
> 
> fs/cifs/readdir.c: In function `fill_in_inode':
> fs/cifs/readdir.c:293: warning: assignment discards qualifiers from pointer target type
> fs/cifs/readdir.c:296: warning: assignment discards qualifiers from pointer target type
> ...etc
> 
> Did you also see these warnings? I'll have a further look tomorrow.
> 

Yep. I think it's mostly differences in "const" declarations.

> Seb.
> 


-- 
Jeff Layton <jlayton at poochiereds.net>


More information about the linux-cifs-client mailing list