Skip to contentSkip to conversation

nfs-utils: add support for the "pnfs" export option

PATCH Superseded Christoph Hellwig 3 participants 4 messages Apr 1, 2015 – Apr 2, 2015

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs-utils: add support for the "pnfs" export option

This goes along with the patch just sent to Bruce to make pnfs support conditional.

---
 support/include/nfs/export.h | 1 +
 support/nfs/exports.c        | 3 +++
 utils/exportfs/exportfs.c    | 2 ++
 3 files changed, 6 insertions(+)
support/include/nfs/export.h +1 -0
index 2f59e6a..1194255 100644
@@ -26,6 +26,7 @@
 #define	NFSEXP_CROSSMOUNT	0x4000
 #define NFSEXP_NOACL		0x8000 /* reserved for possible ACL related use */
 #define NFSEXP_V4ROOT		0x10000
+#define NFSEXP_PNFS            0x20000
 /*
  * All flags supported by the kernel before addition of the
  * export_features interface:
support/nfs/exports.c +3 -0
index 4b17d3c..97f9e67 100644
@@ -275,6 +275,7 @@ putexportent(struct exportent *ep)
 		"no_" : "");
 	if (ep->e_flags & NFSEXP_NOREADDIRPLUS)
 		fprintf(fp, "nordirplus,");
+	fprintf(fp, "%s", (ep->e_flags & NFSEXP_PNFS)? "pnfs," : "");
 	if (ep->e_flags & NFSEXP_FSID) {
 		fprintf(fp, "fsid=%d,", ep->e_fsid);
 	}
@@ -581,6 +582,8 @@ parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr)
 			clearflags(NFSEXP_NOACL, active, ep);
 		else if (strcmp(opt, "no_acl") == 0)
 			setflags(NFSEXP_NOACL, active, ep);
+		else if (!strcmp(opt, "pnfs"))
+			setflags(NFSEXP_PNFS, 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 48eac00..8758231 100644
@@ -821,6 +821,8 @@ dump(int verbose, int export_format)
 				c = dumpopt(c, "nordirplus");
 			if (ep->e_flags & NFSEXP_NOACL)
 				c = dumpopt(c, "no_acl");
+			if (ep->e_flags & NFSEXP_PNFS)
+				c = dumpopt(c, "pnfs");
 			if (ep->e_flags & NFSEXP_FSID)
 				c = dumpopt(c, "fsid=%d", ep->e_fsid);
 			if (ep->e_uuid)
Signature · 1 line
1.9.1
#1 lore raw

----- Original Message -----

Quoted 41 lines

From: "Christoph Hellwig" <[email protected]>
To: "Steve Dickson" <[email protected]>
Cc: [email protected]
Sent: Wednesday, April 1, 2015 10:15:13 AM
Subject: [PATCH] nfs-utils: add support for the "pnfs" export option

This goes along with the patch just sent to Bruce to make pnfs support conditional.

---

support/include/nfs/export.h | 1 +
support/nfs/exports.c        | 3 +++
utils/exportfs/exportfs.c    | 2 ++
3 files changed, 6 insertions(+)
support/include/nfs/export.h +1 -0
index 2f59e6a..1194255 100644
@@ -26,6 +26,7 @@
 #define	NFSEXP_CROSSMOUNT	0x4000
 #define NFSEXP_NOACL		0x8000 /* reserved for possible ACL related use */
 #define NFSEXP_V4ROOT		0x10000
