Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/sys/rump/fs/lib/libnfs



On Thu Oct 16 2008 at 19:27:09 +0000, Christos Zoulas wrote:
> Why not just this?

Furthermore, actually reading your patch, it isn't even compile tested ;)

> christos
> 
> Index: nfs_bio.c
> ===================================================================
> RCS file: /cvsroot/src/sys/nfs/nfs_bio.c,v
> retrieving revision 1.175
> diff -u -u -r1.175 nfs_bio.c
> --- nfs_bio.c 24 Apr 2008 15:35:31 -0000      1.175
> +++ nfs_bio.c 16 Oct 2008 19:26:51 -0000
> @@ -921,7 +921,7 @@
>       int iomode;
>       bool stalewriteverf = false;
>       int i, npages = (bp->b_bcount + PAGE_SIZE - 1) >> PAGE_SHIFT;
> -     struct vm_page *pgs[npages];
> +     struct vm_page *pgs;
>  #ifndef NFS_V2_ONLY
>       bool needcommit = true; /* need only COMMIT RPC */
>  #else
> @@ -938,6 +938,8 @@
>               iomode = NFSV3WRITE_FILESYNC;
>       }
>  
> +     pgs = malloc(sizeof(*pgs) * npages, M_TEMP, M_WAITOK);
> +
>  #ifndef NFS_V2_ONLY
>  again:
>  #endif
> @@ -1046,7 +1048,7 @@
>                       bp->b_error = np->n_error = error;
>                       np->n_flag |= NWRITEERR;
>               }
> -             return error;
> +             goto out;
>       }
>  #endif
>       off = uiop->uio_offset;
> @@ -1115,6 +1117,8 @@
>       if (stalewriteverf) {
>               nfs_clearcommit(vp->v_mount);
>       }
> +out:
> +     free(pgs, M_TEMP);
>       return error;
>  }
>  
> 


Home | Main Index | Thread Index | Old Index