Whamcloud - gitweb
LU-1715 ptlrpc: flock deadlock detection does not work
[fs/lustre-release.git] / lustre / include / linux / lustre_patchless_compat.h
index 9af47ef..1876f94 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, Whamcloud, Inc.
+ * Copyright (c) 2011, 2012, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
 #include <linux/mm.h>
 #include <linux/hash.h>
 
-#ifndef HAVE_CANCEL_DIRTY_PAGE /* 2.6.20 */
-#define cancel_dirty_page(page, size) clear_page_dirty(page)
-#endif
-
 #ifndef HAVE_DELETE_FROM_PAGE_CACHE /* 2.6.39 */
 #ifndef HAVE_REMOVE_FROM_PAGE_CACHE /* 2.6.35 - 2.6.38 */
 
 /* XXX copy & paste from 2.6.15 kernel */
 static inline void ll_remove_from_page_cache(struct page *page)
 {
-        struct address_space *mapping = page->mapping;
+       struct address_space *mapping = page->mapping;
 
-        BUG_ON(!PageLocked(page));
+       BUG_ON(!PageLocked(page));
 
 #ifdef HAVE_RW_TREE_LOCK
-        write_lock_irq(&mapping->tree_lock);
+       write_lock_irq(&mapping->tree_lock);
 #else
-       cfs_spin_lock_irq(&mapping->tree_lock);
+       spin_lock_irq(&mapping->tree_lock);
 #endif
-        radix_tree_delete(&mapping->page_tree, page->index);
-        page->mapping = NULL;
-        mapping->nrpages--;
-        __dec_zone_page_state(page, NR_FILE_PAGES);
+       radix_tree_delete(&mapping->page_tree, page->index);
+       page->mapping = NULL;
+       mapping->nrpages--;
+       __dec_zone_page_state(page, NR_FILE_PAGES);
 
 #ifdef HAVE_RW_TREE_LOCK
-        write_unlock_irq(&mapping->tree_lock);
+       write_unlock_irq(&mapping->tree_lock);
 #else
-       cfs_spin_unlock_irq(&mapping->tree_lock);
+       spin_unlock_irq(&mapping->tree_lock);
 #endif
 }
 #else /* HAVE_REMOVE_FROM_PAGE_CACHE */