
From: Hans Reiser <reiser@namesys.com>

Reiser4 distinguishes two types of page dirtiness.

When reiser4 dirties a page within a reiser4 context (during
reiser4_file_write, for instance) page gets tagged PAGECACHE_TAG_DIRTY. 
Besides that reiser4 puts it into a transaction, so that transaction manager
knows how to deal with that page.

When page is dirtied via address space's set_page_dirty operation (page was
dirtied via mmap) transaction manager is unaware of existence of those dirty
pages.  At some moment reiser4 has to put them under transaction manager
control.  To do that we need a way to find all those pages.  So, we tag then
with newly added tag: PAGECACHE_TAG_FS_SPECIFIC.

We assumed here that number of radix tree tags is allowed to extent.  Adding
new tag increased struct radix_tree_node from 276 to 284 bytes.  Number of
struct radix_tree_nodes which pack into one 4k page did not change and is 14. 
For 8k page that number decreased from 29 to 28.

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/include/linux/fs.h |    3 ++-
 25-akpm/lib/radix-tree.c   |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff -puN include/linux/fs.h~reiser4-radix-tree-tag include/linux/fs.h
--- 25/include/linux/fs.h~reiser4-radix-tree-tag	2004-11-30 01:24:03.170163784 -0800
+++ 25-akpm/include/linux/fs.h	2004-11-30 01:24:03.178162568 -0800
@@ -391,10 +391,11 @@ struct block_device {
 
 /*
  * Radix-tree tags, for tagging dirty and writeback pages within the pagecache
- * radix trees
+ * radix trees. One tag is for using for specific filesystem needs
  */
 #define PAGECACHE_TAG_DIRTY	0
 #define PAGECACHE_TAG_WRITEBACK	1
+#define PAGECACHE_TAG_FS_SPECIFIC	2
 
 int mapping_tagged(struct address_space *mapping, int tag);
 
diff -puN lib/radix-tree.c~reiser4-radix-tree-tag lib/radix-tree.c
--- 25/lib/radix-tree.c~reiser4-radix-tree-tag	2004-11-30 01:24:03.172163480 -0800
+++ 25-akpm/lib/radix-tree.c	2004-11-30 01:24:03.179162416 -0800
@@ -36,7 +36,7 @@
 #else
 #define RADIX_TREE_MAP_SHIFT	3	/* For more stressful testing */
 #endif
-#define RADIX_TREE_TAGS		2
+#define RADIX_TREE_TAGS		3
 
 #define RADIX_TREE_MAP_SIZE	(1UL << RADIX_TREE_MAP_SHIFT)
 #define RADIX_TREE_MAP_MASK	(RADIX_TREE_MAP_SIZE-1)
_
