diff mbox

[pynfs,06/12] Add xdr for Flex Files Layout Type

Message ID 1480228001-64821-7-git-send-email-loghyr@primarydata.com (mailing list archive)
State New, archived
Headers show

Commit Message

Thomas Haynes Nov. 27, 2016, 6:26 a.m. UTC
Note that unlike the block layout, we don't
create a new file as there are too many
dependencies on existing types.

Signed-off-by: Tom Haynes <loghyr@primarydata.com>
---
 nfs4.1/xdrdef/nfs4.x | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 96 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/nfs4.1/xdrdef/nfs4.x b/nfs4.1/xdrdef/nfs4.x
index 16870f7..c2c9361 100644
--- a/nfs4.1/xdrdef/nfs4.x
+++ b/nfs4.1/xdrdef/nfs4.x
@@ -572,7 +572,8 @@  struct stateid4 {
 enum layouttype4 {
         LAYOUT4_NFSV4_1_FILES   = 0x1,
         LAYOUT4_OSD2_OBJECTS    = 0x2,
-        LAYOUT4_BLOCK_VOLUME    = 0x3
+        LAYOUT4_BLOCK_VOLUME    = 0x3,
+        LAYOUT4_FLEX_FILES      = 0x4
 };
 
 struct layout_content4 {
@@ -3040,6 +3041,100 @@  default:
         void;
 };
 
+struct ff_device_versions4 {
+        uint32_t        ffdv_version;
+        uint32_t        ffdv_minorversion;
+        uint32_t        ffdv_rsize;
+        uint32_t        ffdv_wsize;
+        bool            ffdv_tightly_coupled;
+};
+
+struct ff_device_addr4 {
+        multipath_list4     ffda_netaddrs;
+        ff_device_versions4 ffda_versions<>;
+};
+
+const FF_FLAGS_NO_LAYOUTCOMMIT   = 0x00000001;
+const FF_FLAGS_NO_IO_THRU_MDS    = 0x00000002;
+const FF_FLAGS_NO_READ_IO        = 0x00000004;
+typedef uint32_t            ff_flags4;
+
+struct ff_data_server4 {
+    deviceid4               ffds_deviceid;
+    uint32_t                ffds_efficiency;
+    stateid4                ffds_stateid;
+    nfs_fh4                 ffds_fh_vers<>;
+    fattr4_owner            ffds_user;
+    fattr4_owner_group      ffds_group;
+};
+
+struct ff_mirror4 {
+    ff_data_server4         ffm_data_servers<>;
+};
+
+struct ff_layout4 {
+    length4                 ffl_stripe_unit;
+    ff_mirror4              ffl_mirrors<>;
+    ff_flags4               ffl_flags;
+    uint32_t                ffl_stats_collect_hint;
+};
+
+struct ff_ioerr4 {
+        offset4        ffie_offset;
+        length4        ffie_length;
+        stateid4       ffie_stateid;
+        device_error4  ffie_errors<>;
+};
+
+struct ff_io_latency4 {
+        uint64_t       ffil_ops_requested;
+        uint64_t       ffil_bytes_requested;
+        uint64_t       ffil_ops_completed;
+        uint64_t       ffil_bytes_completed;
+        uint64_t       ffil_bytes_not_delivered;
+        nfstime4       ffil_total_busy_time;
+        nfstime4       ffil_aggregate_completion_time;
+};
+
+struct ff_layoutupdate4 {
+        netaddr4       ffl_addr;
+        nfs_fh4        ffl_fhandle;
+        ff_io_latency4 ffl_read;
+        ff_io_latency4 ffl_write;
+        nfstime4       ffl_duration;
+        bool           ffl_local;
+};
+
+struct ff_iostats4 {
+        offset4           ffis_offset;
+        length4           ffis_length;
+        stateid4          ffis_stateid;
+        io_info4          ffis_read;
+        io_info4          ffis_write;
+        deviceid4         ffis_deviceid;
+        ff_layoutupdate4  ffis_layoutupdate;
+};
+
+struct ff_layoutreturn4 {
+        ff_ioerr4     fflr_ioerr_report<>;
+        ff_iostats4   fflr_iostats_report<>;
+};
+
+union ff_mirrors_hint switch (bool ffmc_valid) {
+    case TRUE:
+        uint32_t    ffmc_mirrors;
+    case FALSE:
+        void;
+};
+
+struct ff_layouthint4 {
+    ff_mirrors_hint fflh_mirrors_hint;
+};
+
+enum ff_cb_recall_any_mask {
+    FF_RCA4_TYPE_MASK_READ = -2,
+    FF_RCA4_TYPE_MASK_RW   = -1
+};
 
 /*
  * Operation arrays (the rest)