Whamcloud - gitweb
LU-573: conf-sanity test_22 failed with 41
[fs/lustre-release.git] / lustre / lov / lov_pack.c
index ca92e35..32cc2ad 100644 (file)
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
+ * Copyright (c) 2011 Whamcloud, Inc.
+ */
+/*
  * This file is part of Lustre, http://www.lustre.org/
  * Lustre is a trademark of Sun Microsystems, Inc.
  *
@@ -59,7 +62,7 @@ static void lov_dump_lmm_common(int level, void *lmmp)
         struct lov_mds_md *lmm = lmmp;
 
         CDEBUG(level, "objid "LPX64", magic 0x%08x, pattern %#x\n",
-               le64_to_cpu(lmm->lmm_object_id),
+               (__u64)le64_to_cpu(lmm->lmm_object_id),
                le32_to_cpu(lmm->lmm_magic),
                le32_to_cpu(lmm->lmm_pattern));
         CDEBUG(level,"stripe_size %u, stripe_count %u\n",
@@ -80,8 +83,8 @@ static void lov_dump_lmm_objects(int level, struct lov_ost_data *lod,
         for (i = 0; i < stripe_count; ++i, ++lod) {
                 CDEBUG(level, "stripe %u idx %u subobj "LPX64"/"LPX64"\n", i,
                        le32_to_cpu(lod->l_ost_idx),
-                       le64_to_cpu(lod->l_object_gr),
-                       le64_to_cpu(lod->l_object_id));
+                       (__u64)le64_to_cpu(lod->l_object_seq),
+                       (__u64)le64_to_cpu(lod->l_object_id));
         }
 }
 
@@ -187,13 +190,13 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
         if (*lmmp && !lsm) {
                 stripe_count = le32_to_cpu((*lmmp)->lmm_stripe_count);
                 lmm_size = lov_mds_md_size(stripe_count, lmm_magic);
-                OBD_FREE(*lmmp, lmm_size);
+                OBD_FREE_LARGE(*lmmp, lmm_size);
                 *lmmp = NULL;
                 RETURN(0);
         }
 
         if (!*lmmp) {
-                OBD_ALLOC(*lmmp, lmm_size);
+                OBD_ALLOC_LARGE(*lmmp, lmm_size);
                 if (!*lmmp)
                         RETURN(-ENOMEM);
         }
@@ -215,7 +218,7 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
          * same first fields
          */
         lmmv1->lmm_object_id = cpu_to_le64(lsm->lsm_object_id);
-        lmmv1->lmm_object_gr = cpu_to_le64(lsm->lsm_object_gr);
+        lmmv1->lmm_object_seq = cpu_to_le64(lsm->lsm_object_seq);
         lmmv1->lmm_stripe_size = cpu_to_le32(lsm->lsm_stripe_size);
         lmmv1->lmm_stripe_count = cpu_to_le32(stripe_count);
         lmmv1->lmm_pattern = cpu_to_le32(lsm->lsm_pattern);
@@ -229,12 +232,11 @@ int lov_packmd(struct obd_export *exp, struct lov_mds_md **lmmp,
 
         for (i = 0; i < stripe_count; i++) {
                 struct lov_oinfo *loi = lsm->lsm_oinfo[i];
-
                 /* XXX LOV STACKING call down to osc_packmd() to do packing */
                 LASSERTF(loi->loi_id, "lmm_oid "LPU64" stripe %u/%u idx %u\n",
                          lmmv1->lmm_object_id, i, stripe_count, loi->loi_ost_idx);
                 lmm_objects[i].l_object_id = cpu_to_le64(loi->loi_id);
-                lmm_objects[i].l_object_gr = cpu_to_le64(loi->loi_gr);
+                lmm_objects[i].l_object_seq = cpu_to_le64(loi->loi_seq);
                 lmm_objects[i].l_ost_gen = cpu_to_le32(loi->loi_ost_gen);
                 lmm_objects[i].l_ost_idx = cpu_to_le32(loi->loi_ost_idx);
         }
@@ -272,7 +274,7 @@ static int lov_verify_lmm(void *lmm, int lmm_bytes, int *stripe_count)
                 CERROR("bad disk LOV MAGIC: 0x%08X; dumping LMM (size=%d):\n",
                        le32_to_cpu(*(__u32 *)lmm), lmm_bytes);
                 sz = lmm_bytes * 2 + 1;
-                OBD_ALLOC(buffer, sz);
+                OBD_ALLOC_LARGE(buffer, sz);
                 if (buffer != NULL) {
                         int i;
 
@@ -280,7 +282,7 @@ static int lov_verify_lmm(void *lmm, int lmm_bytes, int *stripe_count)
                                 sprintf(buffer+2*i, "%.2X", ((char *)lmm)[i]);
                         buffer[sz] = '\0';
                         CERROR("%s\n", buffer);
-                        OBD_FREE(buffer, sz);
+                        OBD_FREE_LARGE(buffer, sz);
                 }
                 return -EINVAL;
         }
@@ -290,7 +292,7 @@ static int lov_verify_lmm(void *lmm, int lmm_bytes, int *stripe_count)
 }
 
 int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count,
-                      int pattern, int magic)
+                    int pattern, int magic)
 {
         int i, lsm_size;
         ENTRY;
@@ -559,7 +561,7 @@ int lov_setea(struct obd_export *exp, struct lov_stripe_md **lsmp,
                 (*lsmp)->lsm_oinfo[i]->loi_ost_idx =
                         lmm_objects[i].l_ost_idx;
                 (*lsmp)->lsm_oinfo[i]->loi_id = lmm_objects[i].l_object_id;
-                (*lsmp)->lsm_oinfo[i]->loi_gr = lmm_objects[i].l_object_gr;
+                (*lsmp)->lsm_oinfo[i]->loi_seq = lmm_objects[i].l_object_seq;
         }
         RETURN(0);
 }