Return-Path: Received: from mail-pd0-f170.google.com ([209.85.192.170]:33130 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752094AbbG3MNj (ORCPT ); Thu, 30 Jul 2015 08:13:39 -0400 Received: by pdbnt7 with SMTP id nt7so23795427pdb.0 for ; Thu, 30 Jul 2015 05:13:39 -0700 (PDT) Message-ID: <55BA14E2.60407@gmail.com> Date: Thu, 30 Jul 2015 20:13:22 +0800 From: Kinglong Mee MIME-Version: 1.0 To: "J. Bruce Fields" CC: "linux-nfs@vger.kernel.org" , tigran.mkrtchyan@desy.de, kinglongmee@gmail.com Subject: [PATCH v2] 4.1 xdrdef: Update nfs4.x to the latest dot-x-38.txt References: <55B76B9B.4090700@gmail.com> <20150729193734.GB21949@fieldses.org> <55BA130C.1050604@gmail.com> In-Reply-To: <55BA130C.1050604@gmail.com> Content-Type: text/plain; charset=windows-1252 Sender: linux-nfs-owner@vger.kernel.org List-ID: There are some updates and bugfixes between draft-ietf-nfsv4-minorversion2-dot-x-38.txt and draft-ietf-nfsv4-minorversion2-dot-x-30.txt. Signed-off-by: Kinglong Mee --- nfs4.1/xdrdef/README | 2 +- nfs4.1/xdrdef/nfs4.x | 108 +++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 92 insertions(+), 18 deletions(-) diff --git a/nfs4.1/xdrdef/README b/nfs4.1/xdrdef/README index 2d57ee1..c39fd43 100644 --- a/nfs4.1/xdrdef/README +++ b/nfs4.1/xdrdef/README @@ -1,4 +1,4 @@ # Note nfs4.x was created using: -curl http://www.ietf.org/id/draft-ietf-nfsv4-minorversion2-dot-x-30.txt|grep "^ *///" | sed 's?^ */// ??' | sed 's?^ *///$??' >nfs4.1/xdrdef/nfs4.x +curl http://www.ietf.org/id/draft-ietf-nfsv4-minorversion2-dot-x-38.txt|grep "^ *///" | sed 's?^ */// ??' | sed 's?^ *///$??' >nfs4.1/xdrdef/nfs4.x patch nfs4.1/xdrdef/nfs4.x ; +typedef sec_label4 fattr4_sec_label<>; +typedef uint32_t fattr4_clone_blksize; %/* % * REQUIRED Attributes @@ -931,10 +977,6 @@ const FATTR4_DIRENT_NOTIF_DELAY = 57; const FATTR4_DACL = 58; const FATTR4_SACL = 59; const FATTR4_CHANGE_POLICY = 60; - -%/* -% * new to NFSV4.2 -% */ const FATTR4_FS_STATUS = 61; const FATTR4_FS_LAYOUT_TYPES = 62; const FATTR4_LAYOUT_HINT = 63; @@ -950,7 +992,11 @@ const FATTR4_RETENTEVT_SET = 72; const FATTR4_RETENTION_HOLD = 73; const FATTR4_MODE_SET_MASKED = 74; const FATTR4_FS_CHARSET_CAP = 76; -/* 77 is currently unused */ + +%/* +% * new to NFSV4.2 +% */ +const FATTR4_CLONE_BLKSIZE = 77; const FATTR4_SPACE_FREED = 78; const FATTR4_CHANGE_ATTR_TYPE = 79; const FATTR4_SEC_LABEL = 80; @@ -1287,6 +1333,7 @@ enum nfs_opnum4 { OP_READ_PLUS = 68, OP_SEEK = 69, OP_WRITE_SAME = 70, + OP_CLONE = 71, OP_ILLEGAL = 10044 }; @@ -1316,6 +1363,19 @@ union ACCESS4res switch (nfsstat4 status) { void; }; +struct CLONE4args { + /* SAVED_FH: source file */ + /* CURRENT_FH: destination file */ + stateid4 cl_src_stateid; + stateid4 cl_dst_stateid; + offset4 cl_src_offset; + offset4 cl_dst_offset; + length4 cl_count; +}; + +struct CLONE4res { + nfsstat4 cl_status; +}; struct CLOSE4args { /* CURRENT_FH: object */ seqid4 seqid; @@ -2759,13 +2819,24 @@ struct COPY4args { }; -struct COPY4res { - nfsstat4 cr_status; - write_response4 cr_response; +struct copy_requirements4 { bool cr_consecutive; bool cr_synchronous; }; +struct COPY4resok { + write_response4 cr_response; + copy_requirements4 cr_requirements; +}; + +union COPY4res switch (nfsstat4 cr_status) { +case NFS4_OK: + COPY4resok cr_resok4; +case NFS4ERR_OFFLOAD_NO_REQS: + copy_requirements4 cr_requirements; +default: + void; +}; struct COPY_NOTIFY4args { /* CURRENT_FH: source file */ @@ -2775,6 +2846,7 @@ struct COPY_NOTIFY4args { struct COPY_NOTIFY4resok { nfstime4 cnr_lease_time; + stateid4 cnr_stateid; netloc4 cnr_source_server<>; }; @@ -2887,7 +2959,7 @@ struct LAYOUTERROR4res { }; struct io_info4 { - uint32_t ii_count; + uint64_t ii_count; uint64_t ii_bytes; }; @@ -3088,6 +3160,7 @@ union nfs_argop4 switch (nfs_opnum4 argop) { case OP_READ_PLUS: READ_PLUS4args opread_plus; case OP_SEEK: SEEK4args opseek; case OP_WRITE_SAME: WRITE_SAME4args opwrite_same; + case OP_CLONE: CLONE4args opclone; /* Operations not new to NFSv4.1 */ case OP_ILLEGAL: void; @@ -3216,6 +3289,7 @@ union nfs_resop4 switch (nfs_opnum4 resop) { case OP_READ_PLUS: READ_PLUS4res opread_plus; case OP_SEEK: SEEK4res opseek; case OP_WRITE_SAME: WRITE_SAME4res opwrite_same; + case OP_CLONE: CLONE4res opclone; /* Operations not new to NFSv4.1 */ case OP_ILLEGAL: ILLEGAL4res opillegal; -- 2.4.3