[pnfs] minorversion 05 .x file

Garth Goodson Garth.Goodson at netapp.com
Wed Aug 16 17:41:45 EDT 2006


I've gone through the minorversion-05 .x file and have found the 
following changes that will need to be made to our prototypes (linux 
client/server, Netapp server).

I've also pulled out all the pnfs structures and types into a separate 
text file, putting the changed versions at the top; it is attached to 
this message.  It appears as a lot of changes occurred, but I think in 
reality the edits will be relatively minor.

Changes in consts:
------------------
FATTR4_FS_LAYOUT_TYPE attr gone from 56->64
OP_LAYOUTGET from 40->50
OP_LAYOUTCOMMIT from 41->49
OP_LAYOUTRETURN from 42->51
OP_GETDEVINFO from 43->47
OP_GETDEVLIST from 44->48

enums:
------
struct layoutrecall_type4 -> added LAYOUTRECALL_ALL = 3 (shouldn't 
affect xdr)

structs:
--------
devlist_item the deviceaddr has been changed from <layouttype, opaque> 
to just opaque; need to remove layouttype in GETDEVICELIST results

nfsv4_file_layout, added uint32_t dev_index in between dev_id and fh; 
impacts LAYOUTGET results; for our testing it should be set to 0

nfsv4_file_layouttype4, added uint32_t stripe_devs<> as second last 
argument; impacts LAYOUTGET results; for our testing set to 0 length

LAYOUTGET4args/res: something strange happened here, I'm trying to track 
down how this structure changed with Spencer.  For now assume it is the 
same as it was.

LAYOUTCOMMIT4args: changed last_write_offset to a union switched on a 
bool, client will probably always set to true (for now); server should check

LAYOUTCOMMIT4resok: looks like newsize4 has been changed from a union 
switched on a bool to a uint64 -- I think it should remain a switched union

LAYOUTRETURN4args: offset and length have been pulled out into a 
separate structure switched on the return type (see layoutreturn4)

GETDEVICEINFOresok: changed to just return opaque address, rather than 
layouttype plus opaque.

GETDEVLIST4resok: added a 'bool eof' flag to end to indicate no more 
getdevlist calls are needed (server must check -- client can assume only 
one call is needed)

layoutrecall4: added case for recall of ALL to switch (impacts 
CB_LAYOUTRECALL4args)

file layout opaque struct: is now a switched union on SIMPLE or COMPLEX, 
for implementation use SIMPLE types only

-------------- next part --------------
Changed fields:
---------------

const FATTR4_LAYOUT_TYPE	= 64;  /* CHANGED */


/* CHANGED op numbers (all) */

    OP_GETDEVICEINFO	= 47,
	OP_GETDEVICELIST	= 48,
	OP_LAYOUTCOMMIT		= 49,
	OP_LAYOUTGET		= 50,
	OP_LAYOUTRETURN		= 51,



/* FILE LAYOUT -- LAYOUTGET */

typedef netaddr4 nfsv4_file_layout_simple_device4;

/* NEW */
enum file_layout_device_type {
	FILE_SIMPLE  = 1,
	FILE_COMPLEX = 2
};

/* CHANGED -- used to be netaddr */
union nfsv4_file_layout_device4 switch (file_layout_device_type fld_type) {
	case FILE_SIMPLE:
		nfsv4_file_layout_simple_device4 nfld_dev_list<>;
	case FILE_COMPLEX:
		deviceid4 dev_list<>;
	default:
		void;
};


struct nfsv4_file_layout4 {
	deviceid4	nfl_dev_id;
	uint32_t	nfl_dev_index;   /* CHANGED */
	nfs_fh4		nfl_fh;
};

struct nfsv4_file_layouttype4 {
	stripetype4		nflt_stripe_type;
	bool			nflt_commit_through_mds;
	length4			nflt_stripe_unit;
	length4			nflt_file_size;
	uint32_t		nflt_stripe_devs<>;   /* CHANGED */
	nfsv4_file_layout4	nflt_dev_list<>;
};



