Whamcloud - gitweb
Branch b1_4
authoradilger <adilger>
Wed, 6 Jul 2005 04:33:45 +0000 (04:33 +0000)
committeradilger <adilger>
Wed, 6 Jul 2005 04:33:45 +0000 (04:33 +0000)
Use the existing b1_4 ldlm_flock struct, but make the pid types well defined
sizes (even though the blocking_pid is not sent over the wire, it is a
historical accident that it is inside the ldlm_flock policy data)  and add
swabbing for the extent.gid field (which in b_cray overlapped with flock.pid
so they were swabbed at the same time).
b=6931
r=phil

lustre/include/linux/lustre_dlm.h
lustre/include/linux/lustre_idl.h
lustre/include/linux/lustre_net.h
lustre/obdclass/class_obd.c
lustre/ptlrpc/pack_generic.c
lustre/ptlrpc/service.c
lustre/utils/wirecheck.c

index fcc9a74..f9a2369 100644 (file)
@@ -68,8 +68,8 @@ typedef enum {
 #define LDLM_FL_WARN           0x008000 /* see ldlm_cli_cancel_unused */
 #define LDLM_FL_DISCARD_DATA   0x010000 /* discard (no writeback) on cancel */
 
-#define LDLM_FL_NO_TIMEOUT    0x020000 /* Blocked by CW lock - wait
-                                           indefinitely */
+#define LDLM_FL_NO_TIMEOUT     0x020000 /* Blocked by group lock - wait
+                                         * indefinitely */
 
 /* file & record locking */
 #define LDLM_FL_BLOCK_NOWAIT   0x040000 // server told not to wait if blocked
@@ -267,7 +267,7 @@ struct ldlm_resource {
         struct list_head       lr_converting;
         struct list_head       lr_waiting;
         ldlm_mode_t            lr_most_restr;
-        ldlm_type_t            lr_type; /* LDLM_PLAIN or LDLM_EXTENT */
+        ldlm_type_t            lr_type; /* LDLM_{PLAIN,EXTENT,FLOCK} */
         struct ldlm_resource  *lr_root;
         struct ldlm_res_id     lr_name;
         atomic_t               lr_refcount;
index a9eaa0f..93c4434 100644 (file)
@@ -820,9 +820,9 @@ struct ldlm_extent {
 struct ldlm_flock {
         __u64 start;
         __u64 end;
-        __u64 blocking_export;
-        pid_t blocking_pid;
-        pid_t pid;
+        __u64 blocking_export;  /* not actually used over the wire */
+        __u32 blocking_pid;     /* not actually used over the wire */
+        __u32 pid;
 };
 
 /* it's important that the fields of the ldlm_extent structure match
index 248b15e..2d15d50 100644 (file)
@@ -730,6 +730,7 @@ void lustre_free_reply_state(struct ptlrpc_reply_state *rs);
 int lustre_msg_size(int count, int *lengths);
 int lustre_unpack_msg(struct lustre_msg *m, int len);
 void *lustre_msg_buf(struct lustre_msg *m, int n, int minlen);
+int lustre_msg_buflen(struct lustre_msg *m, int n);
 char *lustre_msg_string (struct lustre_msg *m, int n, int max_len);
 void *lustre_swab_buf(struct lustre_msg *, int n, int minlen, void *swabber);
 void *lustre_swab_reqbuf (struct ptlrpc_request *req, int n, int minlen,
index 7b735b9..4f314e4 100644 (file)
@@ -213,7 +213,6 @@ int class_handle_ioctl(unsigned int cmd, unsigned long arg)
 
                 OBD_ALLOC(lcfg, data->ioc_plen1);
                 err = copy_from_user(lcfg, data->ioc_pbuf1, data->ioc_plen1);
-
                 if (!err)
                         err = class_process_config(lcfg);
                 OBD_FREE(lcfg, data->ioc_plen1);
index 03bbec0..e849f9c 100644 (file)
@@ -252,6 +252,22 @@ int lustre_unpack_msg(struct lustre_msg *m, int len)
         RETURN(0);
 }
 
+/**
+ * lustre_msg_buflen - return the length of buffer @n in message @m
+ * @m - lustre_msg (request or reply) to look at
+ * @n - message index (base 0)
+ *
+ * returns zero for non-existent message indices
+ */
+int lustre_msg_buflen(struct lustre_msg *m, int n)
+{
+        if (n >= m->bufcount)
+                return 0;
+
+        return m->buflens[n];
+}
+EXPORT_SYMBOL(lustre_msg_buflen);
+
 void *lustre_msg_buf(struct lustre_msg *m, int n, int min_size)
 {
         int i;
@@ -679,9 +695,10 @@ void lustre_swab_ldlm_policy_data (ldlm_policy_data_t *d)
         /* the lock data is a union and the first two fields are always an
          * extent so it's ok to process an LDLM_EXTENT and LDLM_FLOCK lock
          * data the same way. */
-        __swab64s (&d->l_flock.start);
-        __swab64s (&d->l_flock.end);
-        __swab32s (&d->l_flock.pid);
+        __swab64s(&d->l_extent.start);
+        __swab64s(&d->l_extent.end);
+        __swab64s(&d->l_extent.gid);
+        __swab32s(&d->l_flock.pid);
 }
 
 void lustre_swab_ldlm_intent (struct ldlm_intent *i)
@@ -833,8 +850,6 @@ void lustre_assert_wire_constants(void)
                  (long long)OST_LAST_OPC);
         LASSERTF(OBD_OBJECT_EOF == 0xffffffffffffffffULL," found %lld\n",
                  (long long)OBD_OBJECT_EOF);
-        LASSERTF(OST_REQ_HAS_OA1 == 1, " found %lld\n",
-                 (long long)OST_REQ_HAS_OA1);
         LASSERTF(MDS_GETATTR == 33, " found %lld\n",
                  (long long)MDS_GETATTR);
         LASSERTF(MDS_GETATTR_NAME == 34, " found %lld\n",
@@ -1857,6 +1872,10 @@ void lustre_assert_wire_constants(void)
                  (long long)(int)offsetof(struct ldlm_extent, end));
         LASSERTF((int)sizeof(((struct ldlm_extent *)0)->end) == 8, " found %lld\n",
                  (long long)(int)sizeof(((struct ldlm_extent *)0)->end));
+        LASSERTF((int)offsetof(struct ldlm_extent, gid) == 16, " found %lld\n",
+                 (long long)(int)offsetof(struct ldlm_extent, gid));
+        LASSERTF((int)sizeof(((struct ldlm_extent *)0)->gid) == 8, " found %lld\n",
+                 (long long)(int)sizeof(((struct ldlm_extent *)0)->gid));
 
         /* Checks for struct ldlm_flock */
         LASSERTF((int)sizeof(struct ldlm_flock) == 32, " found %lld\n",
index 171023f..94d42d0 100644 (file)
@@ -518,8 +518,8 @@ ptlrpc_server_handle_request (struct ptlrpc_service *svc)
                         goto put_conn;
                 }
 
-                class_update_export_timer(request->rq_export, 
-                                          (time_t)(timediff / 1000000));
+                class_update_export_timer(request->rq_export,
+                                          (time_t)(timediff / 500000));
         }
 
         /* Discard requests queued for longer than my timeout.  If the
index 0c5ca91..16db4e7 100644 (file)
@@ -866,8 +866,6 @@ main(int argc, char **argv)
 
         CHECK_DEFINE(OBD_OBJECT_EOF);
 
-        CHECK_VALUE(OST_REQ_HAS_OA1);
-
         CHECK_VALUE(MDS_GETATTR);
         CHECK_VALUE(MDS_GETATTR_NAME);
         CHECK_VALUE(MDS_CLOSE);