Whamcloud - gitweb
LUDOC-296 protocol: remove internal details from descriptions
[doc/protocol.git] / ldlm_lock_desc.txt
index 755f442..59d03aa 100644 (file)
@@ -9,9 +9,9 @@ lock being requested or granted. It appears in
 ----
 struct ldlm_lock_desc {
         struct ldlm_resource_desc l_resource;
-        ldlm_mode_t l_req_mode;
-        ldlm_mode_t l_granted_mode;
-        ldlm_wire_policy_data_t l_policy_data;
+        enum ldlm_mode l_req_mode;
+        enum ldlm_mode l_granted_mode;
+        union ldlm_wire_policy_data l_policy_data;
 };
 ----
 
@@ -24,7 +24,7 @@ being requested and the kind of lock that has been granted. The field
 values are:
 
 ----
-typedef enum {
+enum ldlm_mode {
         LCK_EX      = 1, /* exclusive */
         LCK_PW      = 2, /* privileged write */
         LCK_PR      = 4, /* privileged read */
@@ -33,8 +33,9 @@ typedef enum {
         LCK_NL      = 32, /* */
         LCK_GROUP   = 64, /* */
         LCK_COS     = 128, /* */
-} ldlm_mode_t;
+};
 ----
+[[struct-ldlm-mode]]
 
 Despite the fact that the lock modes are not overlapping, these lock
 modes are exclusive.  In addition the mode value 0 is the MINMODE,
@@ -48,14 +49,14 @@ fewer privileges were granted than requested, and the
 
 The 'l_policy_data' field gives the kind of resource being
 requested/granted. It is a union of these struct definitions:
-[[ldlm-wire-policy-data-t]]
+[[struct-ldlm-wire-policy-data]]
 
 ----
-typedef union {
+union ldlm_wire_policy_data {
         struct ldlm_extent l_extent;
         struct ldlm_flock_wire l_flock;
         struct ldlm_inodebits l_inodebits;
-} ldlm_wire_policy_data_t;
+};
 ----
 
 ----
@@ -64,6 +65,9 @@ struct ldlm_extent {
         __u64 end;
         __u64 gid;
 };
+----
+[[struct-ldlm-extent]]
+----
 struct ldlm_flock_wire {
         __u64 lfw_start;
         __u64 lfw_end;
@@ -71,14 +75,16 @@ struct ldlm_flock_wire {
         __u32 lfw_padding;
         __u32 lfw_pid;
 };
+----
+[[struct-ldlm-flock-wire]]
+----
 struct ldlm_inodebits {
         __u64 bits;
 };
 ----
+[[struct-ldlm-inodebits]]
 
 Thus the lock may be on an 'extent', a contiguous sequence of bytes
 in a regular file; an 'flock wire', whatever to heck that is; or a
 portion of an inode. For a "plain" lock (or one with no type at all)
 the 'l_policy_data' field has zero length.
-
-