/* GETDEVLIST/INFO */

struct devlist_item4 {
	deviceid4		dli_id;
	opaque			dli_device_addr<>;  /* CHANGED -- no layouttype */
};


struct GETDEVICELIST4resok {
	nfs_cookie4		gdlr_cookie;
	verifier4		gdlr_cookieverf;
	devlist_item4	gdlr_device_addrs<>;
	bool			gdlr_eof;           /* CHANGED -- added */
};

struct GETDEVICEINFO4resok {
	opaque			gdir_device_addr<>; /* CHANGED removed layouttype */
};



/* LAYOUTCOMMIT */

/* NEW ADDED */
union newoffset4 switch (bool newoffset) {
case TRUE:
        offset4           no_offset;
case FALSE:
        void;
};

struct LAYOUTCOMMIT4args {
	/* CURRENT_FH: file */
	clientid4               loca_clientid;
	offset4                 loca_offset;
	length4                 loca_length;
	bool                    loca_reclaim;
	newoffset4              loca_last_write_offset; /* CHANGED - added */
	newtime4                loca_time_modify;
	newtime4                loca_time_access;
	layoutupdate4           loca_layoutupdate;
};



/* LAYOUTGET */

/*
 * TEMPORARY definition
 */
typedef uint64_t newsize4;   /* CHANGED -- leave as was -- switched union */


/* NOT sure what happened here -- leave LAYOUTGET4args as it was */
struct LAYOUTGET4args {
	/* CURRENT_FH: file */                            /* REMOVED clientid?? */
	bool                    loga_signal_layout_avail; /* NOT SURE ABOUT THIS */
	layouttype4             loga_layout_type;
	layoutiomode4			loga_iomode;
	offset4                 loga_offset;
	length4                 loga_length;
	length4                 loga_minlength;
	count4                  loga_maxcount;
};

union LAYOUTGET4res switch (nfsstat4 status) {
case NFS4_OK:
        LAYOUTGET4resok     logr_resok4;
case NFS4ERR_LAYOUTTRYLATER:
        bool                logr_will_signal_layout_avail;  /* HMM... */
default:
        void;
};



/* LAYOUTRETURN */

enum layoutreturn_type4 {
	LAYOUTRETURN_FILE = 1,
	LAYOUTRETURN_FSID = 2,
	LAYOUTRETURN_ALL  = 3   /* ADDED */
};

/* NEW */
struct layoutreturn_file4 {
	offset4		lrf_offset;
	length4		lrf_length;
};

/* NEW */
union layoutreturn4 switch(layoutreturn_type4 returntype) {
	case LAYOUTRETURN_FILE:
		layoutreturn_file4	lr_layout;
	default:
		void;
};

struct LAYOUTRETURN4args {
	/* CURRENT_FH: file */
	clientid4		lora_clientid;
	bool			lora_reclaim;       /* PULLED out length, offset */
	layouttype4		lora_layout_type;   
	layoutiomode4		lora_iomode;
	layoutreturn4		lora_layoutreturn; /* ADDED */
};


/* LAYOUTRECALL */

enum layoutrecall_type4 {
	LAYOUTRECALL_FILE = 1,
	LAYOUTRECALL_FSID = 2,
	LAYOUTRECALL_ALL  = 3   /* ADDED */
};


union layoutrecall4 switch(layoutrecall_type4 recalltype) {
case LAYOUTRECALL_FILE:
        layoutrecall_file4 lor_layout;
case LAYOUTRECALL_FSID:
        fsid4              lor_fsid;
case LAYOUTRECALL_ALL:                 /* ADDED */
	void;
};



/* NEW for mds threshold attribute -- can ignore for now */

const TH4_READ_SIZE	= 0;
const TH4_WRITE_SIZE	= 1;
const TH4_READ_IOSIZE	= 2;
const TH4_WRITE_IOSIZE	= 3;

