Whamcloud - gitweb
LU-160 Reduce OST size requirement for test 155
[fs/lustre-release.git] / lustre / lov / lov_io.c
index 20d3319..2d61ee1 100644 (file)
@@ -26,7 +26,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  */
 /*
  *  @{
  */
 
-static void lov_sub_enter(struct lov_io_sub *sub)
+static inline void lov_sub_enter(struct lov_io_sub *sub)
 {
-        ENTRY;
-        if (sub->sub_reenter++ == 0) {
-                sub->sub_cookie = cl_env_reenter();
-                cl_env_implant(sub->sub_env, &sub->sub_refcheck2);
-        }
-        EXIT;
+        sub->sub_reenter++;
 }
-
-static void lov_sub_exit(struct lov_io_sub *sub)
+static inline void lov_sub_exit(struct lov_io_sub *sub)
 {
-        ENTRY;
-        if (--sub->sub_reenter == 0) {
-                cl_env_unplant(sub->sub_env, &sub->sub_refcheck2);
-                cl_env_reexit(sub->sub_cookie);
-        }
-        EXIT;
+        sub->sub_reenter--;
 }
 
 static void lov_io_sub_fini(const struct lu_env *env, struct lov_io *lio,
@@ -290,8 +279,8 @@ static int lov_io_subio_init(const struct lu_env *env, struct lov_io *lio,
          * Need to be optimized, we can't afford to allocate a piece of memory
          * when writing a page. -jay
          */
-        OBD_ALLOC(lio->lis_subs,
-                  lsm->lsm_stripe_count * sizeof lio->lis_subs[0]);
+        OBD_ALLOC_LARGE(lio->lis_subs,
+                        lsm->lsm_stripe_count * sizeof lio->lis_subs[0]);
         if (lio->lis_subs != NULL) {
                 lio->lis_nr_subios = lio->lis_stripe_count;
                 lio->lis_single_subio_index = -1;
@@ -363,7 +352,7 @@ static void lov_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
         if (lio->lis_subs != NULL) {
                 for (i = 0; i < lio->lis_nr_subios; i++)
                         lov_io_sub_fini(env, lio, &lio->lis_subs[i]);
-                OBD_FREE(lio->lis_subs,
+                OBD_FREE_LARGE(lio->lis_subs,
                          lio->lis_nr_subios * sizeof lio->lis_subs[0]);
                 lio->lis_nr_subios = 0;
         }
@@ -403,7 +392,7 @@ static int lov_io_iter_init(const struct lu_env *env,
                                            start, end);
                         rc = cl_io_iter_init(sub->sub_env, sub->sub_io);
                         lov_sub_put(sub);
-                        CDEBUG(D_VFSTRACE, "shrink: %i ["LPU64", "LPU64")\n",
+                        CDEBUG(D_VFSTRACE, "shrink: %d ["LPU64", "LPU64")\n",
                                stripe, start, end);
                 } else
                         rc = PTR_ERR(sub);
@@ -606,8 +595,8 @@ static int lov_io_submit(const struct lu_env *env,
 
         LASSERT(lio->lis_subs != NULL);
         if (alloc) {
-                OBD_ALLOC(stripes_qin,
-                          sizeof(*stripes_qin) * lio->lis_nr_subios);
+                OBD_ALLOC_LARGE(stripes_qin,
+                                sizeof(*stripes_qin) * lio->lis_nr_subios);
                 if (stripes_qin == NULL)
                         RETURN(-ENOMEM);
 
@@ -660,7 +649,7 @@ static int lov_io_submit(const struct lu_env *env,
         }
 
         if (alloc) {
-                OBD_FREE(stripes_qin,
+                OBD_FREE_LARGE(stripes_qin,
                          sizeof(*stripes_qin) * lio->lis_nr_subios);
         } else {
                 int i;