[pnfs] CVS: nfsv4

Iyer, Rahul Rahul.Iyer at netapp.com
Wed Jul 12 17:11:43 EDT 2006


Hey!
Here it is...
Thanks
Rahul

<----patch start---->

Index: fs/nfs/nfs4filelayout.c
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/fs/nfs/nfs4filelayout.c,v
retrieving revision 1.22
diff -r1.22 nfs4filelayout.c
154a155,196
>
> /* This function is used by the layout driver to caclulate the
>  * offset of the file on the dserver based on whether the
>  * layout type is STRIPE_DENSE or STRIPE_SPARSE
>  */
> loff_t
> filelayout_get_dserver_offset(loff_t offset, struct nfs4_filelayout *
layout)
> {
>       BUG_ON(layout == NULL);
>
>       switch (layout->stripe_type) {
>               case STRIPE_SPARSE:
>                       return offset;
>
>               case STRIPE_DENSE:
>               {
>                       u32 stripe_size;
>                       u32 stripe_unit;
>                       loff_t off;
>                       loff_t tmp;
>                       u32 stripe_unit_idx;
>
>                       stripe_size = layout->stripe_unit *
layout->num_devs;
>                       /* XXX I do this because do_div seems to take a
32 bit dividend */
>                       stripe_unit = layout->stripe_unit;
>                       tmp = off = offset;
>
>                       do_div(off, stripe_size);
>                       stripe_unit_idx = do_div(tmp, stripe_unit);
>
>                       return off * stripe_unit + stripe_unit_idx;
>               }
>
>               default:
>                       BUG();
>       }
>
>       /* We should never get here... just to stop the gcc warning */
>       return 0;
> }
>
>
196a239,245
>
>               /* Now get the file offset on the dserver
>                * Set the read offset to this offset, and
>                * save the original offset in orig_offset
>                */
>               data->args.offset =
filelayout_get_dserver_offset(offset, nfslay);
>               data->orig_offset = offset;
202a252
>
206a257,259
>
>               /* In the case of synchronous reads, we reset the offset
here */
>               data->args.offset = data->orig_offset;
209a263,265
>               /* In the case of aync reads, the offset will be reset
in the
>                * call_ops->rpc_call_done() routine
>                */
253a310,316
>         /* Now get the file offset on the dserver
>          * Set the write offset to this offset, and
>          * save the original offset in orig_offset
>          */
>         data->args.offset = filelayout_get_dserver_offset(offset,
nfslay);
>         data->orig_offset = offset;
>
262a326,328
>
>                 /* In the case of synchronous writes, we reset the
offset here */
>                 data->args.offset = data->orig_offset;
265a332,334
>                 /* In the case of aync writes, the offset will be
reset in the
>                  * call_ops->rpc_call_done() routine
>                  */
Index: fs/nfs/nfs4filelayout.h
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/fs/nfs/nfs4filelayout.h,v
retrieving revision 1.3
diff -r1.3 nfs4filelayout.h
21a22,26
> enum stripetype4 {
>         STRIPE_SPARSE = 1,
>         STRIPE_DENSE = 2
> };
>
Index: fs/nfs/read.c
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/fs/nfs/read.c,v
retrieving revision 1.13
diff -r1.13 read.c
526a527,534
> #ifdef CONFIG_NFS_V4
>       /* Restore the data->args->offset pointer to the actual offset
>        * if it was changed
>        */
>       if (data->orig_offset)
>               data->args.offset = data->orig_offset;
> #endif
>
569a578,585
>
> #ifdef CONFIG_NFS_V4
>         /* Restore the data->args->offset pointer to the actual offset
>          * if it was changed
>          */
>         if (data->orig_offset)
>                 data->args.offset = data->orig_offset;
> #endif
Index: fs/nfs/write.c
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/fs/nfs/write.c,v
retrieving revision 1.24
diff -r1.24 write.c
1222a1223,1230
> #ifdef CONFIG_NFS_V4
>         /* Restore the data->args->offset pointer to the actual offset
>          * if it was changed
>          */
>         if (data->orig_offset)
>                 data->args.offset = data->orig_offset;
> #endif
>
1313a1322,1329
>
> #ifdef CONFIG_NFS_V4
>         /* Restore the data->args->offset pointer to the actual offset
>          * if it was changed
>          */
>         if (data->orig_offset)
>                 data->args.offset = data->orig_offset;
> #endif
Index: include/linux/nfs_xdr.h
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/include/linux/nfs_xdr.h,v
retrieving revision 1.13
diff -r1.13 nfs_xdr.h
702a703
>       __u64                   orig_offset;
729a731
>       __u64                   orig_offset;

<----end patch----> 

-----Original Message-----
From: Dean Hildebrand [mailto:dhildebz at eecs.umich.edu] 
Sent: Wednesday, July 12, 2006 1:24 PM
To: Rahul Iyer (NetApp)
Cc: pnfs at linux-nfs.org
Subject: Re: [pnfs] CVS: nfsv4

Hi Rahul,

Can you send out your patch for this as well?

Thanks,
Dean

Rahul Iyer (NetApp) wrote:
> CVSROOT:	/cvs
> Module name:	nfsv4
> Changes by:	iyer at citi.	2006/07/11 21:47:01
>
> Modified files:
> 	cvs/pnfs/fs/nfs: nfs4filelayout.c nfs4filelayout.h read.c 
> 	                 write.c 
> 	cvs/pnfs/include/linux: nfs_xdr.h
>
> Log message:
> Added code to support dense file layouts for the pnfs file layout 
> driver
>
> _______________________________________________
> pNFS mailing list
> pNFS at linux-nfs.org
> http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs
>   

--
Dean Hildebrand
Ph.D. Candidate
University of Michigan

_______________________________________________
pNFS mailing list
pNFS at linux-nfs.org
http://linux-nfs.org/cgi-bin/mailman/listinfo/pnfs


More information about the pNFS mailing list