]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/radix-tree.h
Merge tag 'v2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
[mv-sheeva.git] / include / linux / radix-tree.h
index ab2baa5c488453cba50bf564d6220038d0224867..23241c2feccee7b542ac1e984c91b13a02be0541 100644 (file)
@@ -145,6 +145,22 @@ static inline void *radix_tree_deref_slot(void **pslot)
        return rcu_dereference(*pslot);
 }
 
+/**
+ * radix_tree_deref_slot_protected     - dereference a slot without RCU lock but with tree lock held
+ * @pslot:     pointer to slot, returned by radix_tree_lookup_slot
+ * Returns:    item that was stored in that slot with any direct pointer flag
+ *             removed.
+ *
+ * Similar to radix_tree_deref_slot but only used during migration when a pages
+ * mapping is being moved. The caller does not hold the RCU read lock but it
+ * must hold the tree lock to prevent parallel updates.
+ */
+static inline void *radix_tree_deref_slot_protected(void **pslot,
+                                                       spinlock_t *treelock)
+{
+       return rcu_dereference_protected(*pslot, lockdep_is_held(treelock));
+}
+
 /**
  * radix_tree_deref_retry      - check radix_tree_deref_slot
  * @arg:       pointer returned by radix_tree_deref_slot