[OpenAFS] Re: openafs and linux 2.6.19-rc1 [patch]

Alex Romosan romosan@sycorax.lbl.gov
Thu, 05 Oct 2006 20:25:18 -0700


Alex Romosan <romosan@sycorax.lbl.gov> writes:

> the new linux kernel has lost a couple more functions which affect
> openafs (generic_file_read/write). the attached patch lets me use
> openafs with the above-mentioned kernel. it is generated against the
> debian package (which finally works on amd64, yeay) but it applies
> against cvs head with a bit of fuzz.
>
> diff -ru openafs/src/afs/LINUX/osi_vfsops.c openafs-new/src/afs/LINUX/osi_vfsops.c
> --- openafs/src/afs/LINUX/osi_vfsops.c	2006-08-19 22:34:18.000000000 -0700
> +++ openafs-new/src/afs/LINUX/osi_vfsops.c	2006-10-05 16:45:36.000000000 -0700
> @@ -312,8 +312,9 @@
>  void
>  afs_destroy_inodecache(void)
>  {
> -    if (kmem_cache_destroy(afs_inode_cachep))
> -	printk(KERN_INFO "afs_inode_cache: not all structures were freed\n");
> +/*    if (kmem_cache_destroy(afs_inode_cachep))
> +	printk(KERN_INFO "afs_inode_cache: not all structures were freed\n");*/
> +    kmem_cache_destroy(afs_inode_cachep);
>  }
>  #else
>  int
> diff -ru openafs/src/afs/LINUX/osi_vnodeops.c openafs-new/src/afs/LINUX/osi_vnodeops.c
> --- openafs/src/afs/LINUX/osi_vnodeops.c	2006-08-13 09:50:43.000000000 -0700
> +++ openafs-new/src/afs/LINUX/osi_vnodeops.c	2006-10-05 19:04:33.000000000 -0700
> @@ -75,7 +75,7 @@
>      else {
>  	    osi_FlushPages(vcp, credp);	/* ensure stale pages are gone */
>  	    AFS_GUNLOCK();
> -	    code = generic_file_read(fp, buf, count, offp);
> +	    code = do_sync_read(fp, buf, count, offp);
>  	    AFS_GLOCK();
>      }
>  
> @@ -121,7 +121,7 @@
>  	code = -code;
>      else {
>  	    AFS_GUNLOCK();
> -	    code = generic_file_write(fp, buf, count, offp);
> +	    code = do_sync_write(fp, buf, count, offp);
>  	    AFS_GLOCK();
>      }
>  
> @@ -565,6 +565,7 @@
>  struct file_operations afs_file_fops = {
>    .read =	afs_linux_read,
>    .write =	afs_linux_write,
> +  .aio_read = generic_file_aio_read,
>  #ifdef HAVE_UNLOCKED_IOCTL
>    .unlocked_ioctl = afs_unlocked_xioctl,
>  #else

sorry to follow up on my own post, but the above patch works only for
reads. for writes one also needs to add

  .aio_write = generic_file_aio_write,

below .aio_read above.

--alex--

-- 
| I believe the moment is at hand when, by a paranoiac and active |
|  advance of the mind, it will be possible (simultaneously with  |
|  automatism and other passive states) to systematize confusion  |
|  and thus to help to discredit completely the world of reality. |