Skip to contentSkip to conversation

Enable inter server to server copies on a export

PATCH New Steve Dickson 1 participant 2 messages Oct 28, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Enable inter server to server copies on a export

The patch introduces the 's2sc' export option to exportfs and along with the recently sent kernel patch will enable inter server to server copies on specified exports

The idea being when servers have very interconnect (as in cluster environments) admins can use this option to create very fast copy paths.

Steve Dickson (1):
exportfs: Add the 's2sc' option allowing inter server to server copies

 support/include/nfs/export.h |  1 +
 support/nfs/exports.c        |  5 +++++
 utils/exportfs/exportfs.c    |  2 ++
 utils/exportfs/exports.man   | 14 ++++++++++++++
 4 files changed, 22 insertions(+)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/1 exportfs: Add the 's2sc' option allowing inter server to server copies

The new export will enable inter server to server copies on that particular export on the destination server

---
 support/include/nfs/export.h |  1 +
 support/nfs/exports.c        |  5 +++++
 utils/exportfs/exportfs.c    |  2 ++
 utils/exportfs/exports.man   | 14 ++++++++++++++
 4 files changed, 22 insertions(+)
support/include/nfs/export.h +1 -0
index 0eca828e..e563e7aa 100644
@@ -28,6 +28,7 @@
 #define NFSEXP_NOACL		0x8000 /* reserved for possible ACL related use */
 #define NFSEXP_V4ROOT		0x10000
 #define NFSEXP_PNFS            0x20000
+#define NFSEXP_S2SC            0x40000
 /*
  * All flags supported by the kernel before addition of the
  * export_features interface:
support/nfs/exports.c +5 -0
index 2c8f0752..7abc3e09 100644
@@ -297,6 +297,7 @@ putexportent(struct exportent *ep)
 	if (ep->e_flags & NFSEXP_SECURITY_LABEL)
 		fprintf(fp, "security_label,");
 	fprintf(fp, "%spnfs,", (ep->e_flags & NFSEXP_PNFS)? "" : "no_");
+	fprintf(fp, "%ss2sc,", (ep->e_flags & NFSEXP_S2SC)? "" : "no_");
 	if (ep->e_flags & NFSEXP_FSID) {
 		fprintf(fp, "fsid=%d,", ep->e_fsid);
 	}
@@ -616,6 +617,10 @@ parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr)
 			setflags(NFSEXP_PNFS, active, ep);
 		else if (!strcmp(opt, "no_pnfs"))
 			clearflags(NFSEXP_PNFS, active, ep);
+		else if (!strcmp(opt, "s2sc"))
+			setflags(NFSEXP_S2SC, active, ep);
+		else if (!strcmp(opt, "no_s2sc"))
+			clearflags(NFSEXP_S2SC, active, ep);
 		else if (strncmp(opt, "anonuid=", 8) == 0) {
 			char *oe;
 			ep->e_anonuid = strtol(opt+8, &oe, 10);
utils/exportfs/exportfs.c +2 -0
index 6ba615d1..1180d2e7 100644
@@ -715,6 +715,8 @@ dump(int verbose, int export_format)
 				c = dumpopt(c, "no_acl");
 			if (ep->e_flags & NFSEXP_PNFS)
 				c = dumpopt(c, "pnfs");
+			if (ep->e_flags & NFSEXP_S2SC)
+				c = dumpopt(c, "s2sc");
 			if (ep->e_flags & NFSEXP_FSID)
 				c = dumpopt(c, "fsid=%d", ep->e_fsid);
 			if (ep->e_uuid)
utils/exportfs/exports.man +14 -0
index 54b3f877..6c54d8a7 100644
@@ -420,6 +420,20 @@ will only work if all clients use a consistent security policy.  Note
 that early kernels did not support this export option, and instead
 enabled security labels by default.
 
+.TP
+.IR s2sc
+This option enables inter server to server 
+copy on the export. The client will initiate
+the file copy with source server. The client
+will initiate the copy with destination server.
+This option will allow that initiation to be
+successful, allowing the copy to occur between
+the servers.
+
+This type of copy can be enable system-wide
+by enabling the inter_copy_offload_enable
+parameter.
+
 .SS User ID Mapping
 .PP
 .B nfsd
Signature · 1 line
2.31.1