rbnode = rb_entry(node, struct mmu_rb_node, node);
rb_erase(node, root);
if (handler->ops->remove)
- handler->ops->remove(root, rbnode);
+ handler->ops->remove(root, rbnode, false);
}
}
}
static void __mmu_rb_remove(struct mmu_rb_handler *handler,
- struct mmu_rb_node *node)
+ struct mmu_rb_node *node, bool arg)
{
/* Validity of handler and node pointers has been checked by caller. */
rb_erase(&node->node, handler->root);
if (handler->ops->remove)
- handler->ops->remove(handler->root, node);
+ handler->ops->remove(handler->root, node, arg);
}
struct mmu_rb_node *hfi1_mmu_rb_search(struct rb_root *root, unsigned long addr,
return;
spin_lock_irqsave(&handler->lock, flags);
- __mmu_rb_remove(handler, node);
+ __mmu_rb_remove(handler, node, false);
spin_unlock_irqrestore(&handler->lock, flags);
}
naddr = node->addr;
nlen = node->len;
if (handler->ops->invalidate(root, node))
- __mmu_rb_remove(handler, node);
+ __mmu_rb_remove(handler, node, true);
/*
* The next address to be looked up is computed based
int (*compare)(struct mmu_rb_node *, unsigned long,
unsigned long);
int (*insert)(struct rb_root *, struct mmu_rb_node *);
- void (*remove)(struct rb_root *, struct mmu_rb_node *);
+ void (*remove)(struct rb_root *, struct mmu_rb_node *, bool);
int (*invalidate)(struct rb_root *, struct mmu_rb_node *);
};
static inline int mmu_addr_cmp(struct mmu_rb_node *, unsigned long,
unsigned long);
static int mmu_rb_insert(struct rb_root *, struct mmu_rb_node *);
-static void mmu_rb_remove(struct rb_root *, struct mmu_rb_node *);
+static void mmu_rb_remove(struct rb_root *, struct mmu_rb_node *, bool);
static int mmu_rb_invalidate(struct rb_root *, struct mmu_rb_node *);
static int program_rcvarray(struct file *, unsigned long, struct tid_group *,
struct tid_pageset *, unsigned, u16, struct page **,
if (!node || node->rcventry != (uctxt->expected_base + rcventry))
return -EBADF;
if (HFI1_CAP_IS_USET(TID_UNMAP))
- mmu_rb_remove(&fd->tid_rb_root, &node->mmu);
+ mmu_rb_remove(&fd->tid_rb_root, &node->mmu, false);
else
hfi1_mmu_rb_remove(&fd->tid_rb_root, &node->mmu);
continue;
if (HFI1_CAP_IS_USET(TID_UNMAP))
mmu_rb_remove(&fd->tid_rb_root,
- &node->mmu);
+ &node->mmu, false);
else
hfi1_mmu_rb_remove(&fd->tid_rb_root,
&node->mmu);
return 0;
}
-static void mmu_rb_remove(struct rb_root *root, struct mmu_rb_node *node)
+static void mmu_rb_remove(struct rb_root *root, struct mmu_rb_node *node,
+ bool notifier)
{
struct hfi1_filedata *fdata =
container_of(root, struct hfi1_filedata, tid_rb_root);