Home | History | Annotate | Download | only in nfs
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License (the "License").
      6  * You may not use this file except in compliance with the License.
      7  *
      8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  * When distributing Covered Code, include this CDDL HEADER in each
     14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  * If applicable, add the following below this CDDL HEADER, with the
     16  * fields enclosed by brackets "[]" replaced with your own identifying
     17  * information: Portions Copyright [yyyy] [name of copyright owner]
     18  *
     19  * CDDL HEADER END
     20  */
     21 /*
     22  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     23  * Use is subject to license terms.
     24  */
     25 
     26 #ifndef _NNODE_PROXY_H
     27 #define	_NNODE_PROXY_H
     28 
     29 #include <sys/types.h>
     30 #include <sys/vnode.h>
     31 #include <sys/mutex.h>
     32 #include <nfs/ds_filehandle.h>
     33 #include <nfs/mds_state.h>
     34 
     35 #ifdef	__cplusplus
     36 extern "C" {
     37 #endif
     38 
     39 #define	MDS_MAXREAD	(1 * 1024 * 1024)
     40 
     41 typedef struct {
     42 	DS_READargs args;
     43 	DS_READres res;
     44 } ds_read_t;
     45 
     46 typedef struct {
     47 	DS_WRITEargs args;
     48 	DS_WRITEres res;
     49 } ds_write_t;
     50 
     51 typedef struct {
     52 	nfs_fh4 fh;
     53 	ds_addrlist_t *ds;
     54 	union {
     55 		ds_read_t read;
     56 		ds_write_t write;
     57 	} ds_io_u;
     58 } ds_io_t;
     59 
     60 typedef struct {
     61 	uint64_t offset;
     62 	int len;
     63 	int startidx;
     64 	int stripe_unit;
     65 	int stripe_count;
     66 	int io_array_size;
     67 	ds_io_t *io_array;
     68 } mds_strategy_t;
     69 
     70 typedef struct {
     71 	/*
     72 	 * These first four fields have to match those in nnode_vn_data_t.
     73 	 */
     74 	vnode_t		*mnd_vp;
     75 	kmutex_t	mnd_lock;
     76 	uint32_t	mnd_flags;
     77 	vattr_t		mnd_vattr;
     78 	fsid_t		mnd_fsid;
     79 	nfs41_fid_t	mnd_fid;
     80 	uio_t		*mnd_uiop;
     81 	nfs_server_instance_t *mnd_instp;
     82 	mds_layout_t	*mnd_layout;
     83 	mds_strategy_t	*mnd_strategy;
     84 	int		mnd_eof;
     85 } nnode_proxy_data_t;
     86 
     87 #ifdef	__cplusplus
     88 }
     89 #endif
     90 
     91 #endif /* _NNODE_PROXY_H */
     92