Lines Matching defs:root
97 * Initialise the anon_vma root to point to itself. If called
98 * from fork, the root will be reset to the parents anon_vma.
100 anon_vma->root = anon_vma;
128 if (rwsem_is_locked(&anon_vma->root->rwsem)) {
202 anon_vma->num_children++; /* self-parent link for new root */
233 * This is a useful helper function for locking the anon_vma root as
237 * Such anon_vma's should have the same root, so you'd expect to see
240 static inline struct anon_vma *lock_anon_vma_root(struct anon_vma *root, struct anon_vma *anon_vma)
242 struct anon_vma *new_root = anon_vma->root;
243 if (new_root != root) {
244 if (WARN_ON_ONCE(root))
245 up_write(&root->rwsem);
246 root = new_root;
247 down_write(&root->rwsem);
249 return root;
252 static inline void unlock_anon_vma_root(struct anon_vma *root)
254 if (root)
255 up_write(&root->rwsem);
279 struct anon_vma *root = NULL;
286 unlock_anon_vma_root(root);
287 root = NULL;
293 root = lock_anon_vma_root(root, anon_vma);
310 unlock_anon_vma_root(root);
365 * The root anon_vma's spinlock is the lock actually used when we
368 anon_vma->root = pvma->anon_vma->root;
372 * process it belongs to. The root anon_vma needs to be pinned until
373 * this anon_vma is freed, because the lock lives in the root.
375 get_anon_vma(anon_vma->root);
395 struct anon_vma *root = NULL;
399 * from newest to oldest, ensuring the root anon_vma gets freed last.
404 root = lock_anon_vma_root(root, anon_vma);
428 unlock_anon_vma_root(root);
433 * needing to write-acquire the anon_vma->root->rwsem.
546 root_anon_vma = READ_ONCE(anon_vma->root);
721 vma->anon_vma->root != page__anon_vma->root)
1068 anon_vma = anon_vma->root;
1096 VM_BUG_ON_PAGE(page_anon_vma(page)->root != vma->anon_vma->root, page);
1852 struct anon_vma *root = anon_vma->root;
1855 if (root != anon_vma && atomic_dec_and_test(&root->refcount))
1856 anon_vma_free(root);