]> git.itanic.dy.fi Git - scan-pagemap/commitdiff
parser: Increment refcount for each pageframe
authorTimo Kokkonen <kaapeli@itanic.dy.fi>
Sat, 3 Jul 2010 14:59:24 +0000 (17:59 +0300)
committerTimo Kokkonen <kaapeli@itanic.dy.fi>
Sat, 3 Jul 2010 14:59:24 +0000 (17:59 +0300)
A lot of pageframes are shared, so the refcount needs to be counted

Signed-off-by: Timo Kokkonen <kaapeli@itanic.dy.fi>
pagemap.h
parse.c

index b38a1e4278803f125d3ddbef234365ffae794165..a46e5d1ba31969c71e65626f978d06563a179eab 100644 (file)
--- a/pagemap.h
+++ b/pagemap.h
@@ -19,6 +19,7 @@ struct pageframe {
        int page_shift;
        int page_swapped;
        int page_present;
+       int refcount;
 };
 
 #define tree_to_pageframe(tree_struct)                         \
diff --git a/parse.c b/parse.c
index 2cef4ea58a44d1a4e09a448f0dd58e82640950f8..bdbc46f115d518640a0f24d16cf4389eceab80ea 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -155,6 +155,7 @@ static int parse_pageframe(FILE *file, struct pageframe **pageframe_tree,
                        if (*pageframe_tree == NULL)
                                *pageframe_tree = match;
 
+                       match->refcount++;
                        /*
                         * Add a link from the physical page to this
                         * process's page map