Subject: [nfsv4] a couple NFSv4.1 draft fixes

From: "david m. richter" <[email-masked]>
Date: Wed, 12 Mar 2008 16:10:18 -0400 (EDT)

as fate would have it, after the last-call i found a couple small 
bitmask-related things that need fixing.

	in section 18.39 (GET_DIR_DELEGATION), one of the args is the 
bitmap "gdda_notification_types".  those types are defined in section 
20.4.1 (CB_NOTIFY) as enum notify_type4, whose values are 0-5, which 
obviously don't work as a bitmask.

	in section 20.6.1 (CB_RECALL_ANY), i think there's a similar 
situation with the masks which define the object type to recall, except 
there are stranger values.

	here's a patch where those enums are converted to bitmaskable 
constants.

---
 dotx.d/cb_notify_args.x     |   16 +++++++---------
 dotx.d/cb_recall_any_args.x |   20 ++++++++++----------
 2 files changed, 17 insertions(+), 19 deletions(-)

diff --git a/dotx.d/cb_notify_args.x b/dotx.d/cb_notify_args.x
index fec82c3..f017043 100755
--- a/dotx.d/cb_notify_args.x
+++ b/dotx.d/cb_notify_args.x
@@ -1,14 +1,12 @@
 /*
  * Directory notification types.
  */
-enum notify_type4 {
-	NOTIFY4_CHANGE_CHILD_ATTRS = 0,
-	NOTIFY4_CHANGE_DIR_ATTRS = 1,
-	NOTIFY4_REMOVE_ENTRY = 2,
-	NOTIFY4_ADD_ENTRY = 3,
-	NOTIFY4_RENAME_ENTRY = 4,
-	NOTIFY4_CHANGE_COOKIE_VERIFIER = 5
-};
+const NOTIFY4_CHANGE_CHILD_ATTRS	= 0x00000001;
+const NOTIFY4_CHANGE_DIR_ATTRS	 	= 0x00000002;
+const NOTIFY4_REMOVE_ENTRY		= 0x00000004;
+const NOTIFY4_ADD_ENTRY			= 0x00000008;
+const NOTIFY4_RENAME_ENTRY		= 0x00000010;
+const NOTIFY4_CHANGE_COOKIE_VERIFIER	= 0x00000020;
 
 /* Changed entry information.  */
 struct notify_entry4 {
@@ -62,7 +60,7 @@ struct notify_verifier4 {
 typedef opaque notifylist4<>;
 
 struct notify4 {
-	/* composed from notify_type4 or notify_deviceid_type4 */
+	/* composed from notification constants or notify_deviceid_type4 */
         bitmap4         notify_mask;
         notifylist4     notify_vals;
 };
diff --git a/dotx.d/cb_recall_any_args.x b/dotx.d/cb_recall_any_args.x
index 161ded9..ccb8af5 100755
--- a/dotx.d/cb_recall_any_args.x
+++ b/dotx.d/cb_recall_any_args.x
@@ -1,13 +1,13 @@
-const RCA4_TYPE_MASK_RDATA_DLG		= 0;
-const RCA4_TYPE_MASK_WDATA_DLG		= 1;
-const RCA4_TYPE_MASK_DIR_DLG		= 2;
-const RCA4_TYPE_MASK_FILE_LAYOUT	= 3;
-const RCA4_TYPE_MASK_BLK_LAYOUT_MIN	= 4;
-const RCA4_TYPE_MASK_BLK_LAYOUT_MAX	= 7;
-const RCA4_TYPE_MASK_OBJ_LAYOUT_MIN	= 8;
-const RCA4_TYPE_MASK_OBJ_LAYOUT_MAX	= 11;
-const RCA4_TYPE_MASK_OTHER_LAYOUT_MIN	= 12;
-const RCA4_TYPE_MASK_OTHER_LAYOUT_MAX	= 15;
+const RCA4_TYPE_MASK_RDATA_DLG		= 0x00000001;
+const RCA4_TYPE_MASK_WDATA_DLG		= 0x00000002;
+const RCA4_TYPE_MASK_DIR_DLG		= 0x00000004;
+const RCA4_TYPE_MASK_FILE_LAYOUT	= 0x00000008;
+const RCA4_TYPE_MASK_BLK_LAYOUT_MIN	= 0x00000010;
+const RCA4_TYPE_MASK_BLK_LAYOUT_MAX	= 0x00000020;
+const RCA4_TYPE_MASK_OBJ_LAYOUT_MIN	= 0x00000040;
+const RCA4_TYPE_MASK_OBJ_LAYOUT_MAX	= 0x00000080;
+const RCA4_TYPE_MASK_OTHER_LAYOUT_MIN	= 0x00000100;
+const RCA4_TYPE_MASK_OTHER_LAYOUT_MAX	= 0x00000200;
 
 struct	CB_RECALL_ANY4args	{
 	uint32_t	craa_objects_to_keep;
-- 
1.5.4

_______________________________________________
nfsv4 mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/nfsv4

---

From: "Mike Eisler" <[email-masked]>
Date: Wed, 12 Mar 2008 14:00:56 -0700 (PDT)

> obviously don't work as a bitmask.

David,

The bitmaps are defined in data type bitmap4, which was established
in RFC3530 (NFSv4.0) and is the basis for NFSv4 attributes.

So I do not believe a change is needed.

E.g. value 0 maps to the least significant bit of the first 32 bit
integer of the array within an instance type bitmap4.