From efad78260379f0ca836e8a2327b97dd620acd098 Mon Sep 17 00:00:00 2001 From: Susant Palai Date: Tue, 22 Aug 2017 13:44:52 +0530 Subject: rio/everywhere: add icreate/namelink fop icreate creates inode, while namelink links the basename to it's parent gfid. For now mkdir is the primary user of these fops. Better distribution is acheived by creating the inode on ,(say) mds1 and linking the basename to it's parent gfid on mds2. The inode serves readdirp, stat etc. More details about the fops are present at: https://review.gluster.org/#/c/13395/3/design/DHT2/DHT2_Icreate_Namelink_Notes.md This backport of three patches from experimental branch. 1- https://review.gluster.org/#/c/18085/ 2- https://review.gluster.org/#/c/18086/ 3- https://review.gluster.org/#/c/18094/ Updates gluster/glusterfs#243 Change-Id: I1bd3d5a441a3cfab1acfeb52f15c6c867d362592 Signed-off-by: Susant Palai --- rpc/rpc-lib/src/protocol-common.h | 2 ++ rpc/xdr/src/glusterfs-fops.x | 2 ++ rpc/xdr/src/glusterfs4-xdr.x | 27 +++++++++++++++++++++++++++ 3 files changed, 31 insertions(+) (limited to 'rpc') diff --git a/rpc/rpc-lib/src/protocol-common.h b/rpc/rpc-lib/src/protocol-common.h index ccb3c5002b4..ebfb651c96e 100644 --- a/rpc/rpc-lib/src/protocol-common.h +++ b/rpc/rpc-lib/src/protocol-common.h @@ -65,6 +65,8 @@ enum gf_fop_procnum { GFS3_OP_LEASE, GFS3_OP_GETACTIVELK, GFS3_OP_SETACTIVELK, + GFS3_OP_ICREATE, + GFS3_OP_NAMELINK, GFS3_OP_MAXVALUE, }; diff --git a/rpc/xdr/src/glusterfs-fops.x b/rpc/xdr/src/glusterfs-fops.x index b14a6e6f2e1..5b5c5904678 100644 --- a/rpc/xdr/src/glusterfs-fops.x +++ b/rpc/xdr/src/glusterfs-fops.x @@ -75,6 +75,8 @@ enum glusterfs_fop_t { GF_FOP_GETACTIVELK, GF_FOP_SETACTIVELK, GF_FOP_PUT, + GF_FOP_ICREATE, + GF_FOP_NAMELINK, GF_FOP_MAXVALUE }; diff --git a/rpc/xdr/src/glusterfs4-xdr.x b/rpc/xdr/src/glusterfs4-xdr.x index 6d0c500096b..a4fc9b22850 100644 --- a/rpc/xdr/src/glusterfs4-xdr.x +++ b/rpc/xdr/src/glusterfs4-xdr.x @@ -31,3 +31,30 @@ unsigned int len; opaque xdata<>; /* Extra data */ } ; + +struct gfs4_icreate_rsp { + int op_ret; + int op_errno; + gf_iatt stat; + opaque xdata<>; +}; + +struct gfs4_icreate_req { + opaque gfid[16]; + unsigned int mode; + opaque xdata<>; +}; + +struct gfs4_namelink_rsp { + int op_ret; + int op_errno; + gf_iatt preparent; + gf_iatt postparent; + opaque xdata<>; +}; + +struct gfs4_namelink_req { + opaque pargfid[16]; + string bname<>; + opaque xdata<>; +}; -- cgit