Whamcloud - gitweb
b=23428 Fix lustre built with --enable-lu_ref
[fs/lustre-release.git] / lustre / obdfilter / filter_lvb.c
index eed2a34..08c41e2 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
@@ -79,7 +79,7 @@ static int filter_lvbo_init(struct ldlm_resource *res)
         obd = res->lr_namespace->ns_lvbp;
         LASSERT(obd != NULL);
 
-        CDEBUG(D_INODE, "%s: filter_lvbo_init(o_gr="LPU64", o_id="
+        CDEBUG(D_INODE, "%s: filter_lvbo_init(o_seq="LPU64", o_id="
                LPU64")\n", obd->obd_name, res->lr_name.name[1],
                res->lr_name.name[0]);
 
@@ -120,8 +120,8 @@ out_dentry:
  *
  *   If 'increase_only' is true, don't allow values to move backwards.
  */
-static int filter_lvbo_update(struct ldlm_resource *res, struct lustre_msg *m,
-                              int buf_idx, int increase_only)
+static int filter_lvbo_update(struct ldlm_resource *res,
+                              struct ptlrpc_request *r, int increase_only)
 {
         int rc = 0;
         struct ost_lvb *lvb;
@@ -131,7 +131,7 @@ static int filter_lvbo_update(struct ldlm_resource *res, struct lustre_msg *m,
 
         LASSERT(res);
 
-        down(&res->lr_lvb_sem);
+        cfs_down(&res->lr_lvb_sem);
         lvb = res->lr_lvb_data;
         if (lvb == NULL) {
                 CERROR("No lvb when running lvbo_update!\n");
@@ -139,11 +139,12 @@ static int filter_lvbo_update(struct ldlm_resource *res, struct lustre_msg *m,
         }
 
         /* Update the LVB from the network message */
-        if (m != NULL) {
+        if (r != NULL) {
                 struct ost_lvb *new;
 
-                new = lustre_swab_buf(m, buf_idx, sizeof(*new),
-                                      lustre_swab_ost_lvb);
+                /* XXX update always from reply buffer */
+                new = req_capsule_server_get(&r->rq_pill, &RMF_DLM_LVB);
+
                 if (new == NULL) {
                         CERROR("lustre_swab_buf failed\n");
                         goto disk_update;
@@ -223,7 +224,7 @@ out_dentry:
         f_dput(dentry);
 
 out:
-        up(&res->lr_lvb_sem);
+        cfs_up(&res->lr_lvb_sem);
         return rc;
 }