[pnfs] CVS: nfsv4

Marc Eshel IBM eshel at citi.umich.edu
Tue Nov 28 13:35:03 EST 2006


CVSROOT:	/cvs
Module name:	nfsv4
Changes by:	eshel at citi.	2006/11/28 13:35:03

Modified files:
	cvs/pnfs/include/linux/nfsd: pnfsd.h state.h 

Log message:
Add code to manage layouts on the NFS server based on Andy's design.

Index: include/linux/nfsd/pnfsd.h
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/include/linux/nfsd/pnfsd.h,v
retrieving revision 1.4
diff -u -r1.4 pnfsd.h
--- include/linux/nfsd/pnfsd.h	17 Aug 2006 20:04:06 -0000	1.4
+++ include/linux/nfsd/pnfsd.h	28 Nov 2006 18:02:59 -0000
@@ -33,6 +33,8 @@
*
*/

+#include <linux/nfsd/nfsd4_pnfs.h>
+
/* pNFS Metadata to Data server state communication*/
struct pnfs_get_state {
u32			devid;    /* request */
@@ -79,3 +81,7 @@
void nfsd_layout_recall_cb(struct nfs4_cb_layout *);
int nfs4_pnfs_cb_get_state(struct pnfs_get_state *);
void nfs4_pnfs_state_init(void);
+int nfs4_pnfs_get_layout(struct super_block *, struct svc_fh *,
+						struct nfsd4_pnfs_layoutget *);
+int nfs4_pnfs_return_layout(struct super_block *, struct svc_fh *,
+					struct nfsd4_pnfs_layoutreturn *);
Index: include/linux/nfsd/state.h
===================================================================
RCS file: /cvs/nfsv4/cvs/pnfs/include/linux/nfsd/state.h,v
retrieving revision 1.8
diff -u -r1.8 state.h
--- include/linux/nfsd/state.h	23 Aug 2006 20:38:34 -0000	1.8
+++ include/linux/nfsd/state.h	28 Nov 2006 18:03:00 -0000
@@ -123,6 +123,7 @@
struct list_head	cl_strhash; 	/* hash by cl_name */
struct list_head	cl_openowners;
struct list_head	cl_delegations;
+	struct list_head	cl_layouts;
struct list_head        cl_lru;         /* tail queue */
struct xdr_netobj	cl_name; 	/* id generated by client */
char                    cl_recdir[HEXDIR_LEN]; /* recovery dir */
@@ -158,6 +159,27 @@
u32			cbl_fhval[NFS4_FHSIZE];
};

+struct nfs4_layout {
+	struct kref		lo_ref;
+	struct list_head	lo_perfile;    /* hash by f_id */
+	struct list_head	lo_perclnt;    /* hash by clientid */
+	struct list_head	lo_recall_lru; /* when in recall */
+	struct nfs4_file        *lo_file;      /* backpointer */
+	struct nfs4_client      *lo_client;
+	time_t                  lo_time;       /* time recall started */
+	struct nfs4_cb_layout	lo_cb_layout;
+};
+
+#define lo_clienti      lo_cb_layout.cbl_client
+#define lo_sb           lo_cb_layout.cbl_sb
+#define lo_ident        lo_cb_layout.cbl_ident
+#define lo_fhlen        lo_cb_layout.cbl_fhlen
+#define lo_fhval        lo_cb_layout.cbl_fhval
+#define lo_layout_type  lo_cb_layout.cbl_layout_type
+#define lo_iomode       lo_cb_layout.cbl_iomode
+#define lo_offset       lo_cb_layout.cbl_offset
+#define lo_length       lo_cb_layout.cbl_length
+
/* struct nfs4_client_reset
* one per old client. Populates reset_str_hashtbl. Filled from conf_id_hashtbl
* upon lease reset, or from upcall to state_daemon (to read in state
@@ -245,6 +267,7 @@
struct list_head        fi_hash;    /* hash by "struct inode *" */
struct list_head        fi_stateids;
struct list_head	fi_delegations;
+	struct list_head	fi_layouts;
struct inode		*fi_inode;
u32                     fi_id;      /* used with stateowner->so_id
* for stateid_hashtbl hash */



More information about the pNFS mailing list