]> git.itanic.dy.fi Git - scan-pagemap/blobdiff - pagemap.h
Remove duplicate pageframe initialization code
[scan-pagemap] / pagemap.h
index c2f712d6bd5167ae4030a07d10d959b126b752a9..3754063af8fd864424091c043a61bf68bb8fd089 100644 (file)
--- a/pagemap.h
+++ b/pagemap.h
@@ -31,6 +31,12 @@ struct pageframe {
 #define tree_to_pageframe(tree_struct)                         \
        container_of((tree_struct), struct pageframe, tree)
 
+static inline void clear_pageframe(struct pageframe *pf)
+{
+       memset(pf, 0, sizeof(*pf));
+       INIT_LIST_HEAD(&pf->ml);
+}
+
 static inline int page_present(struct pageframe *p)
 {
        return !!(BITRANGE(63, 63) & p->pf);