+#define NFSEXP_PNFS            0x20000
 /*
 * All flags supported by the kernel before addition of the
 * export_features interface:
support/nfs/exports.c +1 -0
index 4b17d3c..97f9e67 100644
@@ -275,6 +275,7 @@ putexportent(struct exportent *ep)
 		"no_" : "");
 	if (ep->e_flags & NFSEXP_NOREADDIRPLUS)
 		fprintf(fp, "nordirplus,");
+	fprintf(fp, "%s", (ep->e_flags & NFSEXP_PNFS)? "pnfs," : "");
 	if (ep->e_flags & NFSEXP_FSID) {
 		fprintf(fp, "fsid=%d,", ep->e_fsid);
 	}

support/nfs/exports.c parseopts(char *cp, struct exportent *ep, int warn, int · line 587

Quoted 6 lines
support/nfs/exports.c +2 -0
@@ -581,6 +582,8 @@ parseopts(char *cp, struct exportent *ep, int warn, int
 *had_subtree_opt_ptr)
 			clearflags(NFSEXP_NOACL, active, ep);
 		else if (strcmp(opt, "no_acl") == 0)
 			setflags(NFSEXP_NOACL, active, ep);
+		else if (!strcmp(opt, "pnfs"))
+			setflags(NFSEXP_PNFS, active, ep);

and no_pnfs as well to match other options.

Tigran.

Quoted 23 lines
support/nfs/exports.c +0 -0
 		else if (strncmp(opt, "anonuid=", 8) == 0) {
 			char *oe;
			ep->e_anonuid = strtol(opt+8, &oe, 10);
utils/exportfs/exportfs.c +2 -1
index 48eac00..8758231 100644
@@ -821,6 +821,8 @@ dump(int verbose, int export_format)
 				c = dumpopt(c, "nordirplus");
 			if (ep->e_flags & NFSEXP_NOACL)
 				c = dumpopt(c, "no_acl");
+			if (ep->e_flags & NFSEXP_PNFS)
+				c = dumpopt(c, "pnfs");
 			if (ep->e_flags & NFSEXP_FSID)
 				c = dumpopt(c, "fsid=%d", ep->e_fsid);
 			if (ep->e_uuid)
--

1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to Christoph Hellwig
Quoted 2 lines · Christoph Hellwig

This goes along with the patch just sent to Bruce to make pnfs support conditional.

Could we get an update of utils/exportfs/exports.man too?

--b.

Quoted 61 lines
---
 support/include/nfs/export.h | 1 +
 support/nfs/exports.c        | 3 +++
 utils/exportfs/exportfs.c    | 2 ++
 3 files changed, 6 insertions(+)
support/include/nfs/export.h +1 -0
index 2f59e6a..1194255 100644
@@ -26,6 +26,7 @@
 #define	NFSEXP_CROSSMOUNT	0x4000
 #define NFSEXP_NOACL		0x8000 /* reserved for possible ACL related use */
 #define NFSEXP_V4ROOT		0x10000
+#define NFSEXP_PNFS            0x20000
 /*
  * All flags supported by the kernel before addition of the
  * export_features interface:
support/nfs/exports.c +3 -0
index 4b17d3c..97f9e67 100644
@@ -275,6 +275,7 @@ putexportent(struct exportent *ep)
 		"no_" : "");
 	if (ep->e_flags & NFSEXP_NOREADDIRPLUS)
 		fprintf(fp, "nordirplus,");
+	fprintf(fp, "%s", (ep->e_flags & NFSEXP_PNFS)? "pnfs," : "");
 	if (ep->e_flags & NFSEXP_FSID) {
 		fprintf(fp, "fsid=%d,", ep->e_fsid);
 	}
@@ -581,6 +582,8 @@ parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr)
 			clearflags(NFSEXP_NOACL, active, ep);
 		else if (strcmp(opt, "no_acl") == 0)
 			setflags(NFSEXP_NOACL, active, ep);
+		else if (!strcmp(opt, "pnfs"))
+			setflags(NFSEXP_PNFS, 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 48eac00..8758231 100644
@@ -821,6 +821,8 @@ dump(int verbose, int export_format)
 				c = dumpopt(c, "nordirplus");
 			if (ep->e_flags & NFSEXP_NOACL)
 				c = dumpopt(c, "no_acl");
+			if (ep->e_flags & NFSEXP_PNFS)
+				c = dumpopt(c, "pnfs");
 			if (ep->e_flags & NFSEXP_FSID)
 				c = dumpopt(c, "fsid=%d", ep->e_fsid);
 			if (ep->e_uuid)
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
Quoted 5 lines · J. Bruce Fields
Quoted 2 lines · Christoph Hellwig

This goes along with the patch just sent to Bruce to make pnfs support conditional.

Could we get an update of utils/exportfs/exports.man too?

Yes, v3 will follow ASAP. Should have read my whole inbox before starting to update the patch..