{
struct mmu_rb_handler *handlr;
- if (!ops->invalidate)
- return -EINVAL;
-
handlr = kmalloc(sizeof(*handlr), GFP_KERNEL);
if (!handlr)
return -ENOMEM;
while ((node = rb_first(root))) {
rbnode = rb_entry(node, struct mmu_rb_node, node);
rb_erase(node, root);
- if (handler->ops->remove)
- handler->ops->remove(root, rbnode, NULL);
+ handler->ops->remove(root, rbnode, NULL);
}
}
spin_unlock_irqrestore(&handler->lock, flags);
}
__mmu_int_rb_insert(mnode, root);
- if (handler->ops->insert) {
- ret = handler->ops->insert(root, mnode);
- if (ret)
- __mmu_int_rb_remove(mnode, root);
- }
+ ret = handler->ops->insert(root, mnode);
+ if (ret)
+ __mmu_int_rb_remove(mnode, root);
unlock:
spin_unlock_irqrestore(&handler->lock, flags);
return ret;
__mmu_int_rb_remove(node, handler->root);
spin_unlock_irqrestore(&handler->lock, flags);
- if (handler->ops->remove)
- handler->ops->remove(handler->root, node, mm);
+ handler->ops->remove(handler->root, node, mm);
}
struct mmu_rb_node *hfi1_mmu_rb_extract(struct rb_root *root,
node->addr, node->len);
if (handler->ops->invalidate(root, node)) {
__mmu_int_rb_remove(node, root);
- if (handler->ops->remove)
- handler->ops->remove(root, node, mm);
+ handler->ops->remove(root, node, mm);
}
}
spin_unlock_irqrestore(&handler->lock, flags);