Whamcloud - gitweb
OBD_SLAB_ALLOC_PTR_SAFE() is a new OBD_ macro for slab allocation that uses CFS_ALLOC...
authornikita <nikita>
Tue, 17 Feb 2009 18:55:53 +0000 (18:55 +0000)
committernikita <nikita>
Tue, 17 Feb 2009 18:55:53 +0000 (18:55 +0000)
mask (i.e., without CFS_ALLOC_FS), thus preventing file system re-entrance.

b=18499
i=alexander.zarochentsev@sun.com
i=adilger@sun.com

34 files changed:
lustre/include/obd_support.h
lustre/lclient/lcommon_cl.c
lustre/ldlm/ldlm_extent.c
lustre/ldlm/ldlm_lock.c
lustre/ldlm/ldlm_resource.c
lustre/llite/file.c
lustre/llite/remote_perm.c
lustre/llite/super25.c
lustre/llite/vvp_dev.c
lustre/llite/vvp_page.c
lustre/lmv/lmv_object.c
lustre/lov/lov_dev.c
lustre/lov/lov_ea.c
lustre/lov/lov_lock.c
lustre/lov/lov_object.c
lustre/lov/lov_page.c
lustre/lov/lovsub_dev.c
lustre/lov/lovsub_lock.c
lustre/lov/lovsub_object.c
lustre/lov/lovsub_page.c
lustre/lvfs/fsfilt_ext3.c
lustre/obdclass/cl_lock.c
lustre/obdclass/cl_object.c
lustre/obdclass/cl_page.c
lustre/obdclass/genops.c
lustre/obdecho/echo_client.c
lustre/obdfilter/filter.c
lustre/osc/osc_dev.c
lustre/osc/osc_io.c
lustre/osc/osc_lock.c
lustre/osc/osc_object.c
lustre/osc/osc_page.c
lustre/quota/quota_context.c
lustre/quota/quota_master.c

index 64a6294..ff1b2d5 100644 (file)
@@ -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))
         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)
 
 #define KEY_IS(str) \
         (keylen >= (sizeof(str)-1) && memcmp(key, str, (sizeof(str)-1)) == 0)
