Whamcloud - gitweb
LU-6349 ptlrpc: remove old protocol compatibility
[fs/lustre-release.git] / lustre / lov / lov_page.c
index e5b3221..cbfc245 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2013, Intel Corporation.
+ * Copyright (c) 2011, 2014, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
  *
  */
 
-static int lov_page_print(const struct lu_env *env,
-                          const struct cl_page_slice *slice,
-                          void *cookie, lu_printer_t printer)
+static int lov_raid0_page_print(const struct lu_env *env,
+                               const struct cl_page_slice *slice,
+                               void *cookie, lu_printer_t printer)
 {
-        struct lov_page *lp = cl2lov_page(slice);
+       struct lov_page *lp = cl2lov_page(slice);
 
-        return (*printer)(env, cookie, LUSTRE_LOV_NAME"-page@%p\n", lp);
+       return (*printer)(env, cookie, LUSTRE_LOV_NAME"-page@%p, raid0\n", lp);
 }
 
-static const struct cl_page_operations lov_page_ops = {
-       .cpo_print = lov_page_print
+static const struct cl_page_operations lov_raid0_page_ops = {
+       .cpo_print = lov_raid0_page_print
 };
 
 int lov_page_init_raid0(const struct lu_env *env, struct cl_object *obj,
@@ -77,7 +77,7 @@ int lov_page_init_raid0(const struct lu_env *env, struct cl_object *obj,
        struct lov_io_sub *sub;
        struct lov_page   *lpg = cl_object_page_slice(obj, page);
        loff_t             offset;
-       obd_off            suboff;
+       loff_t                   suboff;
        int                stripe;
        int                rc;
        ENTRY;
@@ -89,15 +89,16 @@ int lov_page_init_raid0(const struct lu_env *env, struct cl_object *obj,
                               &suboff);
        LASSERT(rc == 0);
 
-       cl_page_slice_add(page, &lpg->lps_cl, obj, &lov_page_ops);
+       lpg->lps_stripe = stripe;
+       cl_page_slice_add(page, &lpg->lps_cl, obj, index, &lov_raid0_page_ops);
 
        sub = lov_sub_get(env, lio, stripe);
        if (IS_ERR(sub))
                RETURN(PTR_ERR(sub));
 
        subobj = lovsub2cl(r0->lo_sub[stripe]);
-       cfs_list_for_each_entry(o, &subobj->co_lu.lo_header->loh_layers,
-                               co_lu.lo_linkage) {
+       list_for_each_entry(o, &subobj->co_lu.lo_header->loh_layers,
+                           co_lu.lo_linkage) {
                if (o->co_ops->coo_page_init != NULL) {
                        rc = o->co_ops->coo_page_init(sub->sub_env, o, page,
                                                      cl_index(subobj, suboff));
@@ -109,7 +110,7 @@ int lov_page_init_raid0(const struct lu_env *env, struct cl_object *obj,
        RETURN(rc);
 }
 
-static int lov_page_empty_print(const struct lu_env *env,
+static int lov_empty_page_print(const struct lu_env *env,
                                const struct cl_page_slice *slice,
                                void *cookie, lu_printer_t printer)
 {
@@ -119,7 +120,7 @@ static int lov_page_empty_print(const struct lu_env *env,
 }
 
 static const struct cl_page_operations lov_empty_page_ops = {
-       .cpo_print = lov_page_empty_print
+       .cpo_print = lov_empty_page_print
 };
 
 int lov_page_init_empty(const struct lu_env *env, struct cl_object *obj,
@@ -129,7 +130,7 @@ int lov_page_init_empty(const struct lu_env *env, struct cl_object *obj,
        void *addr;
        ENTRY;
 
-       cl_page_slice_add(page, &lpg->lps_cl, obj, &lov_empty_page_ops);
+       cl_page_slice_add(page, &lpg->lps_cl, obj, index, &lov_empty_page_ops);
        addr = kmap(page->cp_vmpage);
        memset(addr, 0, cl_page_size(obj));
        kunmap(page->cp_vmpage);