From: nikita Date: Tue, 17 Feb 2009 18:55:53 +0000 (+0000) Subject: OBD_SLAB_ALLOC_PTR_SAFE() is a new OBD_ macro for slab allocation that uses CFS_ALLOC... X-Git-Tag: v1_9_162~49 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=b401ba0c214b184424146dda994470aa3c4356c9 OBD_SLAB_ALLOC_PTR_SAFE() is a new OBD_ macro for slab allocation that uses CFS_ALLOC_IO allocation mask (i.e., without CFS_ALLOC_FS), thus preventing file system re-entrance. b=18499 i=alexander.zarochentsev@sun.com i=adilger@sun.com --- diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index 64a6294..ff1b2d5 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -721,6 +721,8 @@ do { \ OBD_SLAB_ALLOC((ptr), (slab), CFS_ALLOC_STD, sizeof *(ptr)) #define OBD_SLAB_FREE_PTR(ptr, slab) \ OBD_SLAB_FREE((ptr), (slab), sizeof *(ptr)) +#define OBD_SLAB_ALLOC_PTR_GFP(ptr, slab, gfp) \ + OBD_SLAB_ALLOC((ptr), (slab), (gfp), sizeof *(ptr)) #define KEY_IS(str) \ (keylen >= (sizeof(str)-1) && memcmp(key, str, (sizeof(str)-1)) == 0) diff --git a/lustre/lclient/lcommon_cl.c b/lustre/lclient/lcommon_cl.c index c06573a..2b96562 100644 --- a/lustre/lclient/lcommon_cl.c +++ b/lustre/lclient/lcommon_cl.c @@ -144,7 +144,7 @@ void *ccc_key_init(const struct lu_context *ctx, { struct ccc_thread_info *info; - OBD_SLAB_ALLOC_PTR(info, ccc_thread_kmem); + OBD_SLAB_ALLOC_PTR_GFP(info, ccc_thread_kmem, CFS_ALLOC_IO); if (info == NULL) info = ERR_PTR(-ENOMEM); return info; @@ -162,7 +162,7 @@ void *ccc_session_key_init(const struct lu_context *ctx, { struct ccc_session *session; - OBD_SLAB_ALLOC_PTR(session, ccc_session_kmem); + OBD_SLAB_ALLOC_PTR_GFP(session, ccc_session_kmem, CFS_ALLOC_IO); if (session == NULL) session = ERR_PTR(-ENOMEM); return session; @@ -280,7 +280,7 @@ int ccc_req_init(const struct lu_env *env, struct cl_device *dev, struct ccc_req *vrq; int result; - OBD_SLAB_ALLOC_PTR(vrq, ccc_req_kmem); + OBD_SLAB_ALLOC_PTR_GFP(vrq, ccc_req_kmem, CFS_ALLOC_IO); if (vrq != NULL) { cl_req_slice_add(req, &vrq->crq_cl, dev, &ccc_req_ops); result = 0; @@ -345,7 +345,7 @@ struct lu_object *ccc_object_alloc(const struct lu_env *env, struct ccc_object *vob; struct lu_object *obj; - OBD_SLAB_ALLOC_PTR(vob, ccc_object_kmem); + OBD_SLAB_ALLOC_PTR_GFP(vob, ccc_object_kmem, CFS_ALLOC_IO); if (vob != NULL) { struct cl_object_header *hdr; @@ -413,7 +413,7 @@ int ccc_lock_init(const struct lu_env *env, CLOBINVRNT(env, obj, ccc_object_invariant(obj)); - OBD_SLAB_ALLOC_PTR(clk, ccc_lock_kmem); + OBD_SLAB_ALLOC_PTR_GFP(clk, ccc_lock_kmem, CFS_ALLOC_IO); if (clk != NULL) { cl_lock_slice_add(lock, &clk->clk_cl, obj, lkops); result = 0; diff --git a/lustre/ldlm/ldlm_extent.c b/lustre/ldlm/ldlm_extent.c index 0858207..03172d6 100644 --- a/lustre/ldlm/ldlm_extent.c +++ b/lustre/ldlm/ldlm_extent.c @@ -801,7 +801,7 @@ struct ldlm_interval *ldlm_interval_alloc(struct ldlm_lock *lock) ENTRY; LASSERT(lock->l_resource->lr_type == LDLM_EXTENT); - OBD_SLAB_ALLOC(node, ldlm_interval_slab, CFS_ALLOC_IO, sizeof(*node)); + OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, CFS_ALLOC_IO); if (node == NULL) RETURN(NULL); diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index b3b36a8..06314db 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -339,7 +339,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource) if (resource == NULL) LBUG(); - OBD_SLAB_ALLOC(lock, ldlm_lock_slab, CFS_ALLOC_IO, sizeof(*lock)); + OBD_SLAB_ALLOC_PTR_GFP(lock, ldlm_lock_slab, CFS_ALLOC_IO); if (lock == NULL) RETURN(NULL); @@ -1245,8 +1245,7 @@ ldlm_error_t ldlm_lock_enqueue(struct ldlm_namespace *ns, * have to allocate the interval node early otherwise we can't regrant * this lock in the future. - jay */ if (!local && (*flags & LDLM_FL_REPLAY) && res->lr_type == LDLM_EXTENT) - OBD_SLAB_ALLOC(node, ldlm_interval_slab, CFS_ALLOC_IO, - sizeof(*node)); + OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, CFS_ALLOC_IO); lock_res_and_lock(lock); if (local && lock->l_req_mode == lock->l_granted_mode) { @@ -1733,7 +1732,7 @@ struct ldlm_resource *ldlm_lock_convert(struct ldlm_lock *lock, int new_mode, /* I can't check the type of lock here because the bitlock of lock * is not held here, so do the allocation blindly. -jay */ - OBD_SLAB_ALLOC(node, ldlm_interval_slab, CFS_ALLOC_IO, sizeof(*node)); + OBD_SLAB_ALLOC_PTR_GFP(node, ldlm_interval_slab, CFS_ALLOC_IO); if (node == NULL) /* Actually, this causes EDEADLOCK to be returned */ RETURN(NULL); diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index c04d948..1a1c67e 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -774,7 +774,7 @@ static struct ldlm_resource *ldlm_resource_new(void) struct ldlm_resource *res; int idx; - OBD_SLAB_ALLOC(res, ldlm_resource_slab, CFS_ALLOC_IO, sizeof *res); + OBD_SLAB_ALLOC_PTR_GFP(res, ldlm_resource_slab, CFS_ALLOC_IO); if (res == NULL) return NULL; diff --git a/lustre/llite/file.c b/lustre/llite/file.c index cfa7f03..e9d3c87 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -55,7 +55,7 @@ struct ll_file_data *ll_file_data_get(void) { struct ll_file_data *fd; - OBD_SLAB_ALLOC_PTR(fd, ll_file_data_slab); + OBD_SLAB_ALLOC_PTR_GFP(fd, ll_file_data_slab, CFS_ALLOC_IO); return fd; } diff --git a/lustre/llite/remote_perm.c b/lustre/llite/remote_perm.c index 420d0fa..08c4bc1 100644 --- a/lustre/llite/remote_perm.c +++ b/lustre/llite/remote_perm.c @@ -63,7 +63,7 @@ static inline struct ll_remote_perm *alloc_ll_remote_perm(void) { struct ll_remote_perm *lrp; - OBD_SLAB_ALLOC(lrp, ll_remote_perm_cachep, GFP_KERNEL, sizeof(*lrp)); + OBD_SLAB_ALLOC_PTR_GFP(lrp, ll_remote_perm_cachep, GFP_KERNEL); if (lrp) INIT_HLIST_NODE(&lrp->lrp_list); return lrp; diff --git a/lustre/llite/super25.c b/lustre/llite/super25.c index b61e7fc..b860101 100644 --- a/lustre/llite/super25.c +++ b/lustre/llite/super25.c @@ -54,7 +54,7 @@ static struct inode *ll_alloc_inode(struct super_block *sb) { struct ll_inode_info *lli; ll_stats_ops_tally(ll_s2sbi(sb), LPROC_LL_ALLOC_INODE, 1); - OBD_SLAB_ALLOC_PTR(lli, ll_inode_cachep); + OBD_SLAB_ALLOC_PTR_GFP(lli, ll_inode_cachep, CFS_ALLOC_IO); if (lli == NULL) return NULL; diff --git a/lustre/llite/vvp_dev.c b/lustre/llite/vvp_dev.c index 8347789..3940252 100644 --- a/lustre/llite/vvp_dev.c +++ b/lustre/llite/vvp_dev.c @@ -89,7 +89,7 @@ static void *vvp_key_init(const struct lu_context *ctx, { struct vvp_thread_info *info; - OBD_SLAB_ALLOC_PTR(info, vvp_thread_kmem); + OBD_SLAB_ALLOC_PTR_GFP(info, vvp_thread_kmem, CFS_ALLOC_IO); if (info == NULL) info = ERR_PTR(-ENOMEM); return info; @@ -107,7 +107,7 @@ static void *vvp_session_key_init(const struct lu_context *ctx, { struct vvp_session *session; - OBD_SLAB_ALLOC_PTR(session, vvp_session_kmem); + OBD_SLAB_ALLOC_PTR_GFP(session, vvp_session_kmem, CFS_ALLOC_IO); if (session == NULL) session = ERR_PTR(-ENOMEM); return session; diff --git a/lustre/llite/vvp_page.c b/lustre/llite/vvp_page.c index b698f52..14e7fdb 100644 --- a/lustre/llite/vvp_page.c +++ b/lustre/llite/vvp_page.c @@ -534,7 +534,7 @@ struct cl_page *vvp_page_init(const struct lu_env *env, struct cl_object *obj, CLOBINVRNT(env, obj, ccc_object_invariant(obj)); - OBD_SLAB_ALLOC_PTR(cpg, vvp_page_kmem); + OBD_SLAB_ALLOC_PTR_GFP(cpg, vvp_page_kmem, CFS_ALLOC_IO); if (cpg != NULL) { cpg->cpg_page = vmpage; page_cache_get(vmpage); diff --git a/lustre/lmv/lmv_object.c b/lustre/lmv/lmv_object.c index f10c23c..b96f9f9 100644 --- a/lustre/lmv/lmv_object.c +++ b/lustre/lmv/lmv_object.c @@ -78,8 +78,7 @@ struct lmv_object *lmv_object_alloc(struct obd_device *obd, || mea->mea_magic == MEA_MAGIC_ALL_CHARS || mea->mea_magic == MEA_MAGIC_HASH_SEGMENT); - OBD_SLAB_ALLOC(obj, lmv_object_cache, CFS_ALLOC_STD, - sizeof(*obj)); + OBD_SLAB_ALLOC_PTR(obj, lmv_object_cache); if (!obj) return NULL; diff --git a/lustre/lov/lov_dev.c b/lustre/lov/lov_dev.c index 32dfe3a..cab0e3b 100644 --- a/lustre/lov/lov_dev.c +++ b/lustre/lov/lov_dev.c @@ -155,7 +155,7 @@ static void *lov_key_init(const struct lu_context *ctx, { struct lov_thread_info *info; - OBD_SLAB_ALLOC_PTR(info, lov_thread_kmem); + OBD_SLAB_ALLOC_PTR_GFP(info, lov_thread_kmem, CFS_ALLOC_IO); if (info != NULL) CFS_INIT_LIST_HEAD(&info->lti_closure.clc_list); else @@ -182,7 +182,7 @@ static void *lov_session_key_init(const struct lu_context *ctx, { struct lov_session *info; - OBD_SLAB_ALLOC_PTR(info, lov_session_kmem); + OBD_SLAB_ALLOC_PTR_GFP(info, lov_session_kmem, CFS_ALLOC_IO); if (info == NULL) info = ERR_PTR(-ENOMEM); return info; @@ -272,7 +272,7 @@ static int lov_req_init(const struct lu_env *env, struct cl_device *dev, int result; ENTRY; - OBD_SLAB_ALLOC_PTR(lr, lov_req_kmem); + OBD_SLAB_ALLOC_PTR_GFP(lr, lov_req_kmem, CFS_ALLOC_IO); if (lr != NULL) { cl_req_slice_add(req, &lr->lr_cl, dev, &lov_req_ops); result = 0; diff --git a/lustre/lov/lov_ea.c b/lustre/lov/lov_ea.c index 564246a..a2bda24 100755 --- a/lustre/lov/lov_ea.c +++ b/lustre/lov/lov_ea.c @@ -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; diff --git a/lustre/lov/lov_lock.c b/lustre/lov/lov_lock.c index 2917d78..9c741f8 100644 --- a/lustre/lov/lov_lock.c +++ b/lustre/lov/lov_lock.c @@ -144,7 +144,7 @@ static struct cl_lock *lov_sublock_alloc(const struct lu_env *env, LASSERT(idx < lck->lls_nr); ENTRY; - OBD_SLAB_ALLOC_PTR(link, lov_lock_link_kmem); + OBD_SLAB_ALLOC_PTR_GFP(link, lov_lock_link_kmem, CFS_ALLOC_IO); if (link != NULL) { struct lov_sublock_env *subenv; struct lov_lock_sub *lls; @@ -330,6 +330,7 @@ static int lov_lock_sub_init(const struct lu_env *env, descr->cld_start = cl_index(descr->cld_obj, start); descr->cld_end = cl_index(descr->cld_obj, end); descr->cld_mode = parent->cll_descr.cld_mode; + /* XXX has no effect */ lck->lls_sub[nr].sub_got = *descr; lck->lls_sub[nr].sub_stripe = stripe; nr++; @@ -1024,7 +1025,7 @@ int lov_lock_init_raid0(const struct lu_env *env, struct cl_object *obj, int result; ENTRY; - OBD_SLAB_ALLOC_PTR(lck, lov_lock_kmem); + OBD_SLAB_ALLOC_PTR_GFP(lck, lov_lock_kmem, CFS_ALLOC_IO); if (lck != NULL) { cl_lock_slice_add(lock, &lck->lls_cl, obj, &lov_lock_ops); result = lov_lock_sub_init(env, lck, io); diff --git a/lustre/lov/lov_object.c b/lustre/lov/lov_object.c index d5781b4..2ecd756 100644 --- a/lustre/lov/lov_object.c +++ b/lustre/lov/lov_object.c @@ -680,7 +680,7 @@ struct lu_object *lov_object_alloc(const struct lu_env *env, struct lu_object *obj; ENTRY; - OBD_SLAB_ALLOC_PTR(lov, lov_object_kmem); + OBD_SLAB_ALLOC_PTR_GFP(lov, lov_object_kmem, CFS_ALLOC_IO); if (lov != NULL) { obj = lov2lu(lov); lu_object_init(obj, NULL, dev); diff --git a/lustre/lov/lov_page.c b/lustre/lov/lov_page.c index 3efbc41..f50d345 100644 --- a/lustre/lov/lov_page.c +++ b/lustre/lov/lov_page.c @@ -142,7 +142,7 @@ struct cl_page *lov_page_init_raid0(const struct lu_env *env, int result; ENTRY; - OBD_SLAB_ALLOC_PTR(lpg, lov_page_kmem); + OBD_SLAB_ALLOC_PTR_GFP(lpg, lov_page_kmem, CFS_ALLOC_IO); if (lpg != NULL) { loff_t offset; int stripe; @@ -208,7 +208,7 @@ struct cl_page *lov_page_init_empty(const struct lu_env *env, int result = -ENOMEM; ENTRY; - OBD_SLAB_ALLOC_PTR(lpg, lov_page_kmem); + OBD_SLAB_ALLOC_PTR_GFP(lpg, lov_page_kmem, CFS_ALLOC_IO); if (lpg != NULL) { void *addr; cl_page_slice_add(page, &lpg->lps_cl, diff --git a/lustre/lov/lovsub_dev.c b/lustre/lov/lovsub_dev.c index 359def4..f3ba099 100644 --- a/lustre/lov/lovsub_dev.c +++ b/lustre/lov/lovsub_dev.c @@ -148,7 +148,7 @@ static int lovsub_req_init(const struct lu_env *env, struct cl_device *dev, struct lovsub_req *lsr; int result; - OBD_SLAB_ALLOC_PTR(lsr, lovsub_req_kmem); + OBD_SLAB_ALLOC_PTR_GFP(lsr, lovsub_req_kmem, CFS_ALLOC_IO); if (lsr != NULL) { cl_req_slice_add(req, &lsr->lsrq_cl, dev, &lovsub_req_ops); result = 0; diff --git a/lustre/lov/lovsub_lock.c b/lustre/lov/lovsub_lock.c index f02a2ce..d1f2757 100644 --- a/lustre/lov/lovsub_lock.c +++ b/lustre/lov/lovsub_lock.c @@ -417,7 +417,7 @@ int lovsub_lock_init(const struct lu_env *env, struct cl_object *obj, int result; ENTRY; - OBD_SLAB_ALLOC_PTR(lsk, lovsub_lock_kmem); + OBD_SLAB_ALLOC_PTR_GFP(lsk, lovsub_lock_kmem, CFS_ALLOC_IO); if (lsk != NULL) { CFS_INIT_LIST_HEAD(&lsk->lss_parents); cl_lock_slice_add(lock, &lsk->lss_cl, obj, &lovsub_lock_ops); diff --git a/lustre/lov/lovsub_object.c b/lustre/lov/lovsub_object.c index a2c4f061..39f4edd 100644 --- a/lustre/lov/lovsub_object.c +++ b/lustre/lov/lovsub_object.c @@ -141,7 +141,7 @@ struct lu_object *lovsub_object_alloc(const struct lu_env *env, struct lu_object *obj; ENTRY; - OBD_SLAB_ALLOC_PTR(los, lovsub_object_kmem); + OBD_SLAB_ALLOC_PTR_GFP(los, lovsub_object_kmem, CFS_ALLOC_IO); if (los != NULL) { struct cl_object_header *hdr; diff --git a/lustre/lov/lovsub_page.c b/lustre/lov/lovsub_page.c index 70e1f56..59bd749 100644 --- a/lustre/lov/lovsub_page.c +++ b/lustre/lov/lovsub_page.c @@ -71,7 +71,7 @@ struct cl_page *lovsub_page_init(const struct lu_env *env, int result; ENTRY; - OBD_SLAB_ALLOC_PTR(lsb, lovsub_page_kmem); + OBD_SLAB_ALLOC_PTR_GFP(lsb, lovsub_page_kmem, CFS_ALLOC_IO); if (lsb != NULL) { cl_page_slice_add(page, &lsb->lsb_cl, obj, &lovsub_page_ops); result = 0; diff --git a/lustre/lvfs/fsfilt_ext3.c b/lustre/lvfs/fsfilt_ext3.c index 16b250e..d69e284 100644 --- a/lustre/lvfs/fsfilt_ext3.c +++ b/lustre/lvfs/fsfilt_ext3.c @@ -696,7 +696,7 @@ static int fsfilt_ext3_add_journal_cb(struct obd_device *obd, __u64 last_rcvd, { struct fsfilt_cb_data *fcb; - OBD_SLAB_ALLOC(fcb, fcb_cache, CFS_ALLOC_IO, sizeof *fcb); + OBD_SLAB_ALLOC_PTR_GFP(fcb, fcb_cache, CFS_ALLOC_IO); if (fcb == NULL) RETURN(-ENOMEM); diff --git a/lustre/obdclass/cl_lock.c b/lustre/obdclass/cl_lock.c index 1dae0f8..c3dd3c4 100644 --- a/lustre/obdclass/cl_lock.c +++ b/lustre/obdclass/cl_lock.c @@ -332,7 +332,7 @@ static struct cl_lock *cl_lock_alloc(const struct lu_env *env, struct cl_site *site = cl_object_site(obj); ENTRY; - OBD_SLAB_ALLOC_PTR(lock, cl_lock_kmem); + OBD_SLAB_ALLOC_PTR_GFP(lock, cl_lock_kmem, CFS_ALLOC_IO); if (lock != NULL) { atomic_set(&lock->cll_ref, 1); lock->cll_descr = *descr; diff --git a/lustre/obdclass/cl_object.c b/lustre/obdclass/cl_object.c index 0310b75..35a7cf5 100644 --- a/lustre/obdclass/cl_object.c +++ b/lustre/obdclass/cl_object.c @@ -562,7 +562,7 @@ static struct lu_env *cl_env_new(__u32 tags, void *debug) struct lu_env *env; struct cl_env *cle; - OBD_SLAB_ALLOC_PTR(cle, cl_env_kmem); + OBD_SLAB_ALLOC_PTR_GFP(cle, cl_env_kmem, CFS_ALLOC_IO); if (cle != NULL) { int rc; diff --git a/lustre/obdclass/cl_page.c b/lustre/obdclass/cl_page.c index e88427b..d79c6c8 100644 --- a/lustre/obdclass/cl_page.c +++ b/lustre/obdclass/cl_page.c @@ -320,7 +320,7 @@ static int cl_page_alloc(const struct lu_env *env, struct cl_object *o, ENTRY; result = +1; - OBD_SLAB_ALLOC_PTR(page, cl_page_kmem); + OBD_SLAB_ALLOC_PTR_GFP(page, cl_page_kmem, CFS_ALLOC_IO); if (page != NULL) { atomic_set(&page->cp_ref, 1); page->cp_obj = o; diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 7341aaa..615b2f9 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -73,7 +73,7 @@ static struct obd_device *obd_device_alloc(void) { struct obd_device *obd; - OBD_SLAB_ALLOC_PTR(obd, obd_device_cachep); + OBD_SLAB_ALLOC_PTR_GFP(obd, obd_device_cachep, CFS_ALLOC_IO); if (obd != NULL) { obd->obd_magic = OBD_DEVICE_MAGIC; } diff --git a/lustre/obdecho/echo_client.c b/lustre/obdecho/echo_client.c index 16cab35..fa00083 100644 --- a/lustre/obdecho/echo_client.c +++ b/lustre/obdecho/echo_client.c @@ -384,7 +384,7 @@ static struct cl_page *echo_page_init(const struct lu_env *env, struct echo_page *ep; ENTRY; - OBD_SLAB_ALLOC_PTR(ep, echo_page_kmem); + OBD_SLAB_ALLOC_PTR_GFP(ep, echo_page_kmem, CFS_ALLOC_IO); if (ep != NULL) { struct echo_object *eco = cl2echo_obj(obj); ep->ep_vmpage = vmpage; @@ -408,7 +408,7 @@ static int echo_lock_init(const struct lu_env *env, struct echo_lock *el; ENTRY; - OBD_SLAB_ALLOC_PTR(el, echo_lock_kmem); + OBD_SLAB_ALLOC_PTR_GFP(el, echo_lock_kmem, CFS_ALLOC_IO); if (el != NULL) { cl_lock_slice_add(lock, &el->el_cl, obj, &echo_lock_ops); el->el_object = cl2echo_obj(obj); @@ -531,7 +531,7 @@ static struct lu_object *echo_object_alloc(const struct lu_env *env, /* we're the top dev. */ LASSERT(hdr == NULL); - OBD_SLAB_ALLOC_PTR(eco, echo_object_kmem); + OBD_SLAB_ALLOC_PTR_GFP(eco, echo_object_kmem, CFS_ALLOC_IO); if (eco != NULL) { struct cl_object_header *hdr = &eco->eo_hdr; @@ -593,7 +593,7 @@ static void *echo_thread_key_init(const struct lu_context *ctx, { struct echo_thread_info *info; - OBD_SLAB_ALLOC_PTR(info, echo_thread_kmem); + OBD_SLAB_ALLOC_PTR_GFP(info, echo_thread_kmem, CFS_ALLOC_IO); if (info == NULL) info = ERR_PTR(-ENOMEM); return info; @@ -623,7 +623,7 @@ static void *echo_session_key_init(const struct lu_context *ctx, { struct echo_session_info *session; - OBD_SLAB_ALLOC_PTR(session, echo_session_kmem); + OBD_SLAB_ALLOC_PTR_GFP(session, echo_session_kmem, CFS_ALLOC_IO); if (session == NULL) session = ERR_PTR(-ENOMEM); return session; diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index d6782e2..d1fa9f5 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -542,7 +542,7 @@ struct filter_mod_data *filter_fmd_get(struct obd_export *exp, struct filter_export_data *fed = &exp->exp_filter_data; struct filter_mod_data *found = NULL, *fmd_new = NULL; - OBD_SLAB_ALLOC(fmd_new, ll_fmd_cachep, CFS_ALLOC_IO, sizeof(*fmd_new)); + OBD_SLAB_ALLOC_PTR_GFP(fmd_new, ll_fmd_cachep, CFS_ALLOC_IO); spin_lock(&fed->fed_lock); found = filter_fmd_find_nolock(&exp->exp_obd->u.filter,fed,objid,group); diff --git a/lustre/osc/osc_dev.c b/lustre/osc/osc_dev.c index 228b157..068f0d5 100644 --- a/lustre/osc/osc_dev.c +++ b/lustre/osc/osc_dev.c @@ -114,7 +114,7 @@ static void *osc_key_init(const struct lu_context *ctx, { struct osc_thread_info *info; - OBD_SLAB_ALLOC_PTR(info, osc_thread_kmem); + OBD_SLAB_ALLOC_PTR_GFP(info, osc_thread_kmem, CFS_ALLOC_IO); if (info == NULL) info = ERR_PTR(-ENOMEM); return info; @@ -138,7 +138,7 @@ static void *osc_session_init(const struct lu_context *ctx, { struct osc_session *info; - OBD_SLAB_ALLOC_PTR(info, osc_session_kmem); + OBD_SLAB_ALLOC_PTR_GFP(info, osc_session_kmem, CFS_ALLOC_IO); if (info == NULL) info = ERR_PTR(-ENOMEM); return info; diff --git a/lustre/osc/osc_io.c b/lustre/osc/osc_io.c index fd38a1c..0df758c 100644 --- a/lustre/osc/osc_io.c +++ b/lustre/osc/osc_io.c @@ -641,7 +641,7 @@ int osc_req_init(const struct lu_env *env, struct cl_device *dev, struct osc_req *or; int result; - OBD_SLAB_ALLOC_PTR(or, osc_req_kmem); + OBD_SLAB_ALLOC_PTR_GFP(or, osc_req_kmem, CFS_ALLOC_IO); if (or != NULL) { cl_req_slice_add(req, &or->or_cl, dev, &osc_req_ops); result = 0; diff --git a/lustre/osc/osc_lock.c b/lustre/osc/osc_lock.c index 7a87e69..ef82a95 100644 --- a/lustre/osc/osc_lock.c +++ b/lustre/osc/osc_lock.c @@ -1637,7 +1637,7 @@ int osc_lock_init(const struct lu_env *env, struct osc_lock *clk; int result; - OBD_SLAB_ALLOC_PTR(clk, osc_lock_kmem); + OBD_SLAB_ALLOC_PTR_GFP(clk, osc_lock_kmem, CFS_ALLOC_IO); if (clk != NULL) { osc_lock_build_einfo(env, lock, clk, &clk->ols_einfo); clk->ols_state = OLS_NEW; diff --git a/lustre/osc/osc_object.c b/lustre/osc/osc_object.c index 1f099b8..775b888 100644 --- a/lustre/osc/osc_object.c +++ b/lustre/osc/osc_object.c @@ -229,7 +229,7 @@ struct lu_object *osc_object_alloc(const struct lu_env *env, struct osc_object *osc; struct lu_object *obj; - OBD_SLAB_ALLOC_PTR(osc, osc_object_kmem); + OBD_SLAB_ALLOC_PTR_GFP(osc, osc_object_kmem, CFS_ALLOC_IO); if (osc != NULL) { obj = osc2lu(osc); lu_object_init(obj, NULL, dev); diff --git a/lustre/osc/osc_page.c b/lustre/osc/osc_page.c index e72e6d2..5745278 100644 --- a/lustre/osc/osc_page.c +++ b/lustre/osc/osc_page.c @@ -470,7 +470,7 @@ struct cl_page *osc_page_init(const struct lu_env *env, struct osc_page *opg; int result; - OBD_SLAB_ALLOC_PTR(opg, osc_page_kmem); + OBD_SLAB_ALLOC_PTR_GFP(opg, osc_page_kmem, CFS_ALLOC_IO); if (opg != NULL) { void *oap = &opg->ops_oap; diff --git a/lustre/quota/quota_context.c b/lustre/quota/quota_context.c index 162f0af..56ec970 100644 --- a/lustre/quota/quota_context.c +++ b/lustre/quota/quota_context.c @@ -423,7 +423,7 @@ static struct lustre_qunit *alloc_qunit(struct lustre_quota_ctxt *qctxt, struct lustre_qunit *qunit = NULL; ENTRY; - OBD_SLAB_ALLOC(qunit, qunit_cachep, CFS_ALLOC_IO, sizeof(*qunit)); + OBD_SLAB_ALLOC_PTR_GFP(qunit, qunit_cachep, CFS_ALLOC_IO); if (qunit == NULL) RETURN(NULL); diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index 62b7127..77c5186 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -141,7 +141,7 @@ static struct lustre_dquot *alloc_dquot(struct lustre_quota_info *lqi, struct lustre_dquot *dquot = NULL; ENTRY; - OBD_SLAB_ALLOC(dquot, lustre_dquot_cachep, CFS_ALLOC_IO, sizeof(*dquot)); + OBD_SLAB_ALLOC_PTR_GFP(dquot, lustre_dquot_cachep, CFS_ALLOC_IO); if (dquot == NULL) RETURN(NULL);