index c06573a..2b96562 100644 (file)
@@ -144,7 +144,7 @@ void *ccc_key_init(const struct lu_context *ctx,
 {
         struct ccc_thread_info *info;
 
 {
         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;
         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;
 
 {
         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;
         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;
 
         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;
         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;
 
         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;
 
         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));
 
 
         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;
         if (clk != NULL) {
                 cl_lock_slice_add(lock, &clk->clk_cl, obj, lkops);
                 result = 0;
index 0858207..03172d6 100644 (file)
@@ -801,7 +801,7 @@ struct ldlm_interval *ldlm_interval_alloc(struct ldlm_lock *lock)
         ENTRY;
 
         LASSERT(lock->l_resource->lr_type == LDLM_EXTENT);
         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);
 
         if (node == NULL)
                 RETURN(NULL);
 
index b3b36a8..06314db 100644 (file)
@@ -339,7 +339,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
         if (resource == NULL)
                 LBUG();
 
         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);
 
         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)
          * 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) {
 
         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 */
 
         /* 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);
 
         if (node == NULL)  /* Actually, this causes EDEADLOCK to be returned */
                 RETURN(NULL);
 
index c04d948..1a1c67e 100644 (file)
@@ -774,7 +774,7 @@ static struct ldlm_resource *ldlm_resource_new(void)
         struct ldlm_resource *res;
         int idx;
 
         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;
 
         if (res == NULL)
                 return NULL;
 
index cfa7f03..e9d3c87 100644 (file)
@@ -55,7 +55,7 @@ struct ll_file_data *ll_file_data_get(void)
 {
         struct ll_file_data *fd;
 
 {
         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;
 }
 
         return fd;
 }
 
index 420d0fa..08c4bc1 100644 (file)
@@ -63,7 +63,7 @@ static inline struct ll_remote_perm *alloc_ll_remote_perm(void)
 {
         struct ll_remote_perm *lrp;
 
 {
         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;
         if (lrp)
                 INIT_HLIST_NODE(&lrp->lrp_list);
         return lrp;
index b61e7fc..b860101 100644 (file)
@@ -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);
 {
         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;
 
         if (lli == NULL)
                 return NULL;
 
index 8347789..3940252 100644 (file)
@@ -89,7 +89,7 @@ static void *vvp_key_init(const struct lu_context *ctx,
 {
         struct vvp_thread_info *info;
 
 {
         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;
         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;
 
 {
         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;
         if (session == NULL)
                 session = ERR_PTR(-ENOMEM);
         return session;
index b698f52..14e7fdb 100644 (file)
@@ -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));
 
 
         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);
         if (cpg != NULL) {
                 cpg->cpg_page = vmpage;
                 page_cache_get(vmpage);
index f10c23c..b96f9f9 100644 (file)
@@ -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);
 
                 || 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;
 
         if (!obj)
                 return NULL;
 
index 32dfe3a..cab0e3b 100644 (file)
@@ -155,7 +155,7 @@ static void *lov_key_init(const struct lu_context *ctx,
 {
         struct lov_thread_info *info;
 
 {
         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
         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;
 
 {
         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;
         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;
         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;
         if (lr != NULL) {
                 cl_req_slice_add(req, &lr->lr_cl, dev, &lov_req_ops);
                 result = 0;
index 564246a..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++) {
                 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;
                 if (loi == NULL)
                         goto err;
                 lsm->lsm_oinfo[i] = loi;
index 2917d78..9c741f8 100644 (file)
@@ -144,7 +144,7 @@ static struct cl_lock *lov_sublock_alloc(const struct lu_env *env,
         LASSERT(idx < lck->lls_nr);
         ENTRY;
 
         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;
         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;
                         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++;
                         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;
         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);
         if (lck != NULL) {
                 cl_lock_slice_add(lock, &lck->lls_cl, obj, &lov_lock_ops);
                 result = lov_lock_sub_init(env, lck, io);
index d5781b4..2ecd756 100644 (file)
@@ -680,7 +680,7 @@ struct lu_object *lov_object_alloc(const struct lu_env *env,
         struct lu_object  *obj;
 
         ENTRY;
         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);
         if (lov != NULL) {
                 obj = lov2lu(lov);
                 lu_object_init(obj, NULL, dev);
index 3efbc41..f50d345 100644 (file)
@@ -142,7 +142,7 @@ struct cl_page *lov_page_init_raid0(const struct lu_env *env,
         int result;
 
         ENTRY;
         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;
         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;
 
         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,
         if (lpg != NULL) {
                 void *addr;
                 cl_page_slice_add(page, &lpg->lps_cl,
index 359def4..f3ba099 100644 (file)
@@ -148,7 +148,7 @@ static int lovsub_req_init(const struct lu_env *env, struct cl_device *dev,
         struct lovsub_req *lsr;
         int result;
 
         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;
         if (lsr != NULL) {
                 cl_req_slice_add(req, &lsr->lsrq_cl, dev, &lovsub_req_ops);
                 result = 0;
index f02a2ce..d1f2757 100644 (file)
@@ -417,7 +417,7 @@ int lovsub_lock_init(const struct lu_env *env, struct cl_object *obj,
         int result;
 
         ENTRY;
         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);
         if (lsk != NULL) {
                 CFS_INIT_LIST_HEAD(&lsk->lss_parents);
                 cl_lock_slice_add(lock, &lsk->lss_cl, obj, &lovsub_lock_ops);
index a2c4f06..39f4edd 100644 (file)
@@ -141,7 +141,7 @@ struct lu_object *lovsub_object_alloc(const struct lu_env *env,
         struct lu_object     *obj;
 
         ENTRY;
         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;
 
         if (los != NULL) {
                 struct cl_object_header *hdr;
 
index 70e1f56..59bd749 100644 (file)
@@ -71,7 +71,7 @@ struct cl_page *lovsub_page_init(const struct lu_env *env,
         int result;
 
         ENTRY;
         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;
         if (lsb != NULL) {
                 cl_page_slice_add(page, &lsb->lsb_cl, obj, &lovsub_page_ops);
                 result = 0;
index 16b250e..d69e284 100644 (file)
@@ -696,7 +696,7 @@ static int fsfilt_ext3_add_journal_cb(struct obd_device *obd, __u64 last_rcvd,
 {
         struct fsfilt_cb_data *fcb;
 
 {
         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);
 
         if (fcb == NULL)
                 RETURN(-ENOMEM);
 
index 1dae0f8..c3dd3c4 100644 (file)
@@ -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;
         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;
         if (lock != NULL) {
                 atomic_set(&lock->cll_ref, 1);
                 lock->cll_descr = *descr;
index 0310b75..35a7cf5 100644 (file)
@@ -562,7 +562,7 @@ static struct lu_env *cl_env_new(__u32 tags, void *debug)
         struct lu_env *env;
         struct cl_env *cle;
 
         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;
 
         if (cle != NULL) {
                 int rc;
 
index e88427b..d79c6c8 100644 (file)
@@ -320,7 +320,7 @@ static int cl_page_alloc(const struct lu_env *env, struct cl_object *o,
 
         ENTRY;
         result = +1;
 
         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;
         if (page != NULL) {
                 atomic_set(&page->cp_ref, 1);
                 page->cp_obj = o;
index 7341aaa..615b2f9 100644 (file)
@@ -73,7 +73,7 @@ static struct obd_device *obd_device_alloc(void)
 {
         struct obd_device *obd;
 
 {
         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;
         }
         if (obd != NULL) {
                 obd->obd_magic = OBD_DEVICE_MAGIC;
         }
index 16cab35..fa00083 100644 (file)
@@ -384,7 +384,7 @@ static struct cl_page *echo_page_init(const struct lu_env *env,
         struct echo_page *ep;
         ENTRY;
 
         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;
         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;
 
         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);
         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);
 
         /* 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;
 
         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;
 
 {
         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;
         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;
 
 {
         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;
         if (session == NULL)
                 session = ERR_PTR(-ENOMEM);
         return session;
index d6782e2..d1fa9f5 100644 (file)
@@ -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;
 
         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);
 
         spin_lock(&fed->fed_lock);
         found = filter_fmd_find_nolock(&exp->exp_obd->u.filter,fed,objid,group);
index 228b157..068f0d5 100644 (file)
@@ -114,7 +114,7 @@ static void *osc_key_init(const struct lu_context *ctx,
 {
         struct osc_thread_info *info;
 
 {
         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;
         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;
 
 {
         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;
         if (info == NULL)
                 info = ERR_PTR(-ENOMEM);
         return info;
index fd38a1c..0df758c 100644 (file)
@@ -641,7 +641,7 @@ int osc_req_init(const struct lu_env *env, struct cl_device *dev,
         struct osc_req *or;
         int result;
 
         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;
         if (or != NULL) {
                 cl_req_slice_add(req, &or->or_cl, dev, &osc_req_ops);
                 result = 0;
index 7a87e69..ef82a95 100644 (file)
@@ -1637,7 +1637,7 @@ int osc_lock_init(const struct lu_env *env,
         struct osc_lock *clk;
         int result;
 
         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;
         if (clk != NULL) {
                 osc_lock_build_einfo(env, lock, clk, &clk->ols_einfo);
                 clk->ols_state = OLS_NEW;
index 1f099b8..775b888 100644 (file)
@@ -229,7 +229,7 @@ struct lu_object *osc_object_alloc(const struct lu_env *env,
         struct osc_object *osc;
         struct lu_object  *obj;
 
         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);
         if (osc != NULL) {
                 obj = osc2lu(osc);
                 lu_object_init(obj, NULL, dev);
index e72e6d2..5745278 100644 (file)
@@ -470,7 +470,7 @@ struct cl_page *osc_page_init(const struct lu_env *env,
         struct osc_page   *opg;
         int result;
 
         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;
 
         if (opg != NULL) {
                 void *oap = &opg->ops_oap;
 
index 162f0af..56ec970 100644 (file)
@@ -423,7 +423,7 @@ static struct lustre_qunit *alloc_qunit(struct lustre_quota_ctxt *qctxt,
         struct lustre_qunit *qunit = NULL;
         ENTRY;
 
         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);
 
         if (qunit == NULL)
                 RETURN(NULL);
 
index 62b7127..77c5186 100644 (file)
@@ -141,7 +141,7 @@ static struct lustre_dquot *alloc_dquot(struct lustre_quota_info *lqi,
         struct lustre_dquot *dquot = NULL;
         ENTRY;
 
         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);
 
         if (dquot == NULL)
                 RETURN(NULL);