Whamcloud - gitweb
LU-1187 lod: Add remote object for DNE
[fs/lustre-release.git] / lustre / obdclass / cl_io.c
index 6619073..aed5f5e 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, 2012, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -44,9 +44,6 @@
 #include <obd_support.h>
 #include <lustre_fid.h>
 #include <libcfs/list.h>
-/* lu_time_global_{init,fini}() */
-#include <lu_time.h>
-
 #include <cl_object.h>
 #include "cl_internal.h"
 
@@ -112,7 +109,7 @@ void cl_io_fini(const struct lu_env *env, struct cl_io *io)
         ENTRY;
 
         while (!cfs_list_empty(&io->ci_layers)) {
-                slice = container_of(io->ci_layers.next, struct cl_io_slice,
+                slice = container_of(io->ci_layers.prev, struct cl_io_slice,
                                      cis_linkage);
                 cfs_list_del_init(&slice->cis_linkage);
                 if (slice->cis_iop->op[io->ci_type].cio_fini != NULL)
@@ -137,10 +134,11 @@ void cl_io_fini(const struct lu_env *env, struct cl_io *io)
        case CIT_FSYNC:
                LASSERT(!io->ci_need_restart);
                break;
+       case CIT_SETATTR:
        case CIT_MISC:
                /* Check ignore layout change conf */
-               LASSERT(ergo(io->ci_ignore_layout, !io->ci_need_restart));
-       case CIT_SETATTR:
+               LASSERT(ergo(io->ci_ignore_layout || !io->ci_verify_layout,
+                               !io->ci_need_restart));
                break;
        default:
                LBUG();
@@ -1105,9 +1103,9 @@ void cl_page_list_add(struct cl_page_list *plist, struct cl_page *page)
         LASSERT(page->cp_owner != NULL);
         LINVRNT(plist->pl_owner == cfs_current());
 
-        cfs_lockdep_off();
-        cfs_mutex_lock(&page->cp_mutex);
-        cfs_lockdep_on();
+       lockdep_off();
+       mutex_lock(&page->cp_mutex);
+       lockdep_on();
         LASSERT(cfs_list_empty(&page->cp_batch));
         cfs_list_add_tail(&page->cp_batch, &plist->pl_pages);
         ++plist->pl_nr;
@@ -1128,9 +1126,9 @@ void cl_page_list_del(const struct lu_env *env,
 
         ENTRY;
         cfs_list_del_init(&page->cp_batch);
-        cfs_lockdep_off();
-        cfs_mutex_unlock(&page->cp_mutex);
-        cfs_lockdep_on();
+       lockdep_off();
+       mutex_unlock(&page->cp_mutex);
+       lockdep_on();
         --plist->pl_nr;
         lu_ref_del_at(&page->cp_reference, page->cp_queue_ref, "queue", plist);
         cl_page_put(env, page);
@@ -1195,9 +1193,9 @@ void cl_page_list_disown(const struct lu_env *env,
                 LASSERT(plist->pl_nr > 0);
 
                 cfs_list_del_init(&page->cp_batch);
-                cfs_lockdep_off();
-                cfs_mutex_unlock(&page->cp_mutex);
-                cfs_lockdep_on();
+               lockdep_off();
+               mutex_unlock(&page->cp_mutex);
+               lockdep_on();
                 --plist->pl_nr;
                 /*
                  * cl_page_disown0 rather than usual cl_page_disown() is used,