typedef length4 threshold4_read_size;
typedef length4 threshold4_write_size;
typedef length4 threshold4_read_iosize;
typedef length4 threshold4_write_iosize;

struct threshold_item4 {
	layouttype4	thi_layout_type;
	bitmap4		thi_hintset;
	opaque		thi_hintlist<>;
};

struct mdsthreshold4 {
	threshold_item4	mth_hints<>;
};


No Change
---------

const FATTR4_LAYOUT_HINT	= 63;   
const FATTR4_LAYOUT_BLKSIZE	= 65;
const FATTR4_LAYOUT_ALIGNMENT	= 66;
const FATTR4_MDSTHRESHOLD	= 68;

enum layouttype4 {
	LAYOUT_NFSV4_FILES  = 1,
	LAYOUT_OSD2_OBJECTS = 2,
	LAYOUT_BLOCK_VOLUME = 3
};

struct layouthint4 {
	layouttype4		loh_type;
	opaque			loh_data<>;
};

enum layoutiomode4 {
	LAYOUTIOMODE_READ	= 1,
	LAYOUTIOMODE_RW		= 2,
	LAYOUTIOMODE_ANY	= 3
};

struct layout4 {
	offset4			lo_offset;
	length4			lo_length;
	layoutiomode4		lo_iomode;
	layouttype4		lo_type;
	opaque			lo_layout<>;
};

typedef uint32_t deviceid4;


struct layoutupdate4 {
	layouttype4		lou_type;
	opaque			lou_data<>;
};

enum stripetype4 {
	STRIPE_SPARSE = 1,
	STRIPE_DENSE = 2
};

struct nfsv4_file_layouthint4 {
	stripetype4	nflh_stripe_type;
	length4		nflh_stripe_unit;
	uint32_t	nflh_stripe_width;
};


typedef uint32_t	fattr4_layout_alignment;
typedef uint32_t	fattr4_layout_blksize;
typedef layouthint4	fattr4_layout_hint;
typedef layouttype4	fattr4_layout_type;
typedef mdsthreshold4	fattr4_mdsthreshold;
typedef layouttype4	fattr4_fs_layout_type;


struct GETDEVICEINFO4args {
	/* CURRENT_FH: file */
	deviceid4		gdia_device_id;
	layouttype4		gdia_layout_type;
	count4			gdia_maxcount;
};


union GETDEVICEINFO4res switch (nfsstat4 status) {
case NFS4_OK:
	GETDEVICEINFO4resok	gdir_resok4;
default:
	void;
};

struct GETDEVICELIST4args {
	/* CURRENT_FH: file */
	layouttype4		gdla_layout_type;
	count4			gdla_maxcount;
	nfs_cookie4		gdla_cookie;
	verifier4		gdla_cookieverf;
};


union GETDEVICELIST4res switch (nfsstat4 status) {
case NFS4_OK:
	GETDEVICELIST4resok	gdlr_resok4;
default:
	void;
};

union newtime4 switch (bool timechanged) {
case TRUE:
        nfstime4           nt_time;
case FALSE:
        void;
};


union LAYOUTCOMMIT4res switch (nfsstat4 status) {
case NFS4_OK:
        LAYOUTCOMMIT4resok  locr_resok4;
default:
        void;
};

struct LAYOUTGET4resok {
	layout4            logr_layout;
};

struct LAYOUTRETURN4res {
    nfsstat4        lorr_status;
};


struct CB_LAYOUTRECALL4args {
	layouttype4             lora_type;
	layoutiomode4      lora_iomode;
	bool                    lora_changed;
	layoutrecall4           lora_recall;
};

struct CB_LAYOUTRECALL4res {
	nfsstat4        lorr_status;
};


struct layoutrecall_file4 {
	nfs_fh4         lor_fh;
	offset4         lor_offset;
	length4         lor_length;
};



More information about the pNFS mailing list