These changes are the raw update to linux-4.4.6-rt14. Kernel sources
[kvmfornfv.git] / kernel / drivers / staging / lustre / lustre / lov / lov_ea.c
index 2bcfaea..34c1346 100644 (file)
@@ -95,12 +95,12 @@ struct lov_stripe_md *lsm_alloc_plain(__u16 stripe_count, int *size)
        oinfo_ptrs_size = sizeof(struct lov_oinfo *) * stripe_count;
        *size = sizeof(struct lov_stripe_md) + oinfo_ptrs_size;
 
-       OBD_ALLOC_LARGE(lsm, *size);
+       lsm = libcfs_kvzalloc(*size, GFP_NOFS);
        if (!lsm)
                return NULL;
 
        for (i = 0; i < stripe_count; i++) {
-               OBD_SLAB_ALLOC_PTR_GFP(loi, lov_oinfo_slab, GFP_NOFS);
+               loi = kmem_cache_alloc(lov_oinfo_slab, GFP_NOFS | __GFP_ZERO);
                if (loi == NULL)
                        goto err;
                lsm->lsm_oinfo[i] = loi;
@@ -110,8 +110,8 @@ struct lov_stripe_md *lsm_alloc_plain(__u16 stripe_count, int *size)
 
 err:
        while (--i >= 0)
-               OBD_SLAB_FREE(lsm->lsm_oinfo[i], lov_oinfo_slab, sizeof(*loi));
-       OBD_FREE_LARGE(lsm, *size);
+               kmem_cache_free(lov_oinfo_slab, lsm->lsm_oinfo[i]);
+       kvfree(lsm);
        return NULL;
 }
 
@@ -121,10 +121,8 @@ void lsm_free_plain(struct lov_stripe_md *lsm)
        int i;
 
        for (i = 0; i < stripe_count; i++)
-               OBD_SLAB_FREE(lsm->lsm_oinfo[i], lov_oinfo_slab,
-                             sizeof(struct lov_oinfo));
-       OBD_FREE_LARGE(lsm, sizeof(struct lov_stripe_md) +
-                      stripe_count * sizeof(struct lov_oinfo *));
+               kmem_cache_free(lov_oinfo_slab, lsm->lsm_oinfo[i]);
+       kvfree(lsm);
 }
 
 static void lsm_unpackmd_common(struct lov_stripe_md *lsm,