Whamcloud - gitweb
b=16424
[fs/lustre-release.git] / lustre / lov / lov_ea.c
index f403660..a2bda24 100755 (executable)
@@ -112,7 +112,7 @@ struct lov_stripe_md *lsm_alloc_plain(int stripe_count, int *size)
                 return NULL;;
 
         for (i = 0; i < stripe_count; i++) {
-                OBD_SLAB_ALLOC(loi, lov_oinfo_slab, CFS_ALLOC_IO, sizeof(*loi));
+                OBD_SLAB_ALLOC_PTR_GFP(loi, lov_oinfo_slab, CFS_ALLOC_IO);
                 if (loi == NULL)
                         goto err;
                 lsm->lsm_oinfo[i] = loi;
@@ -255,7 +255,7 @@ int lsm_unpackmd_v1(struct lov_obd *lov, struct lov_stripe_md *lsm,
         return 0;
 }
 
-struct lsm_operations lsm_v1_ops = {
+const struct lsm_operations lsm_v1_ops = {
         .lsm_free            = lsm_free_plain,
         .lsm_destroy         = lsm_destroy_plain,
         .lsm_stripe_by_index    = lsm_stripe_by_index_plain,
@@ -500,7 +500,7 @@ static int lsm_revalidate_join(struct lov_stripe_md *lsm,
         OBD_ALLOC(lsm->lsm_array->lai_ext_array,lsm->lsm_array->lai_ext_count *
                                                 sizeof (struct lov_extent));
         if (!lsm->lsm_array->lai_ext_array)
-                GOTO(release_ctxt, rc = -ENOMEM);        
+                GOTO(release_ctxt, rc = -ENOMEM);
 
         CDEBUG(D_INFO, "get lsm logid: "LPU64":"LPU64"\n",
                lsm->lsm_array->lai_array_id.lgl_oid,
@@ -526,7 +526,7 @@ release_ctxt:
         RETURN(rc);
 }
 
-int lsm_destroy_join(struct lov_stripe_md *lsm, struct obdo *oa, 
+int lsm_destroy_join(struct lov_stripe_md *lsm, struct obdo *oa,
                       struct obd_export *md_exp)
 {
         struct llog_ctxt *ctxt;
@@ -619,7 +619,7 @@ out:
         RETURN(rc);
 }
 
-struct lsm_operations lsm_join_ops = {
+const struct lsm_operations lsm_join_ops = {
         .lsm_free             = lsm_free_join,
         .lsm_destroy          = lsm_destroy_join,
         .lsm_stripe_by_index  = lsm_stripe_by_index_join,
@@ -694,7 +694,7 @@ int lsm_unpackmd_v3(struct lov_obd *lov, struct lov_stripe_md *lsm,
         return 0;
 }
 
-struct lsm_operations lsm_v3_ops = {
+const struct lsm_operations lsm_v3_ops = {
         .lsm_free            = lsm_free_plain,
         .lsm_destroy         = lsm_destroy_plain,
         .lsm_stripe_by_index    = lsm_stripe_by_index_plain,