/* * Device operations for the pnfs nfs4 file layout driver. * * Copyright (c) 2002 * The Regents of the University of Michigan * All Rights Reserved * * Dean Hildebrand <[email protected]> * Garth Goodson <[email protected]> * * Permission is granted to use, copy, create derivative works, and * redistribute this software and such derivative works for any purpose, * so long as the name of the University of Michigan is not used in * any advertising or publicity pertaining to the use or distribution * of this software without specific, written prior authorization. If * the above copyright notice or any other identification of the * University of Michigan is included in any copy of any portion of * this software, then the disclaimer below must also be included. * * This software is provided as is, without representation or warranty * of any kind either express or implied, including without limitation * the implied warranties of merchantability, fitness for a particular * purpose, or noninfringement. The Regents of the University of * Michigan shall not be liable for any damages, including special, * indirect, incidental, or consequential damages, with respect to any * claim arising out of or in connection with the use of the software, * even if it has been or is hereafter advised of the possibility of * such damages. */ #include <linux/nfs_fs.h> #include <linux/vmalloc.h> #include <linux/module.h> #include "../internal.h" #include "../nfs4session.h" #include "filelayout.h" #include "../nfs4trace.h" #define NFSDBG_FACILITY … static unsigned int dataserver_timeo = …; static unsigned int dataserver_retrans = …; void nfs4_fl_free_deviceid(struct nfs4_file_layout_dsaddr *dsaddr) { … } /* Decode opaque device data and return the result */ struct nfs4_file_layout_dsaddr * nfs4_fl_alloc_deviceid_node(struct nfs_server *server, struct pnfs_device *pdev, gfp_t gfp_flags) { … } void nfs4_fl_put_deviceid(struct nfs4_file_layout_dsaddr *dsaddr) { … } /* * Want res = (offset - layout->pattern_offset)/ layout->stripe_unit * Then: ((res + fsi) % dsaddr->stripe_count) */ u32 nfs4_fl_calc_j_index(struct pnfs_layout_segment *lseg, loff_t offset) { … } u32 nfs4_fl_calc_ds_index(struct pnfs_layout_segment *lseg, u32 j) { … } struct nfs_fh * nfs4_fl_select_ds_fh(struct pnfs_layout_segment *lseg, u32 j) { … } /* Upon return, either ds is connected, or ds is NULL */ struct nfs4_pnfs_ds * nfs4_fl_prepare_ds(struct pnfs_layout_segment *lseg, u32 ds_idx) { … } module_param(dataserver_retrans, uint, 0644); MODULE_PARM_DESC(…) …; module_param(dataserver_timeo, uint, 0644); MODULE_PARM_DESC(…) …;