From c641d99128148bbdb45c93a443b53c24006595b0 Mon Sep 17 00:00:00 2001 From: Arne Fitzenreiter Date: Thu, 5 Jun 2008 21:36:23 +0200 Subject: [PATCH] Changed reiser4 patch to an older version (seems to be working) --- src/patches/reiser4-for-2.6.20.patch | 4486 ++++++++++++-------------- 1 file changed, 1984 insertions(+), 2502 deletions(-) mode change 100644 => 100755 src/patches/reiser4-for-2.6.20.patch diff --git a/src/patches/reiser4-for-2.6.20.patch b/src/patches/reiser4-for-2.6.20.patch old mode 100644 new mode 100755 index 187ea1f692..77d3c8164b --- a/src/patches/reiser4-for-2.6.20.patch +++ b/src/patches/reiser4-for-2.6.20.patch @@ -1,185 +1,26 @@ - Documentation/Changes | 12 + - Documentation/filesystems/reiser4.txt | 75 + - arch/i386/lib/usercopy.c | 2 + - fs/Kconfig | 2 + - fs/Makefile | 1 + - fs/fs-writeback.c | 26 +- - fs/reiser4/Kconfig | 32 + - fs/reiser4/Makefile | 99 + - fs/reiser4/README | 125 + - fs/reiser4/as_ops.c | 339 +++ - fs/reiser4/block_alloc.c | 1137 ++++++++ - fs/reiser4/block_alloc.h | 175 ++ - fs/reiser4/blocknrset.c | 368 +++ - fs/reiser4/carry.c | 1391 +++++++++ - fs/reiser4/carry.h | 442 +++ - fs/reiser4/carry_ops.c | 2131 ++++++++++++++ - fs/reiser4/carry_ops.h | 42 + - fs/reiser4/context.c | 288 ++ - fs/reiser4/context.h | 228 ++ - fs/reiser4/coord.c | 935 ++++++ - fs/reiser4/coord.h | 389 +++ - fs/reiser4/debug.c | 308 ++ - fs/reiser4/debug.h | 350 +++ - fs/reiser4/dformat.h | 70 + - fs/reiser4/dscale.c | 174 ++ - fs/reiser4/dscale.h | 27 + - fs/reiser4/entd.c | 335 +++ - fs/reiser4/entd.h | 90 + - fs/reiser4/eottl.c | 509 ++++ - fs/reiser4/estimate.c | 120 + - fs/reiser4/export_ops.c | 295 ++ - fs/reiser4/flush.c | 3622 ++++++++++++++++++++++++ - fs/reiser4/flush.h | 274 ++ - fs/reiser4/flush_queue.c | 680 +++++ - fs/reiser4/forward.h | 256 ++ - fs/reiser4/fsdata.c | 804 ++++++ - fs/reiser4/fsdata.h | 207 ++ - fs/reiser4/init_super.c | 750 +++++ - fs/reiser4/inode.c | 709 +++++ - fs/reiser4/inode.h | 438 +++ - fs/reiser4/ioctl.h | 41 + - fs/reiser4/jnode.c | 1925 +++++++++++++ - fs/reiser4/jnode.h | 705 +++++ - fs/reiser4/kassign.c | 661 +++++ - fs/reiser4/kassign.h | 110 + - fs/reiser4/key.c | 137 + - fs/reiser4/key.h | 384 +++ - fs/reiser4/ktxnmgrd.c | 215 ++ - fs/reiser4/ktxnmgrd.h | 52 + - fs/reiser4/lock.c | 1232 ++++++++ - fs/reiser4/lock.h | 249 ++ - fs/reiser4/oid.c | 141 + - fs/reiser4/page_cache.c | 736 +++++ - fs/reiser4/page_cache.h | 68 + - fs/reiser4/plugin/Makefile | 26 + - fs/reiser4/plugin/cluster.c | 71 + - fs/reiser4/plugin/cluster.h | 343 +++ - fs/reiser4/plugin/compress/Makefile | 6 + - fs/reiser4/plugin/compress/compress.c | 381 +++ - fs/reiser4/plugin/compress/compress.h | 38 + - fs/reiser4/plugin/compress/compress_mode.c | 162 ++ - fs/reiser4/plugin/compress/lzoconf.h | 216 ++ - fs/reiser4/plugin/compress/minilzo.c | 1967 +++++++++++++ - fs/reiser4/plugin/compress/minilzo.h | 70 + - fs/reiser4/plugin/crypto/cipher.c | 37 + - fs/reiser4/plugin/crypto/cipher.h | 55 + - fs/reiser4/plugin/crypto/digest.c | 58 + - fs/reiser4/plugin/dir/Makefile | 5 + - fs/reiser4/plugin/dir/dir.h | 36 + - fs/reiser4/plugin/dir/hashed_dir.c | 81 + - fs/reiser4/plugin/dir/seekable_dir.c | 46 + - fs/reiser4/plugin/dir_plugin_common.c | 872 ++++++ - fs/reiser4/plugin/disk_format/Makefile | 5 + - fs/reiser4/plugin/disk_format/disk_format.c | 38 + - fs/reiser4/plugin/disk_format/disk_format.h | 27 + - fs/reiser4/plugin/disk_format/disk_format40.c | 655 +++++ - fs/reiser4/plugin/disk_format/disk_format40.h | 109 + - fs/reiser4/plugin/fibration.c | 175 ++ - fs/reiser4/plugin/fibration.h | 37 + - fs/reiser4/plugin/file/Makefile | 7 + - fs/reiser4/plugin/file/cryptcompress.c | 3760 +++++++++++++++++++++++++ - fs/reiser4/plugin/file/cryptcompress.h | 554 ++++ - fs/reiser4/plugin/file/file.c | 2820 ++++++++++++++++++ - fs/reiser4/plugin/file/file.h | 272 ++ - fs/reiser4/plugin/file/file_conversion.c | 594 ++++ - fs/reiser4/plugin/file/invert.c | 493 ++++ - fs/reiser4/plugin/file/symfile.c | 87 + - fs/reiser4/plugin/file/symlink.c | 95 + - fs/reiser4/plugin/file/tail_conversion.c | 726 +++++ - fs/reiser4/plugin/file_ops.c | 168 ++ - fs/reiser4/plugin/file_ops_readdir.c | 657 +++++ - fs/reiser4/plugin/file_plugin_common.c | 1007 +++++++ - fs/reiser4/plugin/hash.c | 353 +++ - fs/reiser4/plugin/inode_ops.c | 897 ++++++ - fs/reiser4/plugin/inode_ops_rename.c | 914 ++++++ - fs/reiser4/plugin/item/Makefile | 18 + - fs/reiser4/plugin/item/acl.h | 66 + - fs/reiser4/plugin/item/blackbox.c | 142 + - fs/reiser4/plugin/item/blackbox.h | 33 + - fs/reiser4/plugin/item/cde.c | 1008 +++++++ - fs/reiser4/plugin/item/cde.h | 87 + - fs/reiser4/plugin/item/ctail.c | 1570 +++++++++++ - fs/reiser4/plugin/item/ctail.h | 97 + - fs/reiser4/plugin/item/extent.c | 197 ++ - fs/reiser4/plugin/item/extent.h | 231 ++ - fs/reiser4/plugin/item/extent_file_ops.c | 1435 ++++++++++ - fs/reiser4/plugin/item/extent_flush_ops.c | 1028 +++++++ - fs/reiser4/plugin/item/extent_item_ops.c | 889 ++++++ - fs/reiser4/plugin/item/internal.c | 396 +++ - fs/reiser4/plugin/item/internal.h | 57 + - fs/reiser4/plugin/item/item.c | 719 +++++ - fs/reiser4/plugin/item/item.h | 400 +++ - fs/reiser4/plugin/item/sde.c | 190 ++ - fs/reiser4/plugin/item/sde.h | 66 + - fs/reiser4/plugin/item/static_stat.c | 1106 ++++++++ - fs/reiser4/plugin/item/static_stat.h | 224 ++ - fs/reiser4/plugin/item/tail.c | 812 ++++++ - fs/reiser4/plugin/item/tail.h | 58 + - fs/reiser4/plugin/node/Makefile | 5 + - fs/reiser4/plugin/node/node.c | 131 + - fs/reiser4/plugin/node/node.h | 272 ++ - fs/reiser4/plugin/node/node40.c | 2924 +++++++++++++++++++ - fs/reiser4/plugin/node/node40.h | 125 + - fs/reiser4/plugin/object.c | 516 ++++ - fs/reiser4/plugin/object.h | 121 + - fs/reiser4/plugin/plugin.c | 578 ++++ - fs/reiser4/plugin/plugin.h | 920 ++++++ - fs/reiser4/plugin/plugin_header.h | 144 + - fs/reiser4/plugin/plugin_set.c | 379 +++ - fs/reiser4/plugin/plugin_set.h | 77 + - fs/reiser4/plugin/security/Makefile | 4 + - fs/reiser4/plugin/security/perm.c | 44 + - fs/reiser4/plugin/security/perm.h | 82 + - fs/reiser4/plugin/space/Makefile | 4 + - fs/reiser4/plugin/space/bitmap.c | 1585 +++++++++++ - fs/reiser4/plugin/space/bitmap.h | 47 + - fs/reiser4/plugin/space/space_allocator.h | 80 + - fs/reiser4/plugin/tail_policy.c | 113 + - fs/reiser4/pool.c | 234 ++ - fs/reiser4/pool.h | 55 + - fs/reiser4/readahead.c | 138 + - fs/reiser4/readahead.h | 48 + - fs/reiser4/reiser4.h | 269 ++ - fs/reiser4/safe_link.c | 351 +++ - fs/reiser4/safe_link.h | 29 + - fs/reiser4/seal.c | 218 ++ - fs/reiser4/seal.h | 49 + - fs/reiser4/search.c | 1611 +++++++++++ - fs/reiser4/status_flags.c | 175 ++ - fs/reiser4/status_flags.h | 43 + - fs/reiser4/super.c | 316 +++ - fs/reiser4/super.h | 464 +++ - fs/reiser4/super_ops.c | 730 +++++ - fs/reiser4/tap.c | 377 +++ - fs/reiser4/tap.h | 70 + - fs/reiser4/tree.c | 1876 ++++++++++++ - fs/reiser4/tree.h | 577 ++++ - fs/reiser4/tree_mod.c | 386 +++ - fs/reiser4/tree_mod.h | 29 + - fs/reiser4/tree_walk.c | 927 ++++++ - fs/reiser4/tree_walk.h | 125 + - fs/reiser4/txnmgr.c | 3164 +++++++++++++++++++++ - fs/reiser4/txnmgr.h | 708 +++++ - fs/reiser4/type_safe_hash.h | 320 +++ - fs/reiser4/vfs_ops.c | 259 ++ - fs/reiser4/vfs_ops.h | 53 + - fs/reiser4/wander.c | 1797 ++++++++++++ - fs/reiser4/wander.h | 135 + - fs/reiser4/writeout.h | 21 + - fs/reiser4/znode.c | 1029 +++++++ - fs/reiser4/znode.h | 434 +++ - include/linux/fs.h | 3 + - lib/radix-tree.c | 1 + - mm/filemap.c | 5 + - mm/readahead.c | 1 + - 175 files changed, 79830 insertions(+), 10 deletions(-) - -diff --git a/Documentation/Changes b/Documentation/Changes -index 73a8617..49ee889 100644 ---- a/Documentation/Changes -+++ b/Documentation/Changes -@@ -36,6 +36,7 @@ o module-init-tools 0.9.10 # depmod -V +diff -urN linux-2.6.20.orig/arch/i386/lib/usercopy.c linux-2.6.20/arch/i386/lib/usercopy.c +--- linux-2.6.20.orig/arch/i386/lib/usercopy.c 2006-11-30 00:57:37.000000000 +0300 ++++ linux-2.6.20/arch/i386/lib/usercopy.c 2007-05-06 14:50:43.658963226 +0400 +@@ -812,6 +812,7 @@ + #endif + return n; + } ++EXPORT_SYMBOL(__copy_from_user_ll_nocache); + + unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *from, + unsigned long n) +@@ -827,6 +828,7 @@ + #endif + return n; + } ++EXPORT_SYMBOL(__copy_from_user_ll_nocache_nozero); + + /** + * copy_to_user: - Copy a block of data into user space. +diff -urN linux-2.6.20.orig/Documentation/Changes linux-2.6.20/Documentation/Changes +--- linux-2.6.20.orig/Documentation/Changes 2007-05-06 15:04:34.226399593 +0400 ++++ linux-2.6.20/Documentation/Changes 2007-05-06 14:50:43.658963226 +0400 +@@ -36,6 +36,7 @@ o e2fsprogs 1.29 # tune2fs o jfsutils 1.1.3 # fsck.jfs -V o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs @@ -187,7 +28,7 @@ index 73a8617..49ee889 100644 o xfsprogs 2.6.0 # xfs_db -V o pcmciautils 004 # pccardctl -V o quota-tools 3.09 # quota -V -@@ -144,6 +145,13 @@ The reiserfsprogs package should be used for reiserfs-3.6.x +@@ -144,6 +145,13 @@ versions of mkreiserfs, resize_reiserfs, debugreiserfs and reiserfsck. These utils work on both i386 and alpha platforms. @@ -201,7 +42,7 @@ index 73a8617..49ee889 100644 Xfsprogs -------- -@@ -322,6 +330,10 @@ Reiserfsprogs +@@ -322,6 +330,10 @@ ------------- o @@ -212,11 +53,9 @@ index 73a8617..49ee889 100644 Xfsprogs -------- o -diff --git a/Documentation/filesystems/reiser4.txt b/Documentation/filesystems/reiser4.txt -new file mode 100644 -index 0000000..8e07c9e ---- /dev/null -+++ b/Documentation/filesystems/reiser4.txt +diff -urN linux-2.6.20.orig/Documentation/filesystems/reiser4.txt linux-2.6.20/Documentation/filesystems/reiser4.txt +--- linux-2.6.20.orig/Documentation/filesystems/reiser4.txt 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/Documentation/filesystems/reiser4.txt 2007-05-06 14:50:43.658963226 +0400 @@ -0,0 +1,75 @@ +Reiser4 filesystem +================== @@ -293,56 +132,10 @@ index 0000000..8e07c9e +dont_load_bitmap + Don't load all bitmap blocks at mount time, it is useful for + machines with tiny RAM and large disks. -diff --git a/arch/i386/lib/usercopy.c b/arch/i386/lib/usercopy.c -index d22cfc9..bb4a75a 100644 ---- a/arch/i386/lib/usercopy.c -+++ b/arch/i386/lib/usercopy.c -@@ -812,6 +812,7 @@ unsigned long __copy_from_user_ll_nocache(void *to, const void __user *from, - #endif - return n; - } -+EXPORT_SYMBOL(__copy_from_user_ll_nocache); - - unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *from, - unsigned long n) -@@ -827,6 +828,7 @@ unsigned long __copy_from_user_ll_nocache_nozero(void *to, const void __user *fr - #endif - return n; - } -+EXPORT_SYMBOL(__copy_from_user_ll_nocache_nozero); - - /** - * copy_to_user: - Copy a block of data into user space. -diff --git a/fs/Kconfig b/fs/Kconfig -index 8cd2417..5a97039 100644 ---- a/fs/Kconfig -+++ b/fs/Kconfig -@@ -272,6 +272,8 @@ config FS_MBCACHE - default y if EXT2_FS=y || EXT3_FS=y || EXT4DEV_FS=y - default m if EXT2_FS=m || EXT3_FS=m || EXT4DEV_FS=m - -+source "fs/reiser4/Kconfig" -+ - config REISERFS_FS - tristate "Reiserfs support" - help -diff --git a/fs/Makefile b/fs/Makefile -index b9ffa63..b4c08ce 100644 ---- a/fs/Makefile -+++ b/fs/Makefile -@@ -62,6 +62,7 @@ obj-$(CONFIG_DLM) += dlm/ - - # Do not add any filesystems before this line - obj-$(CONFIG_REISERFS_FS) += reiserfs/ -+obj-$(CONFIG_REISER4_FS) += reiser4/ - obj-$(CONFIG_EXT3_FS) += ext3/ # Before ext2 so root fs can be ext3 - obj-$(CONFIG_EXT4DEV_FS) += ext4/ # Before ext2 so root fs can be ext4dev - obj-$(CONFIG_JBD) += jbd/ -diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c -index a4b142a..cdcff8c 100644 ---- a/fs/fs-writeback.c -+++ b/fs/fs-writeback.c -@@ -296,8 +296,6 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) +diff -urN linux-2.6.20.orig/fs/fs-writeback.c linux-2.6.20/fs/fs-writeback.c +--- linux-2.6.20.orig/fs/fs-writeback.c 2007-05-06 15:04:39.848155607 +0400 ++++ linux-2.6.20/fs/fs-writeback.c 2007-05-06 14:50:43.662964476 +0400 +@@ -296,8 +296,6 @@ * WB_SYNC_HOLD is a hack for sys_sync(): reattach the inode to sb->s_dirty so * that it can be located for waiting on in __writeback_single_inode(). * @@ -351,7 +144,7 @@ index a4b142a..cdcff8c 100644 * If `bdi' is non-zero then we're being asked to writeback a specific queue. * This function assumes that the blockdev superblock's inodes are backed by * a variety of queues, so all inodes are searched. For other superblocks, -@@ -313,11 +311,13 @@ __writeback_single_inode(struct inode *inode, struct writeback_control *wbc) +@@ -313,11 +311,13 @@ * on the writer throttling path, and we get decent balancing between many * throttled threads: we don't want them all piling up on __wait_on_inode. */ @@ -367,7 +160,7 @@ index a4b142a..cdcff8c 100644 if (!wbc->for_kupdate || list_empty(&sb->s_io)) list_splice_init(&sb->s_dirty, &sb->s_io); -@@ -397,8 +397,19 @@ sync_sb_inodes(struct super_block *sb, struct writeback_control *wbc) +@@ -397,8 +397,19 @@ if (wbc->nr_to_write <= 0) break; } @@ -387,7 +180,7 @@ index a4b142a..cdcff8c 100644 /* * Start writeback of dirty pagecache data against all unlocked inodes. -@@ -439,11 +450,8 @@ restart: +@@ -439,11 +450,8 @@ * be unmounted by the time it is released. */ if (down_read_trylock(&sb->s_umount)) { @@ -400,7 +193,7 @@ index a4b142a..cdcff8c 100644 up_read(&sb->s_umount); } spin_lock(&sb_lock); -@@ -481,9 +489,7 @@ void sync_inodes_sb(struct super_block *sb, int wait) +@@ -481,9 +489,7 @@ (inodes_stat.nr_inodes - inodes_stat.nr_unused) + nr_dirty + nr_unstable; wbc.nr_to_write += wbc.nr_to_write / 2; /* Bit more for luck */ @@ -410,286 +203,33 @@ index a4b142a..cdcff8c 100644 } /* -diff --git a/fs/reiser4/Kconfig b/fs/reiser4/Kconfig -new file mode 100644 -index 0000000..f6e5195 ---- /dev/null -+++ b/fs/reiser4/Kconfig -@@ -0,0 +1,32 @@ -+config REISER4_FS -+ tristate "Reiser4 (EXPERIMENTAL)" -+ depends on EXPERIMENTAL -+ select ZLIB_INFLATE -+ select ZLIB_DEFLATE -+ select CRYPTO -+ help -+ Reiser4 is a filesystem that performs all filesystem operations -+ as atomic transactions, which means that it either performs a -+ write, or it does not, and in the event of a crash it does not -+ partially perform it or corrupt it. -+ -+ It stores files in dancing trees, which are like balanced trees but -+ faster. It packs small files together so that they share blocks -+ without wasting space. This means you can use it to store really -+ small files. It also means that it saves you disk space. It avoids -+ hassling you with anachronisms like having a maximum number of -+ inodes, and wasting space if you use less than that number. -+ -+ Reiser4 is a distinct filesystem type from reiserfs (V3). -+ It's therefore not possible to use reiserfs file systems -+ with reiser4. -+ -+ To learn more about reiser4, go to http://www.namesys.com -+ -+config REISER4_DEBUG -+ bool "Enable reiser4 debug mode" -+ depends on REISER4_FS -+ help -+ Don't use this unless you are debugging reiser4. -+ -+ If unsure, say N. -diff --git a/fs/reiser4/Makefile b/fs/reiser4/Makefile -new file mode 100644 -index 0000000..e78441e ---- /dev/null -+++ b/fs/reiser4/Makefile -@@ -0,0 +1,99 @@ -+# -+# reiser4/Makefile -+# -+ -+obj-$(CONFIG_REISER4_FS) += reiser4.o -+ -+reiser4-y := \ -+ debug.o \ -+ jnode.o \ -+ znode.o \ -+ key.o \ -+ pool.o \ -+ tree_mod.o \ -+ estimate.o \ -+ carry.o \ -+ carry_ops.o \ -+ lock.o \ -+ tree.o \ -+ context.o \ -+ tap.o \ -+ coord.o \ -+ block_alloc.o \ -+ txnmgr.o \ -+ kassign.o \ -+ flush.o \ -+ wander.o \ -+ eottl.o \ -+ search.o \ -+ page_cache.o \ -+ seal.o \ -+ dscale.o \ -+ flush_queue.o \ -+ ktxnmgrd.o \ -+ blocknrset.o \ -+ super.o \ -+ super_ops.o \ -+ fsdata.o \ -+ export_ops.o \ -+ oid.o \ -+ tree_walk.o \ -+ inode.o \ -+ vfs_ops.o \ -+ as_ops.o \ -+ entd.o\ -+ readahead.o \ -+ status_flags.o \ -+ init_super.o \ -+ safe_link.o \ -+ \ -+ plugin/plugin.o \ -+ plugin/plugin_set.o \ -+ plugin/node/node.o \ -+ plugin/object.o \ -+ plugin/cluster.o \ -+ plugin/inode_ops.o \ -+ plugin/inode_ops_rename.o \ -+ plugin/file_ops.o \ -+ plugin/file_ops_readdir.o \ -+ plugin/file_plugin_common.o \ -+ plugin/file/file.o \ -+ plugin/file/tail_conversion.o \ -+ plugin/file/file_conversion.o \ -+ plugin/file/symlink.o \ -+ plugin/file/cryptcompress.o \ -+ plugin/dir_plugin_common.o \ -+ plugin/dir/hashed_dir.o \ -+ plugin/dir/seekable_dir.o \ -+ plugin/node/node40.o \ -+ \ -+ plugin/crypto/cipher.o \ -+ plugin/crypto/digest.o \ -+ \ -+ plugin/compress/minilzo.o \ -+ plugin/compress/compress.o \ -+ plugin/compress/compress_mode.o \ -+ \ -+ plugin/item/static_stat.o \ -+ plugin/item/sde.o \ -+ plugin/item/cde.o \ -+ plugin/item/blackbox.o \ -+ plugin/item/internal.o \ -+ plugin/item/tail.o \ -+ plugin/item/ctail.o \ -+ plugin/item/extent.o \ -+ plugin/item/extent_item_ops.o \ -+ plugin/item/extent_file_ops.o \ -+ plugin/item/extent_flush_ops.o \ -+ \ -+ plugin/hash.o \ -+ plugin/fibration.o \ -+ plugin/tail_policy.o \ -+ plugin/item/item.o \ -+ \ -+ plugin/security/perm.o \ -+ plugin/space/bitmap.o \ -+ \ -+ plugin/disk_format/disk_format40.o \ -+ plugin/disk_format/disk_format.o -+ -diff --git a/fs/reiser4/README b/fs/reiser4/README -new file mode 100644 -index 0000000..4637f59 ---- /dev/null -+++ b/fs/reiser4/README -@@ -0,0 +1,125 @@ -+[LICENSING] -+ -+Reiser4 is hereby licensed under the GNU General -+Public License version 2. -+ -+Source code files that contain the phrase "licensing governed by -+reiser4/README" are "governed files" throughout this file. Governed -+files are licensed under the GPL. The portions of them owned by Hans -+Reiser, or authorized to be licensed by him, have been in the past, -+and likely will be in the future, licensed to other parties under -+other licenses. If you add your code to governed files, and don't -+want it to be owned by Hans Reiser, put your copyright label on that -+code so the poor blight and his customers can keep things straight. -+All portions of governed files not labeled otherwise are owned by Hans -+Reiser, and by adding your code to it, widely distributing it to -+others or sending us a patch, and leaving the sentence in stating that -+licensing is governed by the statement in this file, you accept this. -+It will be a kindness if you identify whether Hans Reiser is allowed -+to license code labeled as owned by you on your behalf other than -+under the GPL, because he wants to know if it is okay to do so and put -+a check in the mail to you (for non-trivial improvements) when he -+makes his next sale. He makes no guarantees as to the amount if any, -+though he feels motivated to motivate contributors, and you can surely -+discuss this with him before or after contributing. You have the -+right to decline to allow him to license your code contribution other -+than under the GPL. -+ -+Further licensing options are available for commercial and/or other -+interests directly from Hans Reiser: reiser@namesys.com. If you interpret -+the GPL as not allowing those additional licensing options, you read -+it wrongly, and Richard Stallman agrees with me, when carefully read -+you can see that those restrictions on additional terms do not apply -+to the owner of the copyright, and my interpretation of this shall -+govern for this license. -+ -+[END LICENSING] -+ -+Reiser4 is a file system based on dancing tree algorithms, and is -+described at http://www.namesys.com -+ -+mkfs.reiser4 and other utilities are on our webpage or wherever your -+Linux provider put them. You really want to be running the latest -+version off the website if you use fsck. -+ -+Yes, if you update your reiser4 kernel module you do have to -+recompile your kernel, most of the time. The errors you get will be -+quite cryptic if your forget to do so. -+ -+Hideous Commercial Pitch: Spread your development costs across other OS -+vendors. Select from the best in the world, not the best in your -+building, by buying from third party OS component suppliers. Leverage -+the software component development power of the internet. Be the most -+aggressive in taking advantage of the commercial possibilities of -+decentralized internet development, and add value through your branded -+integration that you sell as an operating system. Let your competitors -+be the ones to compete against the entire internet by themselves. Be -+hip, get with the new economic trend, before your competitors do. Send -+email to reiser@namesys.com -+ -+Hans Reiser was the primary architect of Reiser4, but a whole team -+chipped their ideas in. He invested everything he had into Namesys -+for 5.5 dark years of no money before Reiser3 finally started to work well -+enough to bring in money. He owns the copyright. -+ -+DARPA was the primary sponsor of Reiser4. DARPA does not endorse -+Reiser4, it merely sponsors it. DARPA is, in solely Hans's personal -+opinion, unique in its willingness to invest into things more -+theoretical than the VC community can readily understand, and more -+longterm than allows them to be sure that they will be the ones to -+extract the economic benefits from. DARPA also integrated us into a -+security community that transformed our security worldview. -+ -+Vladimir Saveliev is our lead programmer, with us from the beginning, -+and he worked long hours writing the cleanest code. This is why he is -+now the lead programmer after years of commitment to our work. He -+always made the effort to be the best he could be, and to make his -+code the best that it could be. What resulted was quite remarkable. I -+don't think that money can ever motivate someone to work the way he -+did, he is one of the most selfless men I know. -+ -+Alexander Lyamin was our sysadmin, and helped to educate us in -+security issues. Moscow State University and IMT were very generous -+in the internet access they provided us, and in lots of other little -+ways that a generous institution can be. -+ -+Alexander Zarochentcev (sometimes known as zam, or sasha), wrote the -+locking code, the block allocator, and finished the flushing code. -+His code is always crystal clean and well structured. -+ -+Nikita Danilov wrote the core of the balancing code, the core of the -+plugins code, and the directory code. He worked a steady pace of long -+hours that produced a whole lot of well abstracted code. He is our -+senior computer scientist. -+ -+Vladimir Demidov wrote the parser. Writing an in kernel parser is -+something very few persons have the skills for, and it is thanks to -+him that we can say that the parser is really not so big compared to -+various bits of our other code, and making a parser work in the kernel -+was not so complicated as everyone would imagine mainly because it was -+him doing it... -+ -+Joshua McDonald wrote the transaction manager, and the flush code. -+The flush code unexpectedly turned out be extremely hairy for reasons -+you can read about on our web page, and he did a great job on an -+extremely difficult task. -+ -+Nina Reiser handled our accounting, government relations, and much -+more. -+ -+Ramon Reiser developed our website. -+ -+Beverly Palmer drew our graphics. -+ -+Vitaly Fertman developed librepair, userspace plugins repair code, fsck -+and worked with Umka on developing libreiser4 and userspace plugins. -+ -+Yury Umanets (aka Umka) developed libreiser4, userspace plugins and -+userspace tools (reiser4progs). -+ -+Oleg Drokin (aka Green) is the release manager who fixes everything. -+It is so nice to have someone like that on the team. He (plus Chris -+and Jeff) make it possible for the entire rest of the Namesys team to -+focus on Reiser4, and he fixed a whole lot of Reiser4 bugs also. It -+is just amazing to watch his talent for spotting bugs in action. +diff -urN linux-2.6.20.orig/fs/Kconfig linux-2.6.20/fs/Kconfig +--- linux-2.6.20.orig/fs/Kconfig 2007-05-06 15:04:39.668099364 +0400 ++++ linux-2.6.20/fs/Kconfig 2007-05-06 14:50:43.662964476 +0400 +@@ -272,6 +272,8 @@ + default y if EXT2_FS=y || EXT3_FS=y || EXT4DEV_FS=y + default m if EXT2_FS=m || EXT3_FS=m || EXT4DEV_FS=m + ++source "fs/reiser4/Kconfig" + -diff --git a/fs/reiser4/as_ops.c b/fs/reiser4/as_ops.c -new file mode 100644 -index 0000000..b4f3375 ---- /dev/null -+++ b/fs/reiser4/as_ops.c -@@ -0,0 +1,339 @@ + config REISERFS_FS + tristate "Reiserfs support" + help +diff -urN linux-2.6.20.orig/fs/Makefile linux-2.6.20/fs/Makefile +--- linux-2.6.20.orig/fs/Makefile 2007-05-06 15:04:39.668099364 +0400 ++++ linux-2.6.20/fs/Makefile 2007-05-06 14:50:43.666965726 +0400 +@@ -62,6 +62,7 @@ + + # Do not add any filesystems before this line + obj-$(CONFIG_REISERFS_FS) += reiserfs/ ++obj-$(CONFIG_REISER4_FS) += reiser4/ + obj-$(CONFIG_EXT3_FS) += ext3/ # Before ext2 so root fs can be ext3 + obj-$(CONFIG_EXT4DEV_FS) += ext4/ # Before ext2 so root fs can be ext4dev + obj-$(CONFIG_JBD) += jbd/ +diff -urN linux-2.6.20.orig/fs/reiser4/as_ops.c linux-2.6.20/fs/reiser4/as_ops.c +--- linux-2.6.20.orig/fs/reiser4/as_ops.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/as_ops.c 2007-05-06 14:50:43.666965726 +0400 +@@ -0,0 +1,337 @@ +/* Copyright 2003 by Hans Reiser, licensing governed by reiser4/README */ + +/* Interface to VFS. Reiser4 address_space_operations are defined here. */ @@ -776,7 +316,7 @@ index 0000000..b4f3375 + assert("vs-1652", page->mapping == mapping); + if (mapping_cap_account_dirty(mapping)) + inc_zone_page_state(page, -+ NR_FILE_DIRTY); ++ NR_FILE_DIRTY); + radix_tree_tag_set(&mapping->page_tree, + page->index, + PAGECACHE_TAG_REISER4_MOVED); @@ -976,8 +516,6 @@ index 0000000..b4f3375 + /* NOTE-NIKITA: this can be called in the context of reiser4 call. It + is not clear what to do in this case. A lot of deadlocks seems be + possible. */ -+ if (page_count(page) > 3) -+ return 0; + + node = jnode_by_page(page); + assert("nikita-2258", node != NULL); @@ -1029,11 +567,9 @@ index 0000000..b4f3375 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/block_alloc.c b/fs/reiser4/block_alloc.c -new file mode 100644 -index 0000000..c405c5f ---- /dev/null -+++ b/fs/reiser4/block_alloc.c +diff -urN linux-2.6.20.orig/fs/reiser4/block_alloc.c linux-2.6.20/fs/reiser4/block_alloc.c +--- linux-2.6.20.orig/fs/reiser4/block_alloc.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/block_alloc.c 2007-05-06 14:50:43.682970725 +0400 @@ -0,0 +1,1137 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -2172,11 +1708,9 @@ index 0000000..c405c5f + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/block_alloc.h b/fs/reiser4/block_alloc.h -new file mode 100644 -index 0000000..f4b79f8 ---- /dev/null -+++ b/fs/reiser4/block_alloc.h +diff -urN linux-2.6.20.orig/fs/reiser4/block_alloc.h linux-2.6.20/fs/reiser4/block_alloc.h +--- linux-2.6.20.orig/fs/reiser4/block_alloc.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/block_alloc.h 2007-05-06 14:50:43.682970725 +0400 @@ -0,0 +1,175 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -2353,11 +1887,9 @@ index 0000000..f4b79f8 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/blocknrset.c b/fs/reiser4/blocknrset.c -new file mode 100644 -index 0000000..da50a5a ---- /dev/null -+++ b/fs/reiser4/blocknrset.c +diff -urN linux-2.6.20.orig/fs/reiser4/blocknrset.c linux-2.6.20/fs/reiser4/blocknrset.c +--- linux-2.6.20.orig/fs/reiser4/blocknrset.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/blocknrset.c 2007-05-06 14:50:43.686971975 +0400 @@ -0,0 +1,368 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -2727,11 +2259,9 @@ index 0000000..da50a5a + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/carry.c b/fs/reiser4/carry.c -new file mode 100644 -index 0000000..c90a0f0 ---- /dev/null -+++ b/fs/reiser4/carry.c +diff -urN linux-2.6.20.orig/fs/reiser4/carry.c linux-2.6.20/fs/reiser4/carry.c +--- linux-2.6.20.orig/fs/reiser4/carry.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/carry.c 2007-05-06 14:50:43.686971975 +0400 @@ -0,0 +1,1391 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ +/* Functions to "carry" tree modification(s) upward. */ @@ -4124,11 +3654,9 @@ index 0000000..c90a0f0 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/carry.h b/fs/reiser4/carry.h -new file mode 100644 -index 0000000..6341d73 ---- /dev/null -+++ b/fs/reiser4/carry.h +diff -urN linux-2.6.20.orig/fs/reiser4/carry.h linux-2.6.20/fs/reiser4/carry.h +--- linux-2.6.20.orig/fs/reiser4/carry.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/carry.h 2007-05-06 14:50:43.690973225 +0400 @@ -0,0 +1,442 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -4572,11 +4100,9 @@ index 0000000..6341d73 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/carry_ops.c b/fs/reiser4/carry_ops.c -new file mode 100644 -index 0000000..8ce8e95 ---- /dev/null -+++ b/fs/reiser4/carry_ops.c +diff -urN linux-2.6.20.orig/fs/reiser4/carry_ops.c linux-2.6.20/fs/reiser4/carry_ops.c +--- linux-2.6.20.orig/fs/reiser4/carry_ops.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/carry_ops.c 2007-05-06 14:50:43.694974475 +0400 @@ -0,0 +1,2131 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -6709,11 +6235,9 @@ index 0000000..8ce8e95 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/carry_ops.h b/fs/reiser4/carry_ops.h -new file mode 100644 -index 0000000..688ca8f ---- /dev/null -+++ b/fs/reiser4/carry_ops.h +diff -urN linux-2.6.20.orig/fs/reiser4/carry_ops.h linux-2.6.20/fs/reiser4/carry_ops.h +--- linux-2.6.20.orig/fs/reiser4/carry_ops.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/carry_ops.h 2007-05-06 14:50:43.694974475 +0400 @@ -0,0 +1,42 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -6757,11 +6281,9 @@ index 0000000..688ca8f + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/context.c b/fs/reiser4/context.c -new file mode 100644 -index 0000000..4b3137f ---- /dev/null -+++ b/fs/reiser4/context.c +diff -urN linux-2.6.20.orig/fs/reiser4/context.c linux-2.6.20/fs/reiser4/context.c +--- linux-2.6.20.orig/fs/reiser4/context.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/context.c 2007-05-06 14:50:43.694974475 +0400 @@ -0,0 +1,288 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -7051,11 +6573,9 @@ index 0000000..4b3137f + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/context.h b/fs/reiser4/context.h -new file mode 100644 -index 0000000..da240a9 ---- /dev/null -+++ b/fs/reiser4/context.h +diff -urN linux-2.6.20.orig/fs/reiser4/context.h linux-2.6.20/fs/reiser4/context.h +--- linux-2.6.20.orig/fs/reiser4/context.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/context.h 2007-05-06 14:50:43.698975725 +0400 @@ -0,0 +1,228 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -7285,11 +6805,9 @@ index 0000000..da240a9 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/coord.c b/fs/reiser4/coord.c -new file mode 100644 -index 0000000..d171786 ---- /dev/null -+++ b/fs/reiser4/coord.c +diff -urN linux-2.6.20.orig/fs/reiser4/coord.c linux-2.6.20/fs/reiser4/coord.c +--- linux-2.6.20.orig/fs/reiser4/coord.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/coord.c 2007-05-06 14:50:43.698975725 +0400 @@ -0,0 +1,935 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -8226,11 +7744,9 @@ index 0000000..d171786 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/coord.h b/fs/reiser4/coord.h -new file mode 100644 -index 0000000..313e615 ---- /dev/null -+++ b/fs/reiser4/coord.h +diff -urN linux-2.6.20.orig/fs/reiser4/coord.h linux-2.6.20/fs/reiser4/coord.h +--- linux-2.6.20.orig/fs/reiser4/coord.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/coord.h 2007-05-06 14:50:43.698975725 +0400 @@ -0,0 +1,389 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -8621,11 +8137,9 @@ index 0000000..313e615 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/debug.c b/fs/reiser4/debug.c -new file mode 100644 -index 0000000..3c55fe8 ---- /dev/null -+++ b/fs/reiser4/debug.c +diff -urN linux-2.6.20.orig/fs/reiser4/debug.c linux-2.6.20/fs/reiser4/debug.c +--- linux-2.6.20.orig/fs/reiser4/debug.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/debug.c 2007-05-06 14:50:43.702976975 +0400 @@ -0,0 +1,308 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -8935,11 +8449,9 @@ index 0000000..3c55fe8 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/debug.h b/fs/reiser4/debug.h -new file mode 100644 -index 0000000..68e7f31 ---- /dev/null -+++ b/fs/reiser4/debug.h +diff -urN linux-2.6.20.orig/fs/reiser4/debug.h linux-2.6.20/fs/reiser4/debug.h +--- linux-2.6.20.orig/fs/reiser4/debug.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/debug.h 2007-05-06 14:50:43.702976975 +0400 @@ -0,0 +1,350 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -9291,11 +8803,9 @@ index 0000000..68e7f31 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/dformat.h b/fs/reiser4/dformat.h -new file mode 100644 -index 0000000..8bca29e ---- /dev/null -+++ b/fs/reiser4/dformat.h +diff -urN linux-2.6.20.orig/fs/reiser4/dformat.h linux-2.6.20/fs/reiser4/dformat.h +--- linux-2.6.20.orig/fs/reiser4/dformat.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/dformat.h 2007-05-06 14:50:43.702976975 +0400 @@ -0,0 +1,70 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -9367,11 +8877,9 @@ index 0000000..8bca29e + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/dscale.c b/fs/reiser4/dscale.c -new file mode 100644 -index 0000000..a9bc224 ---- /dev/null -+++ b/fs/reiser4/dscale.c +diff -urN linux-2.6.20.orig/fs/reiser4/dscale.c linux-2.6.20/fs/reiser4/dscale.c +--- linux-2.6.20.orig/fs/reiser4/dscale.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/dscale.c 2007-05-06 14:50:43.702976975 +0400 @@ -0,0 +1,174 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -9547,11 +9055,9 @@ index 0000000..a9bc224 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/dscale.h b/fs/reiser4/dscale.h -new file mode 100644 -index 0000000..545e111 ---- /dev/null -+++ b/fs/reiser4/dscale.h +diff -urN linux-2.6.20.orig/fs/reiser4/dscale.h linux-2.6.20/fs/reiser4/dscale.h +--- linux-2.6.20.orig/fs/reiser4/dscale.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/dscale.h 2007-05-06 14:50:43.702976975 +0400 @@ -0,0 +1,27 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -9580,11 +9086,9 @@ index 0000000..545e111 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/entd.c b/fs/reiser4/entd.c -new file mode 100644 -index 0000000..1be9fff ---- /dev/null -+++ b/fs/reiser4/entd.c +diff -urN linux-2.6.20.orig/fs/reiser4/entd.c linux-2.6.20/fs/reiser4/entd.c +--- linux-2.6.20.orig/fs/reiser4/entd.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/entd.c 2007-05-06 14:50:43.702976975 +0400 @@ -0,0 +1,335 @@ +/* Copyright 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -9828,7 +9332,7 @@ index 0000000..1be9fff + + if (rq->wbc->nr_to_write > 0) { + rq->wbc->range_start = 0; -+ rq->wbc->range_end = 0; ++ rq->wbc->range_end = LLONG_MAX; + generic_sync_sb_inodes(super, rq->wbc); + } + rq->wbc->nr_to_write = ENTD_CAPTURE_APAGE_BURST; @@ -9921,11 +9425,9 @@ index 0000000..1be9fff + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/entd.h b/fs/reiser4/entd.h -new file mode 100644 -index 0000000..4f79a57 ---- /dev/null -+++ b/fs/reiser4/entd.h +diff -urN linux-2.6.20.orig/fs/reiser4/entd.h linux-2.6.20/fs/reiser4/entd.h +--- linux-2.6.20.orig/fs/reiser4/entd.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/entd.h 2007-05-06 14:50:43.706978224 +0400 @@ -0,0 +1,90 @@ +/* Copyright 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -10017,11 +9519,9 @@ index 0000000..4f79a57 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/eottl.c b/fs/reiser4/eottl.c -new file mode 100644 -index 0000000..f921b19 ---- /dev/null -+++ b/fs/reiser4/eottl.c +diff -urN linux-2.6.20.orig/fs/reiser4/eottl.c linux-2.6.20/fs/reiser4/eottl.c +--- linux-2.6.20.orig/fs/reiser4/eottl.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/eottl.c 2007-05-06 14:50:43.706978224 +0400 @@ -0,0 +1,509 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -10532,12 +10032,10 @@ index 0000000..f921b19 + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/estimate.c b/fs/reiser4/estimate.c -new file mode 100644 -index 0000000..656c20b ---- /dev/null -+++ b/fs/reiser4/estimate.c -@@ -0,0 +1,120 @@ +diff -urN linux-2.6.20.orig/fs/reiser4/estimate.c linux-2.6.20/fs/reiser4/estimate.c +--- linux-2.6.20.orig/fs/reiser4/estimate.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/estimate.c 2007-05-06 14:50:43.706978224 +0400 +@@ -0,0 +1,111 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + +#include "debug.h" @@ -10633,16 +10131,7 @@ index 0000000..656c20b + return estimate_cluster(inode, 0); /* 44, for 64K-cluster */ +} + -+/* How many nodes occupied by a disk cluster might get dirty. -+ Note that this estimation is not precise (i.e. disk cluster -+ can occupy more nodes). -+ Q: Why we don't use precise estimation? -+ A: 1.Because precise estimation is fairly bad: 65536 nodes -+ for 64K logical cluster, it means 256M of dead space on -+ a partition -+ 2.It is a very rare case when disk cluster occupies more -+ nodes then this estimation returns. -+*/ ++/* how many nodes occupied by a disk cluster might get dirty */ +reiser4_block_nr estimate_dirty_cluster(struct inode * inode) +{ + return cluster_nrpages(inode) + 4; @@ -10658,11 +10147,9 @@ index 0000000..656c20b + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/export_ops.c b/fs/reiser4/export_ops.c -new file mode 100644 -index 0000000..b75afe7 ---- /dev/null -+++ b/fs/reiser4/export_ops.c +diff -urN linux-2.6.20.orig/fs/reiser4/export_ops.c linux-2.6.20/fs/reiser4/export_ops.c +--- linux-2.6.20.orig/fs/reiser4/export_ops.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/export_ops.c 2007-05-06 14:50:43.706978224 +0400 @@ -0,0 +1,295 @@ +/* Copyright 2005 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -10959,11 +10446,9 @@ index 0000000..b75afe7 + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/flush.c b/fs/reiser4/flush.c -new file mode 100644 -index 0000000..49b6ca5 ---- /dev/null -+++ b/fs/reiser4/flush.c +diff -urN linux-2.6.20.orig/fs/reiser4/flush.c linux-2.6.20/fs/reiser4/flush.c +--- linux-2.6.20.orig/fs/reiser4/flush.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/flush.c 2007-05-06 14:50:43.000000000 +0400 @@ -0,0 +1,3622 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -14587,11 +14072,9 @@ index 0000000..49b6ca5 + LocalWords: preceder + End: +*/ -diff --git a/fs/reiser4/flush.h b/fs/reiser4/flush.h -new file mode 100644 -index 0000000..beab76b ---- /dev/null -+++ b/fs/reiser4/flush.h +diff -urN linux-2.6.20.orig/fs/reiser4/flush.h linux-2.6.20/fs/reiser4/flush.h +--- linux-2.6.20.orig/fs/reiser4/flush.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/flush.h 2007-05-06 14:50:43.718981974 +0400 @@ -0,0 +1,274 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -14867,11 +14350,9 @@ index 0000000..beab76b + LocalWords: preceder + End: +*/ -diff --git a/fs/reiser4/flush_queue.c b/fs/reiser4/flush_queue.c -new file mode 100644 -index 0000000..f6c5d9a ---- /dev/null -+++ b/fs/reiser4/flush_queue.c +diff -urN linux-2.6.20.orig/fs/reiser4/flush_queue.c linux-2.6.20/fs/reiser4/flush_queue.c +--- linux-2.6.20.orig/fs/reiser4/flush_queue.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/flush_queue.c 2007-05-06 14:50:43.718981974 +0400 @@ -0,0 +1,680 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -15553,11 +15034,9 @@ index 0000000..f6c5d9a + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/forward.h b/fs/reiser4/forward.h -new file mode 100644 -index 0000000..8536833 ---- /dev/null -+++ b/fs/reiser4/forward.h +diff -urN linux-2.6.20.orig/fs/reiser4/forward.h linux-2.6.20/fs/reiser4/forward.h +--- linux-2.6.20.orig/fs/reiser4/forward.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/forward.h 2007-05-06 14:50:43.718981974 +0400 @@ -0,0 +1,256 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -15815,19 +15294,16 @@ index 0000000..8536833 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/fsdata.c b/fs/reiser4/fsdata.c -new file mode 100644 -index 0000000..47da01c ---- /dev/null -+++ b/fs/reiser4/fsdata.c -@@ -0,0 +1,804 @@ +diff -urN linux-2.6.20.orig/fs/reiser4/fsdata.c linux-2.6.20/fs/reiser4/fsdata.c +--- linux-2.6.20.orig/fs/reiser4/fsdata.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/fsdata.c 2007-05-06 14:50:43.722983224 +0400 +@@ -0,0 +1,803 @@ +/* Copyright 2001, 2002, 2003, 2004, 2005 by Hans Reiser, licensing governed by + * reiser4/README */ + +#include "fsdata.h" +#include "inode.h" + -+ +/* cache or dir_cursors */ +static struct kmem_cache *d_cursor_cache; +static struct shrinker *d_cursor_shrinker; @@ -16625,11 +16101,9 @@ index 0000000..47da01c + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/fsdata.h b/fs/reiser4/fsdata.h -new file mode 100644 -index 0000000..49e8ebf ---- /dev/null -+++ b/fs/reiser4/fsdata.h +diff -urN linux-2.6.20.orig/fs/reiser4/fsdata.h linux-2.6.20/fs/reiser4/fsdata.h +--- linux-2.6.20.orig/fs/reiser4/fsdata.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/fsdata.h 2007-05-06 14:50:43.722983224 +0400 @@ -0,0 +1,207 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -16838,11 +16312,9 @@ index 0000000..49e8ebf + * fill-column: 120 + * End: + */ -diff --git a/fs/reiser4/init_super.c b/fs/reiser4/init_super.c -new file mode 100644 -index 0000000..3513d5f ---- /dev/null -+++ b/fs/reiser4/init_super.c +diff -urN linux-2.6.20.orig/fs/reiser4/init_super.c linux-2.6.20/fs/reiser4/init_super.c +--- linux-2.6.20.orig/fs/reiser4/init_super.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/init_super.c 2007-05-06 14:50:43.722983224 +0400 @@ -0,0 +1,750 @@ +/* Copyright by Hans Reiser, 2003 */ + @@ -17594,11 +17066,9 @@ index 0000000..3513d5f + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/inode.c b/fs/reiser4/inode.c -new file mode 100644 -index 0000000..2429ac1 ---- /dev/null -+++ b/fs/reiser4/inode.c +diff -urN linux-2.6.20.orig/fs/reiser4/inode.c linux-2.6.20/fs/reiser4/inode.c +--- linux-2.6.20.orig/fs/reiser4/inode.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/inode.c 2007-05-06 14:50:43.726984474 +0400 @@ -0,0 +1,709 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -18309,11 +17779,9 @@ index 0000000..2429ac1 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/inode.h b/fs/reiser4/inode.h -new file mode 100644 -index 0000000..2cc1d82 ---- /dev/null -+++ b/fs/reiser4/inode.h +diff -urN linux-2.6.20.orig/fs/reiser4/inode.h linux-2.6.20/fs/reiser4/inode.h +--- linux-2.6.20.orig/fs/reiser4/inode.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/inode.h 2007-05-06 14:50:43.726984474 +0400 @@ -0,0 +1,438 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -18753,11 +18221,9 @@ index 0000000..2cc1d82 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/ioctl.h b/fs/reiser4/ioctl.h -new file mode 100644 -index 0000000..4d57737 ---- /dev/null -+++ b/fs/reiser4/ioctl.h +diff -urN linux-2.6.20.orig/fs/reiser4/ioctl.h linux-2.6.20/fs/reiser4/ioctl.h +--- linux-2.6.20.orig/fs/reiser4/ioctl.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/ioctl.h 2007-05-06 14:50:43.726984474 +0400 @@ -0,0 +1,41 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -18800,11 +18266,9 @@ index 0000000..4d57737 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/jnode.c b/fs/reiser4/jnode.c -new file mode 100644 -index 0000000..1d16d41 ---- /dev/null -+++ b/fs/reiser4/jnode.c +diff -urN linux-2.6.20.orig/fs/reiser4/jnode.c linux-2.6.20/fs/reiser4/jnode.c +--- linux-2.6.20.orig/fs/reiser4/jnode.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/jnode.c 2007-05-06 14:50:43.730985723 +0400 @@ -0,0 +1,1925 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -19810,10 +19274,10 @@ index 0000000..1d16d41 +{ + assert("nikita-489", atomic_read(&node->d_count) > 0); + atomic_dec(&node->d_count); -+ if (jnode_is_unformatted(node) || jnode_is_znode(node)) -+ LOCK_CNT_DEC(d_refs); + /* release reference acquired in jload_gfp() or jinit_new() */ + jput(node); ++ if (jnode_is_unformatted(node) || jnode_is_znode(node)) ++ LOCK_CNT_DEC(d_refs); +} + +/* drop reference to node data. When last reference is dropped, data are @@ -20731,11 +20195,9 @@ index 0000000..1d16d41 + fill-column: 80 + End: +*/ -diff --git a/fs/reiser4/jnode.h b/fs/reiser4/jnode.h -new file mode 100644 -index 0000000..c05d88e ---- /dev/null -+++ b/fs/reiser4/jnode.h +diff -urN linux-2.6.20.orig/fs/reiser4/jnode.h linux-2.6.20/fs/reiser4/jnode.h +--- linux-2.6.20.orig/fs/reiser4/jnode.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/jnode.h 2007-05-06 14:50:43.734986973 +0400 @@ -0,0 +1,705 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -21442,11 +20904,9 @@ index 0000000..c05d88e + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/kassign.c b/fs/reiser4/kassign.c -new file mode 100644 -index 0000000..3c8f9f5 ---- /dev/null -+++ b/fs/reiser4/kassign.c +diff -urN linux-2.6.20.orig/fs/reiser4/kassign.c linux-2.6.20/fs/reiser4/kassign.c +--- linux-2.6.20.orig/fs/reiser4/kassign.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/kassign.c 2007-05-06 14:50:43.734986973 +0400 @@ -0,0 +1,661 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -22109,11 +21569,9 @@ index 0000000..3c8f9f5 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/kassign.h b/fs/reiser4/kassign.h -new file mode 100644 -index 0000000..ee818d5 ---- /dev/null -+++ b/fs/reiser4/kassign.h +diff -urN linux-2.6.20.orig/fs/reiser4/kassign.h linux-2.6.20/fs/reiser4/kassign.h +--- linux-2.6.20.orig/fs/reiser4/kassign.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/kassign.h 2007-05-06 14:50:43.734986973 +0400 @@ -0,0 +1,110 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -22225,11 +21683,45 @@ index 0000000..ee818d5 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/key.c b/fs/reiser4/key.c -new file mode 100644 -index 0000000..384c318 ---- /dev/null -+++ b/fs/reiser4/key.c +diff -urN linux-2.6.20.orig/fs/reiser4/Kconfig linux-2.6.20/fs/reiser4/Kconfig +--- linux-2.6.20.orig/fs/reiser4/Kconfig 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/Kconfig 2007-05-06 14:50:43.734986973 +0400 +@@ -0,0 +1,32 @@ ++config REISER4_FS ++ tristate "Reiser4 (EXPERIMENTAL)" ++ depends on EXPERIMENTAL ++ select ZLIB_INFLATE ++ select ZLIB_DEFLATE ++ select CRYPTO ++ help ++ Reiser4 is a filesystem that performs all filesystem operations ++ as atomic transactions, which means that it either performs a ++ write, or it does not, and in the event of a crash it does not ++ partially perform it or corrupt it. ++ ++ It stores files in dancing trees, which are like balanced trees but ++ faster. It packs small files together so that they share blocks ++ without wasting space. This means you can use it to store really ++ small files. It also means that it saves you disk space. It avoids ++ hassling you with anachronisms like having a maximum number of ++ inodes, and wasting space if you use less than that number. ++ ++ Reiser4 is a distinct filesystem type from reiserfs (V3). ++ It's therefore not possible to use reiserfs file systems ++ with reiser4. ++ ++ To learn more about reiser4, go to http://www.namesys.com ++ ++config REISER4_DEBUG ++ bool "Enable reiser4 debug mode" ++ depends on REISER4_FS ++ help ++ Don't use this unless you are debugging reiser4. ++ ++ If unsure, say N. +diff -urN linux-2.6.20.orig/fs/reiser4/key.c linux-2.6.20/fs/reiser4/key.c +--- linux-2.6.20.orig/fs/reiser4/key.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/key.c 2007-05-06 14:50:43.734986973 +0400 @@ -0,0 +1,137 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -22368,11 +21860,9 @@ index 0000000..384c318 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/key.h b/fs/reiser4/key.h -new file mode 100644 -index 0000000..3f6b47e ---- /dev/null -+++ b/fs/reiser4/key.h +diff -urN linux-2.6.20.orig/fs/reiser4/key.h linux-2.6.20/fs/reiser4/key.h +--- linux-2.6.20.orig/fs/reiser4/key.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/key.h 2007-05-06 14:50:43.738988223 +0400 @@ -0,0 +1,384 @@ +/* Copyright 2000, 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -22758,11 +22248,9 @@ index 0000000..3f6b47e + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/ktxnmgrd.c b/fs/reiser4/ktxnmgrd.c -new file mode 100644 -index 0000000..15bb6d6 ---- /dev/null -+++ b/fs/reiser4/ktxnmgrd.c +diff -urN linux-2.6.20.orig/fs/reiser4/ktxnmgrd.c linux-2.6.20/fs/reiser4/ktxnmgrd.c +--- linux-2.6.20.orig/fs/reiser4/ktxnmgrd.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/ktxnmgrd.c 2007-05-06 14:50:43.738988223 +0400 @@ -0,0 +1,215 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ +/* Transaction manager daemon. */ @@ -22979,11 +22467,9 @@ index 0000000..15bb6d6 + * fill-column: 120 + * End: + */ -diff --git a/fs/reiser4/ktxnmgrd.h b/fs/reiser4/ktxnmgrd.h -new file mode 100644 -index 0000000..d00f1d9 ---- /dev/null -+++ b/fs/reiser4/ktxnmgrd.h +diff -urN linux-2.6.20.orig/fs/reiser4/ktxnmgrd.h linux-2.6.20/fs/reiser4/ktxnmgrd.h +--- linux-2.6.20.orig/fs/reiser4/ktxnmgrd.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/ktxnmgrd.h 2007-05-06 14:50:43.738988223 +0400 @@ -0,0 +1,52 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -23037,11 +22523,9 @@ index 0000000..d00f1d9 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/lock.c b/fs/reiser4/lock.c -new file mode 100644 -index 0000000..cdca928 ---- /dev/null -+++ b/fs/reiser4/lock.c +diff -urN linux-2.6.20.orig/fs/reiser4/lock.c linux-2.6.20/fs/reiser4/lock.c +--- linux-2.6.20.orig/fs/reiser4/lock.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/lock.c 2007-05-06 14:50:43.742989473 +0400 @@ -0,0 +1,1232 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -24275,11 +23759,9 @@ index 0000000..cdca928 + fill-column: 79 + End: +*/ -diff --git a/fs/reiser4/lock.h b/fs/reiser4/lock.h -new file mode 100644 -index 0000000..e130466 ---- /dev/null -+++ b/fs/reiser4/lock.h +diff -urN linux-2.6.20.orig/fs/reiser4/lock.h linux-2.6.20/fs/reiser4/lock.h +--- linux-2.6.20.orig/fs/reiser4/lock.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/lock.h 2007-05-06 14:50:43.742989473 +0400 @@ -0,0 +1,249 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -24530,11 +24012,112 @@ index 0000000..e130466 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/oid.c b/fs/reiser4/oid.c -new file mode 100644 -index 0000000..f311d06 ---- /dev/null -+++ b/fs/reiser4/oid.c +diff -urN linux-2.6.20.orig/fs/reiser4/Makefile linux-2.6.20/fs/reiser4/Makefile +--- linux-2.6.20.orig/fs/reiser4/Makefile 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/Makefile 2007-05-06 14:50:43.742989473 +0400 +@@ -0,0 +1,99 @@ ++# ++# reiser4/Makefile ++# ++ ++obj-$(CONFIG_REISER4_FS) += reiser4.o ++ ++reiser4-y := \ ++ debug.o \ ++ jnode.o \ ++ znode.o \ ++ key.o \ ++ pool.o \ ++ tree_mod.o \ ++ estimate.o \ ++ carry.o \ ++ carry_ops.o \ ++ lock.o \ ++ tree.o \ ++ context.o \ ++ tap.o \ ++ coord.o \ ++ block_alloc.o \ ++ txnmgr.o \ ++ kassign.o \ ++ flush.o \ ++ wander.o \ ++ eottl.o \ ++ search.o \ ++ page_cache.o \ ++ seal.o \ ++ dscale.o \ ++ flush_queue.o \ ++ ktxnmgrd.o \ ++ blocknrset.o \ ++ super.o \ ++ super_ops.o \ ++ fsdata.o \ ++ export_ops.o \ ++ oid.o \ ++ tree_walk.o \ ++ inode.o \ ++ vfs_ops.o \ ++ as_ops.o \ ++ entd.o\ ++ readahead.o \ ++ status_flags.o \ ++ init_super.o \ ++ safe_link.o \ ++ \ ++ plugin/plugin.o \ ++ plugin/plugin_set.o \ ++ plugin/node/node.o \ ++ plugin/object.o \ ++ plugin/cluster.o \ ++ plugin/inode_ops.o \ ++ plugin/inode_ops_rename.o \ ++ plugin/file_ops.o \ ++ plugin/file_ops_readdir.o \ ++ plugin/file_plugin_common.o \ ++ plugin/file/file.o \ ++ plugin/file/tail_conversion.o \ ++ plugin/file/file_conversion.o \ ++ plugin/file/symlink.o \ ++ plugin/file/cryptcompress.o \ ++ plugin/dir_plugin_common.o \ ++ plugin/dir/hashed_dir.o \ ++ plugin/dir/seekable_dir.o \ ++ plugin/node/node40.o \ ++ \ ++ plugin/crypto/cipher.o \ ++ plugin/crypto/digest.o \ ++ \ ++ plugin/compress/minilzo.o \ ++ plugin/compress/compress.o \ ++ plugin/compress/compress_mode.o \ ++ \ ++ plugin/item/static_stat.o \ ++ plugin/item/sde.o \ ++ plugin/item/cde.o \ ++ plugin/item/blackbox.o \ ++ plugin/item/internal.o \ ++ plugin/item/tail.o \ ++ plugin/item/ctail.o \ ++ plugin/item/extent.o \ ++ plugin/item/extent_item_ops.o \ ++ plugin/item/extent_file_ops.o \ ++ plugin/item/extent_flush_ops.o \ ++ \ ++ plugin/hash.o \ ++ plugin/fibration.o \ ++ plugin/tail_policy.o \ ++ plugin/item/item.o \ ++ \ ++ plugin/security/perm.o \ ++ plugin/space/bitmap.o \ ++ \ ++ plugin/disk_format/disk_format40.o \ ++ plugin/disk_format/disk_format.o ++ +diff -urN linux-2.6.20.orig/fs/reiser4/oid.c linux-2.6.20/fs/reiser4/oid.c +--- linux-2.6.20.orig/fs/reiser4/oid.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/oid.c 2007-05-06 14:50:43.742989473 +0400 @@ -0,0 +1,141 @@ +/* Copyright 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -24677,11 +24260,9 @@ index 0000000..f311d06 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/page_cache.c b/fs/reiser4/page_cache.c -new file mode 100644 -index 0000000..e1f436d ---- /dev/null -+++ b/fs/reiser4/page_cache.c +diff -urN linux-2.6.20.orig/fs/reiser4/page_cache.c linux-2.6.20/fs/reiser4/page_cache.c +--- linux-2.6.20.orig/fs/reiser4/page_cache.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/page_cache.c 2007-05-06 14:50:43.742989473 +0400 @@ -0,0 +1,736 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -25094,7 +24675,7 @@ index 0000000..e1f436d + bio = page_bio(page, node, rw, gfp); + if (!IS_ERR(bio)) { + if (rw == WRITE) { -+ set_page_writeback(page); ++ SetPageWriteback(page); + unlock_page(page); + } + reiser4_submit_bio(rw, bio); @@ -25419,11 +25000,9 @@ index 0000000..e1f436d + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/page_cache.h b/fs/reiser4/page_cache.h -new file mode 100644 -index 0000000..ab74f8f ---- /dev/null -+++ b/fs/reiser4/page_cache.h +diff -urN linux-2.6.20.orig/fs/reiser4/page_cache.h linux-2.6.20/fs/reiser4/page_cache.h +--- linux-2.6.20.orig/fs/reiser4/page_cache.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/page_cache.h 2007-05-06 14:50:43.746990723 +0400 @@ -0,0 +1,68 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -25493,43 +25072,9 @@ index 0000000..ab74f8f + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/Makefile b/fs/reiser4/plugin/Makefile -new file mode 100644 -index 0000000..4b2c9f8 ---- /dev/null -+++ b/fs/reiser4/plugin/Makefile -@@ -0,0 +1,26 @@ -+obj-$(CONFIG_REISER4_FS) += plugins.o -+ -+plugins-objs := \ -+ plugin.o \ -+ plugin_set.o \ -+ object.o \ -+ inode_ops.o \ -+ inode_ops_rename.o \ -+ file_ops.o \ -+ file_ops_readdir.o \ -+ file_plugin_common.o \ -+ dir_plugin_common.o \ -+ digest.o \ -+ hash.o \ -+ fibration.o \ -+ tail_policy.o \ -+ regular.o -+ -+obj-$(CONFIG_REISER4_FS) += item/ -+obj-$(CONFIG_REISER4_FS) += file/ -+obj-$(CONFIG_REISER4_FS) += dir/ -+obj-$(CONFIG_REISER4_FS) += node/ -+obj-$(CONFIG_REISER4_FS) += compress/ -+obj-$(CONFIG_REISER4_FS) += space/ -+obj-$(CONFIG_REISER4_FS) += disk_format/ -+obj-$(CONFIG_REISER4_FS) += security/ -diff --git a/fs/reiser4/plugin/cluster.c b/fs/reiser4/plugin/cluster.c -new file mode 100644 -index 0000000..b400d5f ---- /dev/null -+++ b/fs/reiser4/plugin/cluster.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/cluster.c linux-2.6.20/fs/reiser4/plugin/cluster.c +--- linux-2.6.20.orig/fs/reiser4/plugin/cluster.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/cluster.c 2007-05-06 14:50:43.746990723 +0400 @@ -0,0 +1,71 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -25602,11 +25147,9 @@ index 0000000..b400d5f + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/cluster.h b/fs/reiser4/plugin/cluster.h -new file mode 100644 -index 0000000..019f156 ---- /dev/null -+++ b/fs/reiser4/plugin/cluster.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/cluster.h linux-2.6.20/fs/reiser4/plugin/cluster.h +--- linux-2.6.20.orig/fs/reiser4/plugin/cluster.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/cluster.h 2007-05-06 14:50:43.746990723 +0400 @@ -0,0 +1,343 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -25951,23 +25494,9 @@ index 0000000..019f156 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/compress/Makefile b/fs/reiser4/plugin/compress/Makefile -new file mode 100644 -index 0000000..82793a4 ---- /dev/null -+++ b/fs/reiser4/plugin/compress/Makefile -@@ -0,0 +1,6 @@ -+obj-$(CONFIG_REISER4_FS) += compress_plugins.o -+ -+compress_plugins-objs := \ -+ compress.o \ -+ minilzo.o \ -+ compress_mode.o -diff --git a/fs/reiser4/plugin/compress/compress.c b/fs/reiser4/plugin/compress/compress.c -new file mode 100644 -index 0000000..7e64d0c ---- /dev/null -+++ b/fs/reiser4/plugin/compress/compress.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/compress/compress.c linux-2.6.20/fs/reiser4/plugin/compress/compress.c +--- linux-2.6.20.orig/fs/reiser4/plugin/compress/compress.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/compress/compress.c 2007-05-06 14:50:43.746990723 +0400 @@ -0,0 +1,381 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ +/* reiser4 compression transform plugins */ @@ -26350,11 +25879,9 @@ index 0000000..7e64d0c + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/compress/compress.h b/fs/reiser4/plugin/compress/compress.h -new file mode 100644 -index 0000000..922ca0b ---- /dev/null -+++ b/fs/reiser4/plugin/compress/compress.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/compress/compress.h linux-2.6.20/fs/reiser4/plugin/compress/compress.h +--- linux-2.6.20.orig/fs/reiser4/plugin/compress/compress.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/compress/compress.h 2007-05-06 14:50:43.746990723 +0400 @@ -0,0 +1,38 @@ +#if !defined( __FS_REISER4_COMPRESS_H__ ) +#define __FS_REISER4_COMPRESS_H__ @@ -26394,11 +25921,9 @@ index 0000000..922ca0b + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/compress/compress_mode.c b/fs/reiser4/plugin/compress/compress_mode.c -new file mode 100644 -index 0000000..2ae7856 ---- /dev/null -+++ b/fs/reiser4/plugin/compress/compress_mode.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/compress/compress_mode.c linux-2.6.20/fs/reiser4/plugin/compress/compress_mode.c +--- linux-2.6.20.orig/fs/reiser4/plugin/compress/compress_mode.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/compress/compress_mode.c 2007-05-06 14:50:43.750991972 +0400 @@ -0,0 +1,162 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ +/* This file contains Reiser4 compression mode plugins. @@ -26562,11 +26087,9 @@ index 0000000..2ae7856 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/compress/lzoconf.h b/fs/reiser4/plugin/compress/lzoconf.h -new file mode 100644 -index 0000000..cc0fa4d ---- /dev/null -+++ b/fs/reiser4/plugin/compress/lzoconf.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/compress/lzoconf.h linux-2.6.20/fs/reiser4/plugin/compress/lzoconf.h +--- linux-2.6.20.orig/fs/reiser4/plugin/compress/lzoconf.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/compress/lzoconf.h 2007-05-06 14:50:43.750991972 +0400 @@ -0,0 +1,216 @@ +/* lzoconf.h -- configuration for the LZO real-time data compression library + adopted for reiser4 compression transform plugin. @@ -26784,11 +26307,19 @@ index 0000000..cc0fa4d +#define LZO_ALIGN(_ptr,_size) LZO_PTR_ALIGN_UP(_ptr,_size) + +#endif /* already included */ -diff --git a/fs/reiser4/plugin/compress/minilzo.c b/fs/reiser4/plugin/compress/minilzo.c -new file mode 100644 -index 0000000..2dba187 ---- /dev/null -+++ b/fs/reiser4/plugin/compress/minilzo.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/compress/Makefile linux-2.6.20/fs/reiser4/plugin/compress/Makefile +--- linux-2.6.20.orig/fs/reiser4/plugin/compress/Makefile 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/compress/Makefile 2007-05-06 14:50:43.750991972 +0400 +@@ -0,0 +1,6 @@ ++obj-$(CONFIG_REISER4_FS) += compress_plugins.o ++ ++compress_plugins-objs := \ ++ compress.o \ ++ minilzo.o \ ++ compress_mode.o +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/compress/minilzo.c linux-2.6.20/fs/reiser4/plugin/compress/minilzo.c +--- linux-2.6.20.orig/fs/reiser4/plugin/compress/minilzo.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/compress/minilzo.c 2007-05-06 14:50:43.754993222 +0400 @@ -0,0 +1,1967 @@ +/* minilzo.c -- mini subset of the LZO real-time data compression library + adopted for reiser4 compression transform plugin. @@ -28757,11 +28288,9 @@ index 0000000..2dba187 +#endif + +/***** End of minilzo.c *****/ -diff --git a/fs/reiser4/plugin/compress/minilzo.h b/fs/reiser4/plugin/compress/minilzo.h -new file mode 100644 -index 0000000..6a47001 ---- /dev/null -+++ b/fs/reiser4/plugin/compress/minilzo.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/compress/minilzo.h linux-2.6.20/fs/reiser4/plugin/compress/minilzo.h +--- linux-2.6.20.orig/fs/reiser4/plugin/compress/minilzo.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/compress/minilzo.h 2007-05-06 14:50:43.754993222 +0400 @@ -0,0 +1,70 @@ +/* minilzo.h -- mini subset of the LZO real-time data compression library + adopted for reiser4 compression transform plugin. @@ -28833,11 +28362,9 @@ index 0000000..6a47001 + lzo_voidp wrkmem /* NOT USED */ ); + +#endif /* already included */ -diff --git a/fs/reiser4/plugin/crypto/cipher.c b/fs/reiser4/plugin/crypto/cipher.c -new file mode 100644 -index 0000000..e918154 ---- /dev/null -+++ b/fs/reiser4/plugin/crypto/cipher.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/crypto/cipher.c linux-2.6.20/fs/reiser4/plugin/crypto/cipher.c +--- linux-2.6.20.orig/fs/reiser4/plugin/crypto/cipher.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/crypto/cipher.c 2007-05-06 14:50:43.754993222 +0400 @@ -0,0 +1,37 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, + licensing governed by reiser4/README */ @@ -28876,11 +28403,9 @@ index 0000000..e918154 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/crypto/cipher.h b/fs/reiser4/plugin/crypto/cipher.h -new file mode 100644 -index 0000000..e896c67 ---- /dev/null -+++ b/fs/reiser4/plugin/crypto/cipher.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/crypto/cipher.h linux-2.6.20/fs/reiser4/plugin/crypto/cipher.h +--- linux-2.6.20.orig/fs/reiser4/plugin/crypto/cipher.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/crypto/cipher.h 2007-05-06 14:50:43.754993222 +0400 @@ -0,0 +1,55 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ +/* This file contains definitions for the objects operated @@ -28937,11 +28462,9 @@ index 0000000..e896c67 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/crypto/digest.c b/fs/reiser4/plugin/crypto/digest.c -new file mode 100644 -index 0000000..7508917 ---- /dev/null -+++ b/fs/reiser4/plugin/crypto/digest.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/crypto/digest.c linux-2.6.20/fs/reiser4/plugin/crypto/digest.c +--- linux-2.6.20.orig/fs/reiser4/plugin/crypto/digest.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/crypto/digest.c 2007-05-06 14:50:43.754993222 +0400 @@ -0,0 +1,58 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -29001,22 +28524,9 @@ index 0000000..7508917 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/dir/Makefile b/fs/reiser4/plugin/dir/Makefile -new file mode 100644 -index 0000000..ed370b1 ---- /dev/null -+++ b/fs/reiser4/plugin/dir/Makefile -@@ -0,0 +1,5 @@ -+obj-$(CONFIG_REISER4_FS) += dir_plugins.o -+ -+dir_plugins-objs := \ -+ hashed_dir.o \ -+ seekable_dir.o -diff --git a/fs/reiser4/plugin/dir/dir.h b/fs/reiser4/plugin/dir/dir.h -new file mode 100644 -index 0000000..4a91ebe ---- /dev/null -+++ b/fs/reiser4/plugin/dir/dir.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/dir/dir.h linux-2.6.20/fs/reiser4/plugin/dir/dir.h +--- linux-2.6.20.orig/fs/reiser4/plugin/dir/dir.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/dir/dir.h 2007-05-06 14:50:43.754993222 +0400 @@ -0,0 +1,36 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -29054,11 +28564,9 @@ index 0000000..4a91ebe + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/dir/hashed_dir.c b/fs/reiser4/plugin/dir/hashed_dir.c -new file mode 100644 -index 0000000..0f34824 ---- /dev/null -+++ b/fs/reiser4/plugin/dir/hashed_dir.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/dir/hashed_dir.c linux-2.6.20/fs/reiser4/plugin/dir/hashed_dir.c +--- linux-2.6.20.orig/fs/reiser4/plugin/dir/hashed_dir.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/dir/hashed_dir.c 2007-05-06 14:50:43.754993222 +0400 @@ -0,0 +1,81 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -29141,11 +28649,18 @@ index 0000000..0f34824 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/dir/seekable_dir.c b/fs/reiser4/plugin/dir/seekable_dir.c -new file mode 100644 -index 0000000..c1c6c4c ---- /dev/null -+++ b/fs/reiser4/plugin/dir/seekable_dir.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/dir/Makefile linux-2.6.20/fs/reiser4/plugin/dir/Makefile +--- linux-2.6.20.orig/fs/reiser4/plugin/dir/Makefile 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/dir/Makefile 2007-05-06 14:50:43.758994472 +0400 +@@ -0,0 +1,5 @@ ++obj-$(CONFIG_REISER4_FS) += dir_plugins.o ++ ++dir_plugins-objs := \ ++ hashed_dir.o \ ++ seekable_dir.o +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/dir/seekable_dir.c linux-2.6.20/fs/reiser4/plugin/dir/seekable_dir.c +--- linux-2.6.20.orig/fs/reiser4/plugin/dir/seekable_dir.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/dir/seekable_dir.c 2007-05-06 14:50:43.758994472 +0400 @@ -0,0 +1,46 @@ +/* Copyright 2005 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -29193,11 +28708,9 @@ index 0000000..c1c6c4c + set_key_offset(result, (__u64) 0); + return; +} -diff --git a/fs/reiser4/plugin/dir_plugin_common.c b/fs/reiser4/plugin/dir_plugin_common.c -new file mode 100644 -index 0000000..f5e1028 ---- /dev/null -+++ b/fs/reiser4/plugin/dir_plugin_common.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/dir_plugin_common.c linux-2.6.20/fs/reiser4/plugin/dir_plugin_common.c +--- linux-2.6.20.orig/fs/reiser4/plugin/dir_plugin_common.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/dir_plugin_common.c 2007-05-06 14:50:43.758994472 +0400 @@ -0,0 +1,872 @@ +/* Copyright 2005 by Hans Reiser, licensing governed by + reiser4/README */ @@ -30071,99 +29584,9 @@ index 0000000..f5e1028 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/disk_format/Makefile b/fs/reiser4/plugin/disk_format/Makefile -new file mode 100644 -index 0000000..e4e9e54 ---- /dev/null -+++ b/fs/reiser4/plugin/disk_format/Makefile -@@ -0,0 +1,5 @@ -+obj-$(CONFIG_REISER4_FS) += df_plugins.o -+ -+df_plugins-objs := \ -+ disk_format40.o \ -+ disk_format.o -diff --git a/fs/reiser4/plugin/disk_format/disk_format.c b/fs/reiser4/plugin/disk_format/disk_format.c -new file mode 100644 -index 0000000..d785106 ---- /dev/null -+++ b/fs/reiser4/plugin/disk_format/disk_format.c -@@ -0,0 +1,38 @@ -+/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ -+ -+#include "../../debug.h" -+#include "../plugin_header.h" -+#include "disk_format40.h" -+#include "disk_format.h" -+#include "../plugin.h" -+ -+/* initialization of disk layout plugins */ -+disk_format_plugin format_plugins[LAST_FORMAT_ID] = { -+ [FORMAT40_ID] = { -+ .h = { -+ .type_id = REISER4_FORMAT_PLUGIN_TYPE, -+ .id = FORMAT40_ID, -+ .pops = NULL, -+ .label = "reiser40", -+ .desc = "standard disk layout for reiser40", -+ .linkage = {NULL, NULL} -+ }, -+ .init_format = init_format_format40, -+ .root_dir_key = root_dir_key_format40, -+ .release = release_format40, -+ .log_super = log_super_format40, -+ .check_open = check_open_format40, -+ .version_update = version_update_format40 -+ } -+}; -+ -+/* Make Linus happy. -+ Local variables: -+ c-indentation-style: "K&R" -+ mode-name: "LC" -+ c-basic-offset: 8 -+ tab-width: 8 -+ fill-column: 120 -+ scroll-step: 1 -+ End: -+*/ -diff --git a/fs/reiser4/plugin/disk_format/disk_format.h b/fs/reiser4/plugin/disk_format/disk_format.h -new file mode 100644 -index 0000000..b9c53ac ---- /dev/null -+++ b/fs/reiser4/plugin/disk_format/disk_format.h -@@ -0,0 +1,27 @@ -+/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ -+ -+/* identifiers for disk layouts, they are also used as indexes in array of disk -+ plugins */ -+ -+#if !defined( __REISER4_DISK_FORMAT_H__ ) -+#define __REISER4_DISK_FORMAT_H__ -+ -+typedef enum { -+ /* standard reiser4 disk layout plugin id */ -+ FORMAT40_ID, -+ LAST_FORMAT_ID -+} disk_format_id; -+ -+/* __REISER4_DISK_FORMAT_H__ */ -+#endif -+ -+/* Make Linus happy. -+ Local variables: -+ c-indentation-style: "K&R" -+ mode-name: "LC" -+ c-basic-offset: 8 -+ tab-width: 8 -+ fill-column: 120 -+ scroll-step: 1 -+ End: -+*/ -diff --git a/fs/reiser4/plugin/disk_format/disk_format40.c b/fs/reiser4/plugin/disk_format/disk_format40.c -new file mode 100644 -index 0000000..17718f0 ---- /dev/null -+++ b/fs/reiser4/plugin/disk_format/disk_format40.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/disk_format/disk_format40.c linux-2.6.20/fs/reiser4/plugin/disk_format/disk_format40.c +--- linux-2.6.20.orig/fs/reiser4/plugin/disk_format/disk_format40.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/disk_format/disk_format40.c 2007-05-06 14:50:43.762995722 +0400 @@ -0,0 +1,655 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -30820,11 +30243,9 @@ index 0000000..17718f0 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/disk_format/disk_format40.h b/fs/reiser4/plugin/disk_format/disk_format40.h -new file mode 100644 -index 0000000..7fc1772 ---- /dev/null -+++ b/fs/reiser4/plugin/disk_format/disk_format40.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/disk_format/disk_format40.h linux-2.6.20/fs/reiser4/plugin/disk_format/disk_format40.h +--- linux-2.6.20.orig/fs/reiser4/plugin/disk_format/disk_format40.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/disk_format/disk_format40.h 2007-05-06 14:50:43.762995722 +0400 @@ -0,0 +1,109 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -30935,11 +30356,91 @@ index 0000000..7fc1772 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/fibration.c b/fs/reiser4/plugin/fibration.c -new file mode 100644 -index 0000000..690dac4 ---- /dev/null -+++ b/fs/reiser4/plugin/fibration.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/disk_format/disk_format.c linux-2.6.20/fs/reiser4/plugin/disk_format/disk_format.c +--- linux-2.6.20.orig/fs/reiser4/plugin/disk_format/disk_format.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/disk_format/disk_format.c 2007-05-06 14:50:43.762995722 +0400 +@@ -0,0 +1,38 @@ ++/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ ++ ++#include "../../debug.h" ++#include "../plugin_header.h" ++#include "disk_format40.h" ++#include "disk_format.h" ++#include "../plugin.h" ++ ++/* initialization of disk layout plugins */ ++disk_format_plugin format_plugins[LAST_FORMAT_ID] = { ++ [FORMAT40_ID] = { ++ .h = { ++ .type_id = REISER4_FORMAT_PLUGIN_TYPE, ++ .id = FORMAT40_ID, ++ .pops = NULL, ++ .label = "reiser40", ++ .desc = "standard disk layout for reiser40", ++ .linkage = {NULL, NULL} ++ }, ++ .init_format = init_format_format40, ++ .root_dir_key = root_dir_key_format40, ++ .release = release_format40, ++ .log_super = log_super_format40, ++ .check_open = check_open_format40, ++ .version_update = version_update_format40 ++ } ++}; ++ ++/* Make Linus happy. ++ Local variables: ++ c-indentation-style: "K&R" ++ mode-name: "LC" ++ c-basic-offset: 8 ++ tab-width: 8 ++ fill-column: 120 ++ scroll-step: 1 ++ End: ++*/ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/disk_format/disk_format.h linux-2.6.20/fs/reiser4/plugin/disk_format/disk_format.h +--- linux-2.6.20.orig/fs/reiser4/plugin/disk_format/disk_format.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/disk_format/disk_format.h 2007-05-06 14:50:43.762995722 +0400 +@@ -0,0 +1,27 @@ ++/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ ++ ++/* identifiers for disk layouts, they are also used as indexes in array of disk ++ plugins */ ++ ++#if !defined( __REISER4_DISK_FORMAT_H__ ) ++#define __REISER4_DISK_FORMAT_H__ ++ ++typedef enum { ++ /* standard reiser4 disk layout plugin id */ ++ FORMAT40_ID, ++ LAST_FORMAT_ID ++} disk_format_id; ++ ++/* __REISER4_DISK_FORMAT_H__ */ ++#endif ++ ++/* Make Linus happy. ++ Local variables: ++ c-indentation-style: "K&R" ++ mode-name: "LC" ++ c-basic-offset: 8 ++ tab-width: 8 ++ fill-column: 120 ++ scroll-step: 1 ++ End: ++*/ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/disk_format/Makefile linux-2.6.20/fs/reiser4/plugin/disk_format/Makefile +--- linux-2.6.20.orig/fs/reiser4/plugin/disk_format/Makefile 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/disk_format/Makefile 2007-05-06 14:50:43.762995722 +0400 +@@ -0,0 +1,5 @@ ++obj-$(CONFIG_REISER4_FS) += df_plugins.o ++ ++df_plugins-objs := \ ++ disk_format40.o \ ++ disk_format.o +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/fibration.c linux-2.6.20/fs/reiser4/plugin/fibration.c +--- linux-2.6.20.orig/fs/reiser4/plugin/fibration.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/fibration.c 2007-05-06 14:50:43.762995722 +0400 @@ -0,0 +1,175 @@ +/* Copyright 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -31116,11 +30617,9 @@ index 0000000..690dac4 + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/plugin/fibration.h b/fs/reiser4/plugin/fibration.h -new file mode 100644 -index 0000000..0723cad ---- /dev/null -+++ b/fs/reiser4/plugin/fibration.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/fibration.h linux-2.6.20/fs/reiser4/plugin/fibration.h +--- linux-2.6.20.orig/fs/reiser4/plugin/fibration.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/fibration.h 2007-05-06 14:50:43.762995722 +0400 @@ -0,0 +1,37 @@ +/* Copyright 2004 by Hans Reiser, licensing governed by reiser4/README */ + @@ -31159,24 +30658,9 @@ index 0000000..0723cad + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/file/Makefile b/fs/reiser4/plugin/file/Makefile -new file mode 100644 -index 0000000..134fa7a ---- /dev/null -+++ b/fs/reiser4/plugin/file/Makefile -@@ -0,0 +1,7 @@ -+obj-$(CONFIG_REISER4_FS) += file_plugins.o -+ -+file_plugins-objs := \ -+ file.o \ -+ tail_conversion.o \ -+ symlink.o \ -+ cryptcompress.o -diff --git a/fs/reiser4/plugin/file/cryptcompress.c b/fs/reiser4/plugin/file/cryptcompress.c -new file mode 100644 -index 0000000..2876e31 ---- /dev/null -+++ b/fs/reiser4/plugin/file/cryptcompress.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file/cryptcompress.c linux-2.6.20/fs/reiser4/plugin/file/cryptcompress.c +--- linux-2.6.20.orig/fs/reiser4/plugin/file/cryptcompress.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file/cryptcompress.c 2007-05-06 14:50:43.770998222 +0400 @@ -0,0 +1,3760 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + reiser4/README */ @@ -32994,7 +32478,7 @@ index 0000000..2876e31 + /* page cluster flushed successfully */ + + clear_cluster_pages_dirty(clust); -+ reiser4_release_cluster_pages(clust); ++ reiser4_release_cluster_pages(clust); +#if REISER4_DEBUG + cryptcompress_inode_data(inode)->pgcount -= clust->nr_pages; +#endif @@ -33963,7 +33447,7 @@ index 0000000..2876e31 + if (IS_ERR(ctx)) + return PTR_ERR(ctx); + -+ mutex_lock(&inode->i_mutex); ++ mutex_lock(&inode->i_mutex); + + result = generic_write_checks(file, &pos, &count, 0); + if (unlikely(result != 0)) @@ -34938,11 +34422,9 @@ index 0000000..2876e31 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/file/cryptcompress.h b/fs/reiser4/plugin/file/cryptcompress.h -new file mode 100644 -index 0000000..5f2d7fb ---- /dev/null -+++ b/fs/reiser4/plugin/file/cryptcompress.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file/cryptcompress.h linux-2.6.20/fs/reiser4/plugin/file/cryptcompress.h +--- linux-2.6.20.orig/fs/reiser4/plugin/file/cryptcompress.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file/cryptcompress.h 2007-05-06 14:50:43.774999471 +0400 @@ -0,0 +1,554 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ +/* See http://www.namesys.com/cryptcompress_design.html */ @@ -35498,12 +34980,10 @@ index 0000000..5f2d7fb + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/file/file.c b/fs/reiser4/plugin/file/file.c -new file mode 100644 -index 0000000..67501aa ---- /dev/null -+++ b/fs/reiser4/plugin/file/file.c -@@ -0,0 +1,2820 @@ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file/file.c linux-2.6.20/fs/reiser4/plugin/file/file.c +--- linux-2.6.20.orig/fs/reiser4/plugin/file/file.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file/file.c 2007-05-06 14:50:43.779000721 +0400 +@@ -0,0 +1,2821 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ + @@ -35534,6 +35014,22 @@ index 0000000..67501aa +static int hint_validate(hint_t * hint, const reiser4_key * key, int check_key, + znode_lock_mode lock_mode); + ++/* Get exclusive access and make sure that file is not partially ++ * converted (It may happen that another process is doing tail ++ * conversion. If so, wait until it completes) ++ */ ++static inline void get_exclusive_access_careful(unix_file_info_t * uf_info, ++ struct inode *inode) ++{ ++ do { ++ get_exclusive_access(uf_info); ++ if (!reiser4_inode_get_flag(inode, REISER4_PART_IN_CONV)) ++ break; ++ drop_exclusive_access(uf_info); ++ schedule(); ++ } while (1); ++} ++ +/* get unix file plugin specific portion of inode */ +unix_file_info_t *unix_file_inode_data(const struct inode *inode) +{ @@ -36307,7 +35803,7 @@ index 0000000..67501aa + result = reiser4_update_extent(inode, node, page_offset(page), + &plugged_hole); + if (result) { -+ JF_CLR(node, JNODE_WRITE_PREPARED); ++ JF_CLR(node, JNODE_WRITE_PREPARED); + jput(node); + warning("", "reiser4_update_extent failed: %d", result); + return result; @@ -37439,7 +36935,7 @@ index 0000000..67501aa + + uf_info = unix_file_inode_data(inode); + -+ get_exclusive_access(uf_info); ++ get_exclusive_access_careful(uf_info, inode); + + if (!IS_RDONLY(inode) && (vma->vm_flags & (VM_MAYWRITE | VM_SHARED))) { + /* @@ -37554,21 +37050,8 @@ index 0000000..67501aa + return PTR_ERR(ctx); + + uf_info = unix_file_inode_data(inode); -+ get_exclusive_access(uf_info); + -+ /* -+ * it may happen that another process is doing tail conversion. Wait -+ * until it completes -+ */ -+ while (1) { -+ if (reiser4_inode_get_flag(inode, REISER4_PART_IN_CONV)) { -+ drop_exclusive_access(uf_info); -+ schedule(); -+ get_exclusive_access(uf_info); -+ continue; -+ } -+ break; -+ } ++ get_exclusive_access_careful(uf_info, inode); + + if (!reiser4_inode_get_flag(inode, REISER4_PART_MIXED)) { + /* @@ -37676,8 +37159,6 @@ index 0000000..67501aa + reiser4_exit_context(ctx); + return result; + } -+ /* remove_suid might create a transaction */ -+ reiser4_txn_restart(ctx); + + uf_info = unix_file_inode_data(inode); + @@ -37871,7 +37352,7 @@ index 0000000..67501aa + if (in_reiser4 == 0) { + uf_info = unix_file_inode_data(inode); + -+ get_exclusive_access(uf_info); ++ get_exclusive_access_careful(uf_info, inode); + if (atomic_read(&file->f_dentry->d_count) == 1 && + uf_info->container == UF_CONTAINER_EXTENTS && + !should_have_notail(uf_info, inode->i_size) && @@ -38180,7 +37661,7 @@ index 0000000..67501aa + return PTR_ERR(ctx); + + uf_info = unix_file_inode_data(dentry->d_inode); -+ get_exclusive_access(uf_info); ++ get_exclusive_access_careful(uf_info, dentry->d_inode); + result = setattr_truncate(dentry->d_inode, attr); + drop_exclusive_access(uf_info); + context_set_commit_async(ctx); @@ -38324,289 +37805,9 @@ index 0000000..67501aa + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/plugin/file/file.h b/fs/reiser4/plugin/file/file.h -new file mode 100644 -index 0000000..e486a88 ---- /dev/null -+++ b/fs/reiser4/plugin/file/file.h -@@ -0,0 +1,272 @@ -+/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by -+ * reiser4/README */ -+ -+/* this file contains declarations of methods implementing -+ file plugins (UNIX_FILE_PLUGIN_ID, CRYPTCOMPRESS_FILE_PLUGIN_ID -+ and SYMLINK_FILE_PLUGIN_ID) */ -+ -+#if !defined( __REISER4_FILE_H__ ) -+#define __REISER4_FILE_H__ -+ -+/* declarations of functions implementing UNIX_FILE_PLUGIN_ID file plugin */ -+ -+/* inode operations */ -+int setattr_unix_file(struct dentry *, struct iattr *); -+ -+/* file operations */ -+ssize_t read_unix_file(struct file *, char __user *buf, size_t read_amount, -+ loff_t *off); -+ssize_t write_unix_file(struct file *, const char __user *buf, size_t write_amount, -+ loff_t * off); -+int ioctl_unix_file(struct inode *, struct file *, unsigned int cmd, -+ unsigned long arg); -+int mmap_unix_file(struct file *, struct vm_area_struct *); -+int open_unix_file(struct inode *, struct file *); -+int release_unix_file(struct inode *, struct file *); -+int sync_unix_file(struct file *, struct dentry *, int datasync); -+ssize_t sendfile_unix_file(struct file *, loff_t *ppos, size_t count, -+ read_actor_t, void *target); -+ -+/* address space operations */ -+int readpage_unix_file(struct file *, struct page *); -+int readpages_unix_file(struct file*, struct address_space*, struct list_head*, unsigned); -+int writepages_unix_file(struct address_space *, struct writeback_control *); -+int prepare_write_unix_file(struct file *, struct page *, unsigned from, -+ unsigned to); -+int commit_write_unix_file(struct file *, struct page *, unsigned from, -+ unsigned to); -+sector_t bmap_unix_file(struct address_space *, sector_t lblock); -+ -+/* file plugin operations */ -+int flow_by_inode_unix_file(struct inode *, const char __user *buf, -+ int user, loff_t, loff_t, rw_op, flow_t *); -+int owns_item_unix_file(const struct inode *, const coord_t *); -+void init_inode_data_unix_file(struct inode *, reiser4_object_create_data *, -+ int create); -+int delete_object_unix_file(struct inode *); -+ -+/* -+ * all the write into unix file is performed by item write method. Write method -+ * of unix file plugin only decides which item plugin (extent or tail) and in -+ * which mode (one from the enum below) to call -+ */ -+typedef enum { -+ FIRST_ITEM = 1, -+ APPEND_ITEM = 2, -+ OVERWRITE_ITEM = 3 -+} write_mode_t; -+ -+/* unix file may be in one the following states */ -+typedef enum { -+ UF_CONTAINER_UNKNOWN = 0, -+ UF_CONTAINER_TAILS = 1, -+ UF_CONTAINER_EXTENTS = 2, -+ UF_CONTAINER_EMPTY = 3 -+} file_container_t; -+ -+struct formatting_plugin; -+struct inode; -+ -+/* unix file plugin specific part of reiser4 inode */ -+typedef struct unix_file_info { -+ /* -+ * this read-write lock protects file containerization change. Accesses -+ * which do not change file containerization (see file_container_t) -+ * (read, readpage, writepage, write (until tail conversion is -+ * involved)) take read-lock. Accesses which modify file -+ * containerization (truncate, conversion from tail to extent and back) -+ * take write-lock. -+ */ -+ struct rw_semaphore latch; -+ /* this enum specifies which items are used to build the file */ -+ file_container_t container; -+ /* -+ * plugin which controls when file is to be converted to extents and -+ * back to tail -+ */ -+ struct formatting_plugin *tplug; -+ /* if this is set, file is in exclusive use */ -+ int exclusive_use; -+#if REISER4_DEBUG -+ /* pointer to task struct of thread owning exclusive access to file */ -+ void *ea_owner; -+ atomic_t nr_neas; -+ void *last_reader; -+#endif -+} unix_file_info_t; -+ -+struct unix_file_info *unix_file_inode_data(const struct inode *inode); -+void get_exclusive_access(unix_file_info_t *); -+void drop_exclusive_access(unix_file_info_t *); -+void get_nonexclusive_access(unix_file_info_t *); -+void drop_nonexclusive_access(unix_file_info_t *); -+int try_to_get_nonexclusive_access(unix_file_info_t *); -+int find_file_item(hint_t *, const reiser4_key *, znode_lock_mode, -+ struct inode *); -+int find_file_item_nohint(coord_t *, lock_handle *, -+ const reiser4_key *, znode_lock_mode, -+ struct inode *); -+ -+int load_file_hint(struct file *, hint_t *); -+void save_file_hint(struct file *, const hint_t *); -+ -+#include "../item/extent.h" -+#include "../item/tail.h" -+#include "../item/ctail.h" -+ -+struct uf_coord { -+ coord_t coord; -+ lock_handle *lh; -+ int valid; -+ union { -+ extent_coord_extension_t extent; -+ tail_coord_extension_t tail; -+ ctail_coord_extension_t ctail; -+ } extension; -+}; -+ -+#include "../../forward.h" -+#include "../../seal.h" -+#include "../../lock.h" -+ -+/* -+ * This structure is used to speed up file operations (reads and writes). A -+ * hint is a suggestion about where a key resolved to last time. A seal -+ * indicates whether a node has been modified since a hint was last recorded. -+ * You check the seal, and if the seal is still valid, you can use the hint -+ * without traversing the tree again. -+ */ -+struct hint { -+ seal_t seal; /* a seal over last file item accessed */ -+ uf_coord_t ext_coord; -+ loff_t offset; -+ znode_lock_mode mode; -+ lock_handle lh; -+}; -+ -+static inline int hint_is_valid(hint_t * hint) -+{ -+ return hint->ext_coord.valid; -+} -+ -+static inline void hint_set_valid(hint_t * hint) -+{ -+ hint->ext_coord.valid = 1; -+} -+ -+static inline void hint_clr_valid(hint_t * hint) -+{ -+ hint->ext_coord.valid = 0; -+} -+ -+int load_file_hint(struct file *, hint_t *); -+void save_file_hint(struct file *, const hint_t *); -+void hint_init_zero(hint_t *); -+void reiser4_set_hint(hint_t *, const reiser4_key *, znode_lock_mode); -+int hint_is_set(const hint_t *); -+void reiser4_unset_hint(hint_t *); -+ -+int reiser4_update_file_size(struct inode *, reiser4_key *, int update_sd); -+int cut_file_items(struct inode *, loff_t new_size, int update_sd, -+ loff_t cur_size, int (*update_actor) (struct inode *, -+ reiser4_key *, int)); -+#if REISER4_DEBUG -+ -+/* return 1 is exclusive access is obtained, 0 - otherwise */ -+static inline int ea_obtained(unix_file_info_t * uf_info) -+{ -+ int ret; -+ -+ ret = down_read_trylock(&uf_info->latch); -+ if (ret) -+ up_read(&uf_info->latch); -+ return !ret; -+} -+ -+#endif -+ -+/* declarations of functions implementing SYMLINK_FILE_PLUGIN_ID file plugin */ -+int reiser4_create_symlink(struct inode *symlink, struct inode *dir, -+ reiser4_object_create_data *); -+void destroy_inode_symlink(struct inode *); -+ -+/* declarations of functions implementing CRYPTCOMPRESS_FILE_PLUGIN_ID -+ file plugin */ -+ -+/* inode operations */ -+int setattr_cryptcompress(struct dentry *, struct iattr *); -+int prot_setattr_cryptcompress(struct dentry *, struct iattr *); -+ -+/* file operations */ -+ssize_t read_cryptcompress(struct file *, char __user *buf, size_t read_amount, -+ loff_t * off); -+ssize_t prot_read_cryptcompress(struct file *, char __user *buf, -+ size_t read_amount, loff_t * off); -+ -+ssize_t write_cryptcompress(struct file *, const char __user *buf, size_t write_amount, -+ loff_t * off, int * conv); -+ssize_t prot_write_cryptcompress(struct file *, const char __user *buf, size_t write_amount, -+ loff_t * off); -+int mmap_cryptcompress(struct file *, struct vm_area_struct *); -+int prot_mmap_cryptcompress(struct file *, struct vm_area_struct *); -+ssize_t sendfile_cryptcompress(struct file *file, loff_t *ppos, size_t count, -+ read_actor_t actor, void *target); -+ssize_t prot_sendfile_cryptcompress(struct file *file, loff_t *ppos, size_t count, -+ read_actor_t actor, void *target); -+ -+int release_cryptcompress(struct inode *, struct file *); -+int prot_release_cryptcompress(struct inode *, struct file *); -+ -+/* address space operations */ -+extern int readpage_cryptcompress(struct file *, struct page *); -+extern int writepages_cryptcompress(struct address_space *, -+ struct writeback_control *); -+/* file plugin operations */ -+int flow_by_inode_cryptcompress(struct inode *, const char __user *buf, -+ int user, loff_t, loff_t, rw_op, flow_t *); -+int key_by_inode_cryptcompress(struct inode *, loff_t off, reiser4_key *); -+int create_cryptcompress(struct inode *, struct inode *, -+ reiser4_object_create_data *); -+int delete_object_cryptcompress(struct inode *); -+void init_inode_data_cryptcompress(struct inode *, reiser4_object_create_data *, -+ int create); -+int cut_tree_worker_cryptcompress(tap_t *, const reiser4_key * from_key, -+ const reiser4_key * to_key, -+ reiser4_key * smallest_removed, -+ struct inode *object, int truncate, -+ int *progress); -+void destroy_inode_cryptcompress(struct inode *); -+int open_object_cryptcompress(struct inode * inode, struct file * file); -+ -+extern reiser4_plugin_ops cryptcompress_plugin_ops; -+ -+#define WRITE_GRANULARITY 32 -+ -+int tail2extent(unix_file_info_t *); -+int extent2tail(unix_file_info_t *); -+ -+int goto_right_neighbor(coord_t *, lock_handle *); -+int find_or_create_extent(struct page *); -+int equal_to_ldk(znode *, const reiser4_key *); -+ -+void init_uf_coord(uf_coord_t *uf_coord, lock_handle *lh); -+ -+static inline int cbk_errored(int cbk_result) -+{ -+ return (cbk_result != CBK_COORD_NOTFOUND -+ && cbk_result != CBK_COORD_FOUND); -+} -+ -+/* __REISER4_FILE_H__ */ -+#endif -+ -+/* -+ * Local variables: -+ * c-indentation-style: "K&R" -+ * mode-name: "LC" -+ * c-basic-offset: 8 -+ * tab-width: 8 -+ * fill-column: 79 -+ * scroll-step: 1 -+ * End: -+*/ -diff --git a/fs/reiser4/plugin/file/file_conversion.c b/fs/reiser4/plugin/file/file_conversion.c -new file mode 100644 -index 0000000..2e07b66 ---- /dev/null -+++ b/fs/reiser4/plugin/file/file_conversion.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file/file_conversion.c linux-2.6.20/fs/reiser4/plugin/file/file_conversion.c +--- linux-2.6.20.orig/fs/reiser4/plugin/file/file_conversion.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file/file_conversion.c 2007-05-06 14:50:43.783001971 +0400 @@ -0,0 +1,594 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, + licensing governed by reiser4/README */ @@ -39202,11 +38403,285 @@ index 0000000..2e07b66 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/file/invert.c b/fs/reiser4/plugin/file/invert.c -new file mode 100644 -index 0000000..7349878 ---- /dev/null -+++ b/fs/reiser4/plugin/file/invert.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file/file.h linux-2.6.20/fs/reiser4/plugin/file/file.h +--- linux-2.6.20.orig/fs/reiser4/plugin/file/file.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file/file.h 2007-05-06 14:50:43.783001971 +0400 +@@ -0,0 +1,272 @@ ++/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by ++ * reiser4/README */ ++ ++/* this file contains declarations of methods implementing ++ file plugins (UNIX_FILE_PLUGIN_ID, CRYPTCOMPRESS_FILE_PLUGIN_ID ++ and SYMLINK_FILE_PLUGIN_ID) */ ++ ++#if !defined( __REISER4_FILE_H__ ) ++#define __REISER4_FILE_H__ ++ ++/* declarations of functions implementing UNIX_FILE_PLUGIN_ID file plugin */ ++ ++/* inode operations */ ++int setattr_unix_file(struct dentry *, struct iattr *); ++ ++/* file operations */ ++ssize_t read_unix_file(struct file *, char __user *buf, size_t read_amount, ++ loff_t *off); ++ssize_t write_unix_file(struct file *, const char __user *buf, size_t write_amount, ++ loff_t * off); ++int ioctl_unix_file(struct inode *, struct file *, unsigned int cmd, ++ unsigned long arg); ++int mmap_unix_file(struct file *, struct vm_area_struct *); ++int open_unix_file(struct inode *, struct file *); ++int release_unix_file(struct inode *, struct file *); ++int sync_unix_file(struct file *, struct dentry *, int datasync); ++ssize_t sendfile_unix_file(struct file *, loff_t *ppos, size_t count, ++ read_actor_t, void *target); ++ ++/* address space operations */ ++int readpage_unix_file(struct file *, struct page *); ++int readpages_unix_file(struct file*, struct address_space*, struct list_head*, unsigned); ++int writepages_unix_file(struct address_space *, struct writeback_control *); ++int prepare_write_unix_file(struct file *, struct page *, unsigned from, ++ unsigned to); ++int commit_write_unix_file(struct file *, struct page *, unsigned from, ++ unsigned to); ++sector_t bmap_unix_file(struct address_space *, sector_t lblock); ++ ++/* file plugin operations */ ++int flow_by_inode_unix_file(struct inode *, const char __user *buf, ++ int user, loff_t, loff_t, rw_op, flow_t *); ++int owns_item_unix_file(const struct inode *, const coord_t *); ++void init_inode_data_unix_file(struct inode *, reiser4_object_create_data *, ++ int create); ++int delete_object_unix_file(struct inode *); ++ ++/* ++ * all the write into unix file is performed by item write method. Write method ++ * of unix file plugin only decides which item plugin (extent or tail) and in ++ * which mode (one from the enum below) to call ++ */ ++typedef enum { ++ FIRST_ITEM = 1, ++ APPEND_ITEM = 2, ++ OVERWRITE_ITEM = 3 ++} write_mode_t; ++ ++/* unix file may be in one the following states */ ++typedef enum { ++ UF_CONTAINER_UNKNOWN = 0, ++ UF_CONTAINER_TAILS = 1, ++ UF_CONTAINER_EXTENTS = 2, ++ UF_CONTAINER_EMPTY = 3 ++} file_container_t; ++ ++struct formatting_plugin; ++struct inode; ++ ++/* unix file plugin specific part of reiser4 inode */ ++typedef struct unix_file_info { ++ /* ++ * this read-write lock protects file containerization change. Accesses ++ * which do not change file containerization (see file_container_t) ++ * (read, readpage, writepage, write (until tail conversion is ++ * involved)) take read-lock. Accesses which modify file ++ * containerization (truncate, conversion from tail to extent and back) ++ * take write-lock. ++ */ ++ struct rw_semaphore latch; ++ /* this enum specifies which items are used to build the file */ ++ file_container_t container; ++ /* ++ * plugin which controls when file is to be converted to extents and ++ * back to tail ++ */ ++ struct formatting_plugin *tplug; ++ /* if this is set, file is in exclusive use */ ++ int exclusive_use; ++#if REISER4_DEBUG ++ /* pointer to task struct of thread owning exclusive access to file */ ++ void *ea_owner; ++ atomic_t nr_neas; ++ void *last_reader; ++#endif ++} unix_file_info_t; ++ ++struct unix_file_info *unix_file_inode_data(const struct inode *inode); ++void get_exclusive_access(unix_file_info_t *); ++void drop_exclusive_access(unix_file_info_t *); ++void get_nonexclusive_access(unix_file_info_t *); ++void drop_nonexclusive_access(unix_file_info_t *); ++int try_to_get_nonexclusive_access(unix_file_info_t *); ++int find_file_item(hint_t *, const reiser4_key *, znode_lock_mode, ++ struct inode *); ++int find_file_item_nohint(coord_t *, lock_handle *, ++ const reiser4_key *, znode_lock_mode, ++ struct inode *); ++ ++int load_file_hint(struct file *, hint_t *); ++void save_file_hint(struct file *, const hint_t *); ++ ++#include "../item/extent.h" ++#include "../item/tail.h" ++#include "../item/ctail.h" ++ ++struct uf_coord { ++ coord_t coord; ++ lock_handle *lh; ++ int valid; ++ union { ++ extent_coord_extension_t extent; ++ tail_coord_extension_t tail; ++ ctail_coord_extension_t ctail; ++ } extension; ++}; ++ ++#include "../../forward.h" ++#include "../../seal.h" ++#include "../../lock.h" ++ ++/* ++ * This structure is used to speed up file operations (reads and writes). A ++ * hint is a suggestion about where a key resolved to last time. A seal ++ * indicates whether a node has been modified since a hint was last recorded. ++ * You check the seal, and if the seal is still valid, you can use the hint ++ * without traversing the tree again. ++ */ ++struct hint { ++ seal_t seal; /* a seal over last file item accessed */ ++ uf_coord_t ext_coord; ++ loff_t offset; ++ znode_lock_mode mode; ++ lock_handle lh; ++}; ++ ++static inline int hint_is_valid(hint_t * hint) ++{ ++ return hint->ext_coord.valid; ++} ++ ++static inline void hint_set_valid(hint_t * hint) ++{ ++ hint->ext_coord.valid = 1; ++} ++ ++static inline void hint_clr_valid(hint_t * hint) ++{ ++ hint->ext_coord.valid = 0; ++} ++ ++int load_file_hint(struct file *, hint_t *); ++void save_file_hint(struct file *, const hint_t *); ++void hint_init_zero(hint_t *); ++void reiser4_set_hint(hint_t *, const reiser4_key *, znode_lock_mode); ++int hint_is_set(const hint_t *); ++void reiser4_unset_hint(hint_t *); ++ ++int reiser4_update_file_size(struct inode *, reiser4_key *, int update_sd); ++int cut_file_items(struct inode *, loff_t new_size, int update_sd, ++ loff_t cur_size, int (*update_actor) (struct inode *, ++ reiser4_key *, int)); ++#if REISER4_DEBUG ++ ++/* return 1 is exclusive access is obtained, 0 - otherwise */ ++static inline int ea_obtained(unix_file_info_t * uf_info) ++{ ++ int ret; ++ ++ ret = down_read_trylock(&uf_info->latch); ++ if (ret) ++ up_read(&uf_info->latch); ++ return !ret; ++} ++ ++#endif ++ ++/* declarations of functions implementing SYMLINK_FILE_PLUGIN_ID file plugin */ ++int reiser4_create_symlink(struct inode *symlink, struct inode *dir, ++ reiser4_object_create_data *); ++void destroy_inode_symlink(struct inode *); ++ ++/* declarations of functions implementing CRYPTCOMPRESS_FILE_PLUGIN_ID ++ file plugin */ ++ ++/* inode operations */ ++int setattr_cryptcompress(struct dentry *, struct iattr *); ++int prot_setattr_cryptcompress(struct dentry *, struct iattr *); ++ ++/* file operations */ ++ssize_t read_cryptcompress(struct file *, char __user *buf, size_t read_amount, ++ loff_t * off); ++ssize_t prot_read_cryptcompress(struct file *, char __user *buf, ++ size_t read_amount, loff_t * off); ++ ++ssize_t write_cryptcompress(struct file *, const char __user *buf, size_t write_amount, ++ loff_t * off, int * conv); ++ssize_t prot_write_cryptcompress(struct file *, const char __user *buf, size_t write_amount, ++ loff_t * off); ++int mmap_cryptcompress(struct file *, struct vm_area_struct *); ++int prot_mmap_cryptcompress(struct file *, struct vm_area_struct *); ++ssize_t sendfile_cryptcompress(struct file *file, loff_t *ppos, size_t count, ++ read_actor_t actor, void *target); ++ssize_t prot_sendfile_cryptcompress(struct file *file, loff_t *ppos, size_t count, ++ read_actor_t actor, void *target); ++ ++int release_cryptcompress(struct inode *, struct file *); ++int prot_release_cryptcompress(struct inode *, struct file *); ++ ++/* address space operations */ ++extern int readpage_cryptcompress(struct file *, struct page *); ++extern int writepages_cryptcompress(struct address_space *, ++ struct writeback_control *); ++/* file plugin operations */ ++int flow_by_inode_cryptcompress(struct inode *, const char __user *buf, ++ int user, loff_t, loff_t, rw_op, flow_t *); ++int key_by_inode_cryptcompress(struct inode *, loff_t off, reiser4_key *); ++int create_cryptcompress(struct inode *, struct inode *, ++ reiser4_object_create_data *); ++int delete_object_cryptcompress(struct inode *); ++void init_inode_data_cryptcompress(struct inode *, reiser4_object_create_data *, ++ int create); ++int cut_tree_worker_cryptcompress(tap_t *, const reiser4_key * from_key, ++ const reiser4_key * to_key, ++ reiser4_key * smallest_removed, ++ struct inode *object, int truncate, ++ int *progress); ++void destroy_inode_cryptcompress(struct inode *); ++int open_object_cryptcompress(struct inode * inode, struct file * file); ++ ++extern reiser4_plugin_ops cryptcompress_plugin_ops; ++ ++#define WRITE_GRANULARITY 32 ++ ++int tail2extent(unix_file_info_t *); ++int extent2tail(unix_file_info_t *); ++ ++int goto_right_neighbor(coord_t *, lock_handle *); ++int find_or_create_extent(struct page *); ++int equal_to_ldk(znode *, const reiser4_key *); ++ ++void init_uf_coord(uf_coord_t *uf_coord, lock_handle *lh); ++ ++static inline int cbk_errored(int cbk_result) ++{ ++ return (cbk_result != CBK_COORD_NOTFOUND ++ && cbk_result != CBK_COORD_FOUND); ++} ++ ++/* __REISER4_FILE_H__ */ ++#endif ++ ++/* ++ * Local variables: ++ * c-indentation-style: "K&R" ++ * mode-name: "LC" ++ * c-basic-offset: 8 ++ * tab-width: 8 ++ * fill-column: 79 ++ * scroll-step: 1 ++ * End: ++*/ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file/invert.c linux-2.6.20/fs/reiser4/plugin/file/invert.c +--- linux-2.6.20.orig/fs/reiser4/plugin/file/invert.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file/invert.c 2007-05-06 14:50:43.783001971 +0400 @@ -0,0 +1,493 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -39701,11 +39176,20 @@ index 0000000..7349878 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/file/symfile.c b/fs/reiser4/plugin/file/symfile.c -new file mode 100644 -index 0000000..814dfb8 ---- /dev/null -+++ b/fs/reiser4/plugin/file/symfile.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file/Makefile linux-2.6.20/fs/reiser4/plugin/file/Makefile +--- linux-2.6.20.orig/fs/reiser4/plugin/file/Makefile 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file/Makefile 2007-05-06 14:50:43.783001971 +0400 +@@ -0,0 +1,7 @@ ++obj-$(CONFIG_REISER4_FS) += file_plugins.o ++ ++file_plugins-objs := \ ++ file.o \ ++ tail_conversion.o \ ++ symlink.o \ ++ cryptcompress.o +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file/symfile.c linux-2.6.20/fs/reiser4/plugin/file/symfile.c +--- linux-2.6.20.orig/fs/reiser4/plugin/file/symfile.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file/symfile.c 2007-05-06 14:50:43.787003221 +0400 @@ -0,0 +1,87 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -39794,11 +39278,9 @@ index 0000000..814dfb8 + sophisticated symfile syntax that we are not planning to write for + version 4.0. +*/ -diff --git a/fs/reiser4/plugin/file/symlink.c b/fs/reiser4/plugin/file/symlink.c -new file mode 100644 -index 0000000..bcf3ef8 ---- /dev/null -+++ b/fs/reiser4/plugin/file/symlink.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file/symlink.c linux-2.6.20/fs/reiser4/plugin/file/symlink.c +--- linux-2.6.20.orig/fs/reiser4/plugin/file/symlink.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file/symlink.c 2007-05-06 14:50:43.787003221 +0400 @@ -0,0 +1,95 @@ +/* Copyright 2002, 2003, 2005 by Hans Reiser, licensing governed by reiser4/README */ + @@ -39895,12 +39377,10 @@ index 0000000..bcf3ef8 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/file/tail_conversion.c b/fs/reiser4/plugin/file/tail_conversion.c -new file mode 100644 -index 0000000..b57776f ---- /dev/null -+++ b/fs/reiser4/plugin/file/tail_conversion.c -@@ -0,0 +1,726 @@ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file/tail_conversion.c linux-2.6.20/fs/reiser4/plugin/file/tail_conversion.c +--- linux-2.6.20.orig/fs/reiser4/plugin/file/tail_conversion.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file/tail_conversion.c 2007-05-06 14:50:43.787003221 +0400 +@@ -0,0 +1,729 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + +#include "../../inode.h" @@ -40371,15 +39851,18 @@ index 0000000..b57776f + if (result) + goto error; + /* -+ * we have to drop exclusive access to avoid deadlock -+ * which may happen because called by -+ * reiser4_writepages capture_unix_file requires to get -+ * non-exclusive access to a file. It is safe to drop -+ * EA in the middle of tail2extent conversion because -+ * write_unix_file/unix_setattr(truncate)/release_unix_file(extent2tail) -+ * are serialized by reiser4_inode->mutex_write semaphore and -+ * because read_unix_file works (should at least) on -+ * partially converted files ++ * We have to drop exclusive access to avoid deadlock ++ * which may happen because called by reiser4_writepages ++ * capture_unix_file requires to get non-exclusive ++ * access to a file. It is safe to drop EA in the middle ++ * of tail2extent conversion because write_unix_file, ++ * setattr_unix_file(truncate), mmap_unix_file, ++ * release_unix_file(extent2tail) checks if conversion ++ * is not in progress (see comments before ++ * get_exclusive_access_careful(). ++ * Other processes that acquire non-exclusive access ++ * (read_unix_file, reiser4_writepages, etc) should work ++ * on partially converted files. + */ + drop_exclusive_access(uf_info); + /* throttle the conversion */ @@ -40627,11 +40110,9 @@ index 0000000..b57776f + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/plugin/file_ops.c b/fs/reiser4/plugin/file_ops.c -new file mode 100644 -index 0000000..ef8ba9d ---- /dev/null -+++ b/fs/reiser4/plugin/file_ops.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file_ops.c linux-2.6.20/fs/reiser4/plugin/file_ops.c +--- linux-2.6.20.orig/fs/reiser4/plugin/file_ops.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file_ops.c 2007-05-06 14:50:43.787003221 +0400 @@ -0,0 +1,168 @@ +/* Copyright 2005 by Hans Reiser, licensing governed by + reiser4/README */ @@ -40801,11 +40282,9 @@ index 0000000..ef8ba9d + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/plugin/file_ops_readdir.c b/fs/reiser4/plugin/file_ops_readdir.c -new file mode 100644 -index 0000000..2bd7826 ---- /dev/null -+++ b/fs/reiser4/plugin/file_ops_readdir.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file_ops_readdir.c linux-2.6.20/fs/reiser4/plugin/file_ops_readdir.c +--- linux-2.6.20.orig/fs/reiser4/plugin/file_ops_readdir.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file_ops_readdir.c 2007-05-06 14:50:43.791004471 +0400 @@ -0,0 +1,657 @@ +/* Copyright 2005 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -41464,11 +40943,9 @@ index 0000000..2bd7826 + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/plugin/file_plugin_common.c b/fs/reiser4/plugin/file_plugin_common.c -new file mode 100644 -index 0000000..55d9047 ---- /dev/null -+++ b/fs/reiser4/plugin/file_plugin_common.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/file_plugin_common.c linux-2.6.20/fs/reiser4/plugin/file_plugin_common.c +--- linux-2.6.20.orig/fs/reiser4/plugin/file_plugin_common.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/file_plugin_common.c 2007-05-06 14:50:43.791004471 +0400 @@ -0,0 +1,1007 @@ +/* Copyright 2005 by Hans Reiser, licensing governed by + reiser4/README */ @@ -42477,11 +41954,9 @@ index 0000000..55d9047 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/hash.c b/fs/reiser4/plugin/hash.c -new file mode 100644 -index 0000000..70f1e40 ---- /dev/null -+++ b/fs/reiser4/plugin/hash.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/hash.c linux-2.6.20/fs/reiser4/plugin/hash.c +--- linux-2.6.20.orig/fs/reiser4/plugin/hash.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/hash.c 2007-05-06 14:50:43.791004471 +0400 @@ -0,0 +1,353 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -42836,11 +42311,9 @@ index 0000000..70f1e40 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/inode_ops.c b/fs/reiser4/plugin/inode_ops.c -new file mode 100644 -index 0000000..48430f7 ---- /dev/null -+++ b/fs/reiser4/plugin/inode_ops.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/inode_ops.c linux-2.6.20/fs/reiser4/plugin/inode_ops.c +--- linux-2.6.20.orig/fs/reiser4/plugin/inode_ops.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/inode_ops.c 2007-05-06 14:50:43.795005721 +0400 @@ -0,0 +1,897 @@ +/* + * Copyright 2005 by Hans Reiser, licensing governed by reiser4/README @@ -43739,11 +43212,9 @@ index 0000000..48430f7 + dir->i_ctime = dir->i_mtime = CURRENT_TIME; + return reiser4_update_sd(dir); +} -diff --git a/fs/reiser4/plugin/inode_ops_rename.c b/fs/reiser4/plugin/inode_ops_rename.c -new file mode 100644 -index 0000000..a64e777 ---- /dev/null -+++ b/fs/reiser4/plugin/inode_ops_rename.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/inode_ops_rename.c linux-2.6.20/fs/reiser4/plugin/inode_ops_rename.c +--- linux-2.6.20.orig/fs/reiser4/plugin/inode_ops_rename.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/inode_ops_rename.c 2007-05-06 14:50:43.795005721 +0400 @@ -0,0 +1,914 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -44659,35 +44130,9 @@ index 0000000..a64e777 + return result; +} +#endif -diff --git a/fs/reiser4/plugin/item/Makefile b/fs/reiser4/plugin/item/Makefile -new file mode 100644 -index 0000000..1bae623 ---- /dev/null -+++ b/fs/reiser4/plugin/item/Makefile -@@ -0,0 +1,18 @@ -+obj-$(CONFIG_REISER4_FS) += item_plugins.o -+ -+item_plugins-objs := \ -+ item.o \ -+ static_stat.o \ -+ sde.o \ -+ cde.o \ -+ blackbox.o \ -+ internal.o \ -+ tail.o \ -+ ctail.o \ -+ extent.o \ -+ extent_item_ops.o \ -+ extent_file_ops.o \ -+ extent_flush_ops.o -+ -+ -+ -diff --git a/fs/reiser4/plugin/item/acl.h b/fs/reiser4/plugin/item/acl.h -new file mode 100644 -index 0000000..f26762a ---- /dev/null -+++ b/fs/reiser4/plugin/item/acl.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/acl.h linux-2.6.20/fs/reiser4/plugin/item/acl.h +--- linux-2.6.20.orig/fs/reiser4/plugin/item/acl.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/acl.h 2007-05-06 14:50:43.799006970 +0400 @@ -0,0 +1,66 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -44755,11 +44200,9 @@ index 0000000..f26762a + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/blackbox.c b/fs/reiser4/plugin/item/blackbox.c -new file mode 100644 -index 0000000..f13ff64 ---- /dev/null -+++ b/fs/reiser4/plugin/item/blackbox.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/blackbox.c linux-2.6.20/fs/reiser4/plugin/item/blackbox.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/blackbox.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/blackbox.c 2007-05-06 14:50:43.799006970 +0400 @@ -0,0 +1,142 @@ +/* Copyright 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -44903,11 +44346,9 @@ index 0000000..f13ff64 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/blackbox.h b/fs/reiser4/plugin/item/blackbox.h -new file mode 100644 -index 0000000..f5b7af3 ---- /dev/null -+++ b/fs/reiser4/plugin/item/blackbox.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/blackbox.h linux-2.6.20/fs/reiser4/plugin/item/blackbox.h +--- linux-2.6.20.orig/fs/reiser4/plugin/item/blackbox.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/blackbox.h 2007-05-06 14:50:43.799006970 +0400 @@ -0,0 +1,33 @@ +/* Copyright 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -44942,11 +44383,9 @@ index 0000000..f5b7af3 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/cde.c b/fs/reiser4/plugin/item/cde.c -new file mode 100644 -index 0000000..05374ac ---- /dev/null -+++ b/fs/reiser4/plugin/item/cde.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/cde.c linux-2.6.20/fs/reiser4/plugin/item/cde.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/cde.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/cde.c 2007-05-06 14:50:43.799006970 +0400 @@ -0,0 +1,1008 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -45956,11 +45395,9 @@ index 0000000..05374ac + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/cde.h b/fs/reiser4/plugin/item/cde.h -new file mode 100644 -index 0000000..73a30d5 ---- /dev/null -+++ b/fs/reiser4/plugin/item/cde.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/cde.h linux-2.6.20/fs/reiser4/plugin/item/cde.h +--- linux-2.6.20.orig/fs/reiser4/plugin/item/cde.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/cde.h 2007-05-06 14:50:43.803008220 +0400 @@ -0,0 +1,87 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -46049,11 +45486,9 @@ index 0000000..73a30d5 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/ctail.c b/fs/reiser4/plugin/item/ctail.c -new file mode 100644 -index 0000000..9cb8eca ---- /dev/null -+++ b/fs/reiser4/plugin/item/ctail.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/ctail.c linux-2.6.20/fs/reiser4/plugin/item/ctail.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/ctail.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/ctail.c 2007-05-06 14:50:43.803008220 +0400 @@ -0,0 +1,1570 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -47214,7 +46649,7 @@ index 0000000..9cb8eca + if (!pos->sq) + return RETERR(-ENOMEM); + memset(pos->sq, 0, sizeof(*pos->sq)); -+ cluster_init_write(&pos->sq->clust, NULL); ++ cluster_init_write(&pos->sq->clust, 0); + return 0; +} + @@ -47625,11 +47060,9 @@ index 0000000..9cb8eca + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/ctail.h b/fs/reiser4/plugin/item/ctail.h -new file mode 100644 -index 0000000..ead4418 ---- /dev/null -+++ b/fs/reiser4/plugin/item/ctail.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/ctail.h linux-2.6.20/fs/reiser4/plugin/item/ctail.h +--- linux-2.6.20.orig/fs/reiser4/plugin/item/ctail.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/ctail.h 2007-05-06 14:50:43.803008220 +0400 @@ -0,0 +1,97 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -47728,11 +47161,9 @@ index 0000000..ead4418 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/extent.c b/fs/reiser4/plugin/item/extent.c -new file mode 100644 -index 0000000..e35a4d5 ---- /dev/null -+++ b/fs/reiser4/plugin/item/extent.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/extent.c linux-2.6.20/fs/reiser4/plugin/item/extent.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/extent.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/extent.c 2007-05-06 14:50:43.807009470 +0400 @@ -0,0 +1,197 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -47931,249 +47362,10 @@ index 0000000..e35a4d5 + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/plugin/item/extent.h b/fs/reiser4/plugin/item/extent.h -new file mode 100644 -index 0000000..d817d1b ---- /dev/null -+++ b/fs/reiser4/plugin/item/extent.h -@@ -0,0 +1,231 @@ -+/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ -+ -+#ifndef __REISER4_EXTENT_H__ -+#define __REISER4_EXTENT_H__ -+ -+/* on disk extent */ -+typedef struct { -+ reiser4_dblock_nr start; -+ reiser4_dblock_nr width; -+} reiser4_extent; -+ -+typedef struct extent_stat { -+ int unallocated_units; -+ int unallocated_blocks; -+ int allocated_units; -+ int allocated_blocks; -+ int hole_units; -+ int hole_blocks; -+} extent_stat; -+ -+/* extents in an extent item can be either holes, or unallocated or allocated -+ extents */ -+typedef enum { -+ HOLE_EXTENT, -+ UNALLOCATED_EXTENT, -+ ALLOCATED_EXTENT -+} extent_state; -+ -+#define HOLE_EXTENT_START 0 -+#define UNALLOCATED_EXTENT_START 1 -+#define UNALLOCATED_EXTENT_START2 2 -+ -+typedef struct { -+ reiser4_block_nr pos_in_unit; -+ reiser4_block_nr width; /* width of current unit */ -+ pos_in_node_t nr_units; /* number of units */ -+ int ext_offset; /* offset from the beginning of zdata() */ -+ unsigned long expected_page; -+#if REISER4_DEBUG -+ reiser4_extent extent; -+#endif -+} extent_coord_extension_t; -+ -+/* macros to set/get fields of on-disk extent */ -+static inline reiser4_block_nr extent_get_start(const reiser4_extent * ext) -+{ -+ return le64_to_cpu(ext->start); -+} -+ -+static inline reiser4_block_nr extent_get_width(const reiser4_extent * ext) -+{ -+ return le64_to_cpu(ext->width); -+} -+ -+extern __u64 reiser4_current_block_count(void); -+ -+static inline void -+extent_set_start(reiser4_extent * ext, reiser4_block_nr start) -+{ -+ cassert(sizeof(ext->start) == 8); -+ assert("nikita-2510", -+ ergo(start > 1, start < reiser4_current_block_count())); -+ put_unaligned(cpu_to_le64(start), &ext->start); -+} -+ -+static inline void -+extent_set_width(reiser4_extent * ext, reiser4_block_nr width) -+{ -+ cassert(sizeof(ext->width) == 8); -+ assert("", width > 0); -+ put_unaligned(cpu_to_le64(width), &ext->width); -+ assert("nikita-2511", -+ ergo(extent_get_start(ext) > 1, -+ extent_get_start(ext) + width <= -+ reiser4_current_block_count())); -+} -+ -+#define extent_item(coord) \ -+({ \ -+ assert("nikita-3143", item_is_extent(coord)); \ -+ ((reiser4_extent *)item_body_by_coord (coord)); \ -+}) -+ -+#define extent_by_coord(coord) \ -+({ \ -+ assert("nikita-3144", item_is_extent(coord)); \ -+ (extent_item (coord) + (coord)->unit_pos); \ -+}) -+ -+#define width_by_coord(coord) \ -+({ \ -+ assert("nikita-3145", item_is_extent(coord)); \ -+ extent_get_width (extent_by_coord(coord)); \ -+}) -+ -+struct carry_cut_data; -+struct carry_kill_data; -+ -+/* plugin->u.item.b.* */ -+reiser4_key *max_key_inside_extent(const coord_t *, reiser4_key *); -+int can_contain_key_extent(const coord_t * coord, const reiser4_key * key, -+ const reiser4_item_data *); -+int mergeable_extent(const coord_t * p1, const coord_t * p2); -+pos_in_node_t nr_units_extent(const coord_t *); -+lookup_result lookup_extent(const reiser4_key *, lookup_bias, coord_t *); -+void init_coord_extent(coord_t *); -+int init_extent(coord_t *, reiser4_item_data *); -+int paste_extent(coord_t *, reiser4_item_data *, carry_plugin_info *); -+int can_shift_extent(unsigned free_space, -+ coord_t * source, znode * target, shift_direction, -+ unsigned *size, unsigned want); -+void copy_units_extent(coord_t * target, coord_t * source, unsigned from, -+ unsigned count, shift_direction where_is_free_space, -+ unsigned free_space); -+int kill_hook_extent(const coord_t *, pos_in_node_t from, pos_in_node_t count, -+ struct carry_kill_data *); -+int create_hook_extent(const coord_t * coord, void *arg); -+int cut_units_extent(coord_t * coord, pos_in_node_t from, pos_in_node_t to, -+ struct carry_cut_data *, reiser4_key * smallest_removed, -+ reiser4_key * new_first); -+int kill_units_extent(coord_t * coord, pos_in_node_t from, pos_in_node_t to, -+ struct carry_kill_data *, reiser4_key * smallest_removed, -+ reiser4_key * new_first); -+reiser4_key *unit_key_extent(const coord_t *, reiser4_key *); -+reiser4_key *max_unit_key_extent(const coord_t *, reiser4_key *); -+void print_extent(const char *, coord_t *); -+int utmost_child_extent(const coord_t * coord, sideof side, jnode ** child); -+int utmost_child_real_block_extent(const coord_t * coord, sideof side, -+ reiser4_block_nr * block); -+void item_stat_extent(const coord_t * coord, void *vp); -+int reiser4_check_extent(const coord_t * coord, const char **error); -+ -+/* plugin->u.item.s.file.* */ -+ssize_t reiser4_write_extent(struct file *, const char __user *, -+ size_t, loff_t *); -+int reiser4_read_extent(struct file *, flow_t *, hint_t *); -+int reiser4_readpage_extent(void *, struct page *); -+int reiser4_do_readpage_extent(reiser4_extent*, reiser4_block_nr, struct page*); -+reiser4_key *append_key_extent(const coord_t *, reiser4_key *); -+void init_coord_extension_extent(uf_coord_t *, loff_t offset); -+int get_block_address_extent(const coord_t *, sector_t block, -+ sector_t * result); -+ -+/* these are used in flush.c -+ FIXME-VS: should they be somewhere in item_plugin? */ -+int allocate_extent_item_in_place(coord_t *, lock_handle *, flush_pos_t * pos); -+int allocate_and_copy_extent(znode * left, coord_t * right, flush_pos_t * pos, -+ reiser4_key * stop_key); -+ -+int extent_is_unallocated(const coord_t * item); /* True if this extent is unallocated (i.e., not a hole, not allocated). */ -+__u64 extent_unit_index(const coord_t * item); /* Block offset of this unit. */ -+__u64 extent_unit_width(const coord_t * item); /* Number of blocks in this unit. */ -+ -+/* plugin->u.item.f. */ -+int reiser4_scan_extent(flush_scan * scan); -+extern int key_by_offset_extent(struct inode *, loff_t, reiser4_key *); -+ -+reiser4_item_data *init_new_extent(reiser4_item_data * data, void *ext_unit, -+ int nr_extents); -+reiser4_block_nr reiser4_extent_size(const coord_t * coord, pos_in_node_t nr); -+extent_state state_of_extent(reiser4_extent * ext); -+void reiser4_set_extent(reiser4_extent *, reiser4_block_nr start, -+ reiser4_block_nr width); -+int reiser4_update_extent(struct inode *, jnode *, loff_t pos, -+ int *plugged_hole); -+ -+#include "../../coord.h" -+#include "../../lock.h" -+#include "../../tap.h" -+ -+struct replace_handle { -+ /* these are to be set before calling reiser4_replace_extent */ -+ coord_t *coord; -+ lock_handle *lh; -+ reiser4_key key; -+ reiser4_key *pkey; -+ reiser4_extent overwrite; -+ reiser4_extent new_extents[2]; -+ int nr_new_extents; -+ unsigned flags; -+ -+ /* these are used by reiser4_replace_extent */ -+ reiser4_item_data item; -+ coord_t coord_after; -+ lock_handle lh_after; -+ tap_t watch; -+ reiser4_key paste_key; -+#if REISER4_DEBUG -+ reiser4_extent orig_ext; -+ reiser4_key tmp; -+#endif -+}; -+ -+/* this structure is kmalloced before calling make_extent to avoid excessive -+ stack consumption on plug_hole->reiser4_replace_extent */ -+struct make_extent_handle { -+ uf_coord_t *uf_coord; -+ reiser4_block_nr blocknr; -+ int created; -+ struct inode *inode; -+ union { -+ struct { -+ } append; -+ struct replace_handle replace; -+ } u; -+}; -+ -+int reiser4_replace_extent(struct replace_handle *, -+ int return_inserted_position); -+lock_handle *znode_lh(znode *); -+ -+/* the reiser4 repacker support */ -+struct repacker_cursor; -+extern int process_extent_backward_for_repacking(tap_t *, -+ struct repacker_cursor *); -+extern int mark_extent_for_repacking(tap_t *, int); -+ -+#define coord_by_uf_coord(uf_coord) (&((uf_coord)->coord)) -+#define ext_coord_by_uf_coord(uf_coord) (&((uf_coord)->extension.extent)) -+ -+/* __REISER4_EXTENT_H__ */ -+#endif -+/* -+ Local variables: -+ c-indentation-style: "K&R" -+ mode-name: "LC" -+ c-basic-offset: 8 -+ tab-width: 8 -+ fill-column: 120 -+ End: -+*/ -diff --git a/fs/reiser4/plugin/item/extent_file_ops.c b/fs/reiser4/plugin/item/extent_file_ops.c -new file mode 100644 -index 0000000..cf337c4 ---- /dev/null -+++ b/fs/reiser4/plugin/item/extent_file_ops.c -@@ -0,0 +1,1435 @@ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/extent_file_ops.c linux-2.6.20/fs/reiser4/plugin/item/extent_file_ops.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/extent_file_ops.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/extent_file_ops.c 2007-05-06 14:50:43.807009470 +0400 +@@ -0,0 +1,1443 @@ +/* COPYRIGHT 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + +#include "item.h" @@ -48492,7 +47684,7 @@ index 0000000..cf337c4 + spin_lock_jnode(node); + JF_SET(node, JNODE_CREATED); + jnode_set_block(node, &block); -+ result = reiser4_try_capture(node, ZNODE_WRITE_LOCK, 0); ++ result = reiser4_try_capture(node, ZNODE_WRITE_LOCK, 0); + BUG_ON(result != 0); + jnode_make_dirty_locked(node); + spin_unlock_jnode(node); @@ -48615,7 +47807,7 @@ index 0000000..cf337c4 + spin_lock_jnode(node); + JF_SET(node, JNODE_CREATED); + jnode_set_block(node, &block); -+ result = reiser4_try_capture(node, ZNODE_WRITE_LOCK, 0); ++ result = reiser4_try_capture(node, ZNODE_WRITE_LOCK, 0); + BUG_ON(result != 0); + jnode_make_dirty_locked(node); + spin_unlock_jnode(node); @@ -49117,15 +48309,15 @@ index 0000000..cf337c4 + * reiser4_write_extent - write method of extent item plugin + * @file: file to write to + * @buf: address of user-space buffer -+ * @write_amount: number of bytes to write -+ * @off: position in file to write to ++ * @count: number of bytes to write ++ * @pos: position in file to write to + * + */ +ssize_t reiser4_write_extent(struct file *file, const char __user *buf, + size_t count, loff_t *pos) +{ + int have_to_update_extent; -+ int nr_pages; ++ int nr_pages, nr_dirty; + struct page *page; + jnode *jnodes[WRITE_GRANULARITY + 1]; + struct inode *inode; @@ -49134,7 +48326,7 @@ index 0000000..cf337c4 + int i; + int to_page, page_off; + size_t left, written; -+ int result; ++ int result = 0; + + inode = file->f_dentry->d_inode; + if (write_extent_reserve_space(inode)) @@ -49148,10 +48340,12 @@ index 0000000..cf337c4 + + BUG_ON(get_current_context()->trans->atom != NULL); + ++ left = count; + index = *pos >> PAGE_CACHE_SHIFT; + /* calculate number of pages which are to be written */ + end = ((*pos + count - 1) >> PAGE_CACHE_SHIFT); + nr_pages = end - index + 1; ++ nr_dirty = 0; + assert("", nr_pages <= WRITE_GRANULARITY + 1); + + /* get pages and jnodes */ @@ -49159,22 +48353,18 @@ index 0000000..cf337c4 + page = find_or_create_page(inode->i_mapping, index + i, + reiser4_ctx_gfp_mask_get()); + if (page == NULL) { -+ while(i --) { -+ unlock_page(jnode_page(jnodes[i])); -+ page_cache_release(jnode_page(jnodes[i])); -+ } -+ return RETERR(-ENOMEM); ++ nr_pages = i; ++ result = RETERR(-ENOMEM); ++ goto out; + } + + jnodes[i] = jnode_of_page(page); + if (IS_ERR(jnodes[i])) { + unlock_page(page); + page_cache_release(page); -+ while (i --) { -+ jput(jnodes[i]); -+ page_cache_release(jnode_page(jnodes[i])); -+ } -+ return RETERR(-ENOMEM); ++ nr_pages = i; ++ result = RETERR(-ENOMEM); ++ goto out; + } + /* prevent jnode and page from disconnecting */ + JF_SET(jnodes[i], JNODE_WRITE_PREPARED); @@ -49185,7 +48375,6 @@ index 0000000..cf337c4 + + have_to_update_extent = 0; + -+ left = count; + page_off = (*pos & (PAGE_CACHE_SIZE - 1)); + for (i = 0; i < nr_pages; i ++) { + to_page = PAGE_CACHE_SIZE - page_off; @@ -49228,12 +48417,19 @@ index 0000000..cf337c4 + } + + written = filemap_copy_from_user(page, page_off, buf, to_page); ++ if (unlikely(written != to_page)) { ++ unlock_page(page); ++ result = RETERR(-EFAULT); ++ break; ++ } ++ + flush_dcache_page(page); + reiser4_set_page_dirty_internal(page); + unlock_page(page); ++ nr_dirty++; ++ + mark_page_accessed(page); + SetPageUptodate(page); -+ page_cache_release(page); + + if (jnodes[i]->blocknr == 0) + have_to_update_extent ++; @@ -49245,25 +48441,29 @@ index 0000000..cf337c4 + } + + if (have_to_update_extent) { -+ update_extents(file, jnodes, nr_pages, *pos); ++ update_extents(file, jnodes, nr_dirty, *pos); + } else { -+ for (i = 0; i < nr_pages; i ++) { ++ for (i = 0; i < nr_dirty; i ++) { ++ int ret; + spin_lock_jnode(jnodes[i]); -+ result = reiser4_try_capture(jnodes[i], ++ ret = reiser4_try_capture(jnodes[i], + ZNODE_WRITE_LOCK, 0); -+ BUG_ON(result != 0); ++ BUG_ON(ret != 0); + jnode_make_dirty_locked(jnodes[i]); + spin_unlock_jnode(jnodes[i]); + } + } -+ ++out: + for (i = 0; i < nr_pages; i ++) { ++ page_cache_release(jnode_page(jnodes[i])); + JF_CLR(jnodes[i], JNODE_WRITE_PREPARED); + jput(jnodes[i]); + } + -+ /* the only error handled so far is EFAULT on copy_from_user */ -+ return (count - left) ? (count - left) : -EFAULT; ++ /* the only errors handled so far is ENOMEM and ++ EFAULT on copy_from_user */ ++ ++ return (count - left) ? (count - left) : result; +} + +static inline void zero_page(struct page *page) @@ -49609,11 +48809,9 @@ index 0000000..cf337c4 + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/plugin/item/extent_flush_ops.c b/fs/reiser4/plugin/item/extent_flush_ops.c -new file mode 100644 -index 0000000..02dda3e ---- /dev/null -+++ b/fs/reiser4/plugin/item/extent_flush_ops.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/extent_flush_ops.c linux-2.6.20/fs/reiser4/plugin/item/extent_flush_ops.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/extent_flush_ops.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/extent_flush_ops.c 2007-05-06 14:50:43.811010720 +0400 @@ -0,0 +1,1028 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -50643,11 +49841,244 @@ index 0000000..02dda3e + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/plugin/item/extent_item_ops.c b/fs/reiser4/plugin/item/extent_item_ops.c -new file mode 100644 -index 0000000..53ba8e7 ---- /dev/null -+++ b/fs/reiser4/plugin/item/extent_item_ops.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/extent.h linux-2.6.20/fs/reiser4/plugin/item/extent.h +--- linux-2.6.20.orig/fs/reiser4/plugin/item/extent.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/extent.h 2007-05-06 14:50:43.811010720 +0400 +@@ -0,0 +1,231 @@ ++/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ ++ ++#ifndef __REISER4_EXTENT_H__ ++#define __REISER4_EXTENT_H__ ++ ++/* on disk extent */ ++typedef struct { ++ reiser4_dblock_nr start; ++ reiser4_dblock_nr width; ++} reiser4_extent; ++ ++typedef struct extent_stat { ++ int unallocated_units; ++ int unallocated_blocks; ++ int allocated_units; ++ int allocated_blocks; ++ int hole_units; ++ int hole_blocks; ++} extent_stat; ++ ++/* extents in an extent item can be either holes, or unallocated or allocated ++ extents */ ++typedef enum { ++ HOLE_EXTENT, ++ UNALLOCATED_EXTENT, ++ ALLOCATED_EXTENT ++} extent_state; ++ ++#define HOLE_EXTENT_START 0 ++#define UNALLOCATED_EXTENT_START 1 ++#define UNALLOCATED_EXTENT_START2 2 ++ ++typedef struct { ++ reiser4_block_nr pos_in_unit; ++ reiser4_block_nr width; /* width of current unit */ ++ pos_in_node_t nr_units; /* number of units */ ++ int ext_offset; /* offset from the beginning of zdata() */ ++ unsigned long expected_page; ++#if REISER4_DEBUG ++ reiser4_extent extent; ++#endif ++} extent_coord_extension_t; ++ ++/* macros to set/get fields of on-disk extent */ ++static inline reiser4_block_nr extent_get_start(const reiser4_extent * ext) ++{ ++ return le64_to_cpu(ext->start); ++} ++ ++static inline reiser4_block_nr extent_get_width(const reiser4_extent * ext) ++{ ++ return le64_to_cpu(ext->width); ++} ++ ++extern __u64 reiser4_current_block_count(void); ++ ++static inline void ++extent_set_start(reiser4_extent * ext, reiser4_block_nr start) ++{ ++ cassert(sizeof(ext->start) == 8); ++ assert("nikita-2510", ++ ergo(start > 1, start < reiser4_current_block_count())); ++ put_unaligned(cpu_to_le64(start), &ext->start); ++} ++ ++static inline void ++extent_set_width(reiser4_extent * ext, reiser4_block_nr width) ++{ ++ cassert(sizeof(ext->width) == 8); ++ assert("", width > 0); ++ put_unaligned(cpu_to_le64(width), &ext->width); ++ assert("nikita-2511", ++ ergo(extent_get_start(ext) > 1, ++ extent_get_start(ext) + width <= ++ reiser4_current_block_count())); ++} ++ ++#define extent_item(coord) \ ++({ \ ++ assert("nikita-3143", item_is_extent(coord)); \ ++ ((reiser4_extent *)item_body_by_coord (coord)); \ ++}) ++ ++#define extent_by_coord(coord) \ ++({ \ ++ assert("nikita-3144", item_is_extent(coord)); \ ++ (extent_item (coord) + (coord)->unit_pos); \ ++}) ++ ++#define width_by_coord(coord) \ ++({ \ ++ assert("nikita-3145", item_is_extent(coord)); \ ++ extent_get_width (extent_by_coord(coord)); \ ++}) ++ ++struct carry_cut_data; ++struct carry_kill_data; ++ ++/* plugin->u.item.b.* */ ++reiser4_key *max_key_inside_extent(const coord_t *, reiser4_key *); ++int can_contain_key_extent(const coord_t * coord, const reiser4_key * key, ++ const reiser4_item_data *); ++int mergeable_extent(const coord_t * p1, const coord_t * p2); ++pos_in_node_t nr_units_extent(const coord_t *); ++lookup_result lookup_extent(const reiser4_key *, lookup_bias, coord_t *); ++void init_coord_extent(coord_t *); ++int init_extent(coord_t *, reiser4_item_data *); ++int paste_extent(coord_t *, reiser4_item_data *, carry_plugin_info *); ++int can_shift_extent(unsigned free_space, ++ coord_t * source, znode * target, shift_direction, ++ unsigned *size, unsigned want); ++void copy_units_extent(coord_t * target, coord_t * source, unsigned from, ++ unsigned count, shift_direction where_is_free_space, ++ unsigned free_space); ++int kill_hook_extent(const coord_t *, pos_in_node_t from, pos_in_node_t count, ++ struct carry_kill_data *); ++int create_hook_extent(const coord_t * coord, void *arg); ++int cut_units_extent(coord_t * coord, pos_in_node_t from, pos_in_node_t to, ++ struct carry_cut_data *, reiser4_key * smallest_removed, ++ reiser4_key * new_first); ++int kill_units_extent(coord_t * coord, pos_in_node_t from, pos_in_node_t to, ++ struct carry_kill_data *, reiser4_key * smallest_removed, ++ reiser4_key * new_first); ++reiser4_key *unit_key_extent(const coord_t *, reiser4_key *); ++reiser4_key *max_unit_key_extent(const coord_t *, reiser4_key *); ++void print_extent(const char *, coord_t *); ++int utmost_child_extent(const coord_t * coord, sideof side, jnode ** child); ++int utmost_child_real_block_extent(const coord_t * coord, sideof side, ++ reiser4_block_nr * block); ++void item_stat_extent(const coord_t * coord, void *vp); ++int reiser4_check_extent(const coord_t * coord, const char **error); ++ ++/* plugin->u.item.s.file.* */ ++ssize_t reiser4_write_extent(struct file *, const char __user *, ++ size_t, loff_t *); ++int reiser4_read_extent(struct file *, flow_t *, hint_t *); ++int reiser4_readpage_extent(void *, struct page *); ++int reiser4_do_readpage_extent(reiser4_extent*, reiser4_block_nr, struct page*); ++reiser4_key *append_key_extent(const coord_t *, reiser4_key *); ++void init_coord_extension_extent(uf_coord_t *, loff_t offset); ++int get_block_address_extent(const coord_t *, sector_t block, ++ sector_t * result); ++ ++/* these are used in flush.c ++ FIXME-VS: should they be somewhere in item_plugin? */ ++int allocate_extent_item_in_place(coord_t *, lock_handle *, flush_pos_t * pos); ++int allocate_and_copy_extent(znode * left, coord_t * right, flush_pos_t * pos, ++ reiser4_key * stop_key); ++ ++int extent_is_unallocated(const coord_t * item); /* True if this extent is unallocated (i.e., not a hole, not allocated). */ ++__u64 extent_unit_index(const coord_t * item); /* Block offset of this unit. */ ++__u64 extent_unit_width(const coord_t * item); /* Number of blocks in this unit. */ ++ ++/* plugin->u.item.f. */ ++int reiser4_scan_extent(flush_scan * scan); ++extern int key_by_offset_extent(struct inode *, loff_t, reiser4_key *); ++ ++reiser4_item_data *init_new_extent(reiser4_item_data * data, void *ext_unit, ++ int nr_extents); ++reiser4_block_nr reiser4_extent_size(const coord_t * coord, pos_in_node_t nr); ++extent_state state_of_extent(reiser4_extent * ext); ++void reiser4_set_extent(reiser4_extent *, reiser4_block_nr start, ++ reiser4_block_nr width); ++int reiser4_update_extent(struct inode *, jnode *, loff_t pos, ++ int *plugged_hole); ++ ++#include "../../coord.h" ++#include "../../lock.h" ++#include "../../tap.h" ++ ++struct replace_handle { ++ /* these are to be set before calling reiser4_replace_extent */ ++ coord_t *coord; ++ lock_handle *lh; ++ reiser4_key key; ++ reiser4_key *pkey; ++ reiser4_extent overwrite; ++ reiser4_extent new_extents[2]; ++ int nr_new_extents; ++ unsigned flags; ++ ++ /* these are used by reiser4_replace_extent */ ++ reiser4_item_data item; ++ coord_t coord_after; ++ lock_handle lh_after; ++ tap_t watch; ++ reiser4_key paste_key; ++#if REISER4_DEBUG ++ reiser4_extent orig_ext; ++ reiser4_key tmp; ++#endif ++}; ++ ++/* this structure is kmalloced before calling make_extent to avoid excessive ++ stack consumption on plug_hole->reiser4_replace_extent */ ++struct make_extent_handle { ++ uf_coord_t *uf_coord; ++ reiser4_block_nr blocknr; ++ int created; ++ struct inode *inode; ++ union { ++ struct { ++ } append; ++ struct replace_handle replace; ++ } u; ++}; ++ ++int reiser4_replace_extent(struct replace_handle *, ++ int return_inserted_position); ++lock_handle *znode_lh(znode *); ++ ++/* the reiser4 repacker support */ ++struct repacker_cursor; ++extern int process_extent_backward_for_repacking(tap_t *, ++ struct repacker_cursor *); ++extern int mark_extent_for_repacking(tap_t *, int); ++ ++#define coord_by_uf_coord(uf_coord) (&((uf_coord)->coord)) ++#define ext_coord_by_uf_coord(uf_coord) (&((uf_coord)->extension.extent)) ++ ++/* __REISER4_EXTENT_H__ */ ++#endif ++/* ++ Local variables: ++ c-indentation-style: "K&R" ++ mode-name: "LC" ++ c-basic-offset: 8 ++ tab-width: 8 ++ fill-column: 120 ++ End: ++*/ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/extent_item_ops.c linux-2.6.20/fs/reiser4/plugin/item/extent_item_ops.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/extent_item_ops.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/extent_item_ops.c 2007-05-06 14:50:43.815011970 +0400 @@ -0,0 +1,889 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -51538,11 +50969,9 @@ index 0000000..53ba8e7 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/item/internal.c b/fs/reiser4/plugin/item/internal.c -new file mode 100644 -index 0000000..eb79388 ---- /dev/null -+++ b/fs/reiser4/plugin/item/internal.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/internal.c linux-2.6.20/fs/reiser4/plugin/item/internal.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/internal.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/internal.c 2007-05-06 14:50:43.815011970 +0400 @@ -0,0 +1,396 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -51940,11 +51369,9 @@ index 0000000..eb79388 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/internal.h b/fs/reiser4/plugin/item/internal.h -new file mode 100644 -index 0000000..27aa27d ---- /dev/null -+++ b/fs/reiser4/plugin/item/internal.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/internal.h linux-2.6.20/fs/reiser4/plugin/item/internal.h +--- linux-2.6.20.orig/fs/reiser4/plugin/item/internal.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/internal.h 2007-05-06 14:50:43.815011970 +0400 @@ -0,0 +1,57 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ +/* Internal item contains down-link to the child of the internal/twig @@ -52003,11 +51430,9 @@ index 0000000..27aa27d + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/item.c b/fs/reiser4/plugin/item/item.c -new file mode 100644 -index 0000000..e226f04 ---- /dev/null -+++ b/fs/reiser4/plugin/item/item.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/item.c linux-2.6.20/fs/reiser4/plugin/item/item.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/item.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/item.c 2007-05-06 14:50:43.815011970 +0400 @@ -0,0 +1,719 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -52728,11 +52153,9 @@ index 0000000..e226f04 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/item.h b/fs/reiser4/plugin/item/item.h -new file mode 100644 -index 0000000..0822296 ---- /dev/null -+++ b/fs/reiser4/plugin/item/item.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/item.h linux-2.6.20/fs/reiser4/plugin/item/item.h +--- linux-2.6.20.orig/fs/reiser4/plugin/item/item.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/item.h 2007-05-06 14:50:43.819013220 +0400 @@ -0,0 +1,400 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -53134,11 +52557,31 @@ index 0000000..0822296 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/item/sde.c b/fs/reiser4/plugin/item/sde.c -new file mode 100644 -index 0000000..27f2400 ---- /dev/null -+++ b/fs/reiser4/plugin/item/sde.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/Makefile linux-2.6.20/fs/reiser4/plugin/item/Makefile +--- linux-2.6.20.orig/fs/reiser4/plugin/item/Makefile 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/Makefile 2007-05-06 14:50:43.819013220 +0400 +@@ -0,0 +1,18 @@ ++obj-$(CONFIG_REISER4_FS) += item_plugins.o ++ ++item_plugins-objs := \ ++ item.o \ ++ static_stat.o \ ++ sde.o \ ++ cde.o \ ++ blackbox.o \ ++ internal.o \ ++ tail.o \ ++ ctail.o \ ++ extent.o \ ++ extent_item_ops.o \ ++ extent_file_ops.o \ ++ extent_flush_ops.o ++ ++ ++ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/sde.c linux-2.6.20/fs/reiser4/plugin/item/sde.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/sde.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/sde.c 2007-05-06 14:50:43.819013220 +0400 @@ -0,0 +1,190 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -53330,11 +52773,9 @@ index 0000000..27f2400 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/sde.h b/fs/reiser4/plugin/item/sde.h -new file mode 100644 -index 0000000..f26762a ---- /dev/null -+++ b/fs/reiser4/plugin/item/sde.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/sde.h linux-2.6.20/fs/reiser4/plugin/item/sde.h +--- linux-2.6.20.orig/fs/reiser4/plugin/item/sde.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/sde.h 2007-05-06 14:50:43.819013220 +0400 @@ -0,0 +1,66 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -53402,12 +52843,10 @@ index 0000000..f26762a + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/static_stat.c b/fs/reiser4/plugin/item/static_stat.c -new file mode 100644 -index 0000000..c38e44a ---- /dev/null -+++ b/fs/reiser4/plugin/item/static_stat.c -@@ -0,0 +1,1106 @@ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/static_stat.c linux-2.6.20/fs/reiser4/plugin/item/static_stat.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/static_stat.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/static_stat.c 2007-05-06 14:50:43.823014469 +0400 +@@ -0,0 +1,1107 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + +/* stat data manipulation. */ @@ -53578,6 +53017,7 @@ index 0000000..c38e44a + break; + } + state->extmask = bigmask; ++ /* common initialisations */ + if (len - (bit / 16 * sizeof(d16)) > 0) { + /* alignment in save_len_static_sd() is taken into account + -edward */ @@ -54514,11 +53954,9 @@ index 0000000..c38e44a + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/static_stat.h b/fs/reiser4/plugin/item/static_stat.h -new file mode 100644 -index 0000000..dd20eb3 ---- /dev/null -+++ b/fs/reiser4/plugin/item/static_stat.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/static_stat.h linux-2.6.20/fs/reiser4/plugin/item/static_stat.h +--- linux-2.6.20.orig/fs/reiser4/plugin/item/static_stat.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/static_stat.h 2007-05-06 14:50:43.823014469 +0400 @@ -0,0 +1,224 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -54744,11 +54182,9 @@ index 0000000..dd20eb3 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/item/tail.c b/fs/reiser4/plugin/item/tail.c -new file mode 100644 -index 0000000..281dd36 ---- /dev/null -+++ b/fs/reiser4/plugin/item/tail.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/tail.c linux-2.6.20/fs/reiser4/plugin/item/tail.c +--- linux-2.6.20.orig/fs/reiser4/plugin/item/tail.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/tail.c 2007-05-06 14:50:43.823014469 +0400 @@ -0,0 +1,812 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -55562,11 +54998,9 @@ index 0000000..281dd36 + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/plugin/item/tail.h b/fs/reiser4/plugin/item/tail.h -new file mode 100644 -index 0000000..459fa27 ---- /dev/null -+++ b/fs/reiser4/plugin/item/tail.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/item/tail.h linux-2.6.20/fs/reiser4/plugin/item/tail.h +--- linux-2.6.20.orig/fs/reiser4/plugin/item/tail.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/item/tail.h 2007-05-06 14:50:43.827015719 +0400 @@ -0,0 +1,58 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -55626,437 +55060,48 @@ index 0000000..459fa27 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/node/Makefile b/fs/reiser4/plugin/node/Makefile -new file mode 100644 -index 0000000..9400627 ---- /dev/null -+++ b/fs/reiser4/plugin/node/Makefile +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/Makefile linux-2.6.20/fs/reiser4/plugin/Makefile +--- linux-2.6.20.orig/fs/reiser4/plugin/Makefile 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/Makefile 2007-05-06 14:50:43.827015719 +0400 +@@ -0,0 +1,26 @@ ++obj-$(CONFIG_REISER4_FS) += plugins.o ++ ++plugins-objs := \ ++ plugin.o \ ++ plugin_set.o \ ++ object.o \ ++ inode_ops.o \ ++ inode_ops_rename.o \ ++ file_ops.o \ ++ file_ops_readdir.o \ ++ file_plugin_common.o \ ++ dir_plugin_common.o \ ++ digest.o \ ++ hash.o \ ++ fibration.o \ ++ tail_policy.o \ ++ regular.o ++ ++obj-$(CONFIG_REISER4_FS) += item/ ++obj-$(CONFIG_REISER4_FS) += file/ ++obj-$(CONFIG_REISER4_FS) += dir/ ++obj-$(CONFIG_REISER4_FS) += node/ ++obj-$(CONFIG_REISER4_FS) += compress/ ++obj-$(CONFIG_REISER4_FS) += space/ ++obj-$(CONFIG_REISER4_FS) += disk_format/ ++obj-$(CONFIG_REISER4_FS) += security/ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/node/Makefile linux-2.6.20/fs/reiser4/plugin/node/Makefile +--- linux-2.6.20.orig/fs/reiser4/plugin/node/Makefile 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/node/Makefile 2007-05-06 14:50:43.827015719 +0400 @@ -0,0 +1,5 @@ +obj-$(CONFIG_REISER4_FS) += node_plugins.o + +node_plugins-objs := \ + node.o \ + node40.o -diff --git a/fs/reiser4/plugin/node/node.c b/fs/reiser4/plugin/node/node.c -new file mode 100644 -index 0000000..179a4a7 ---- /dev/null -+++ b/fs/reiser4/plugin/node/node.c -@@ -0,0 +1,131 @@ -+/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ -+ -+/* Node plugin interface. -+ -+ Description: The tree provides the abstraction of flows, which it -+ internally fragments into items which it stores in nodes. -+ -+ A key_atom is a piece of data bound to a single key. -+ -+ For reasonable space efficiency to be achieved it is often -+ necessary to store key_atoms in the nodes in the form of items, where -+ an item is a sequence of key_atoms of the same or similar type. It is -+ more space-efficient, because the item can implement (very) -+ efficient compression of key_atom's bodies using internal knowledge -+ about their semantics, and it can often avoid having a key for each -+ key_atom. Each type of item has specific operations implemented by its -+ item handler (see balance.c). -+ -+ Rationale: the rest of the code (specifically balancing routines) -+ accesses leaf level nodes through this interface. This way we can -+ implement various block layouts and even combine various layouts -+ within the same tree. Balancing/allocating algorithms should not -+ care about peculiarities of splitting/merging specific item types, -+ but rather should leave that to the item's item handler. -+ -+ Items, including those that provide the abstraction of flows, have -+ the property that if you move them in part or in whole to another -+ node, the balancing code invokes their is_left_mergeable() -+ item_operation to determine if they are mergeable with their new -+ neighbor in the node you have moved them to. For some items the -+ is_left_mergeable() function always returns null. -+ -+ When moving the bodies of items from one node to another: -+ -+ if a partial item is shifted to another node the balancing code invokes -+ an item handler method to handle the item splitting. -+ -+ if the balancing code needs to merge with an item in the node it -+ is shifting to, it will invoke an item handler method to handle -+ the item merging. -+ -+ if it needs to move whole item bodies unchanged, the balancing code uses xmemcpy() -+ adjusting the item headers after the move is done using the node handler. -+*/ -+ -+#include "../../forward.h" -+#include "../../debug.h" -+#include "../../key.h" -+#include "../../coord.h" -+#include "../plugin_header.h" -+#include "../item/item.h" -+#include "node.h" -+#include "../plugin.h" -+#include "../../znode.h" -+#include "../../tree.h" -+#include "../../super.h" -+#include "../../reiser4.h" -+ -+/** -+ * leftmost_key_in_node - get the smallest key in node -+ * @node: -+ * @key: store result here -+ * -+ * Stores the leftmost key of @node in @key. -+ */ -+reiser4_key *leftmost_key_in_node(const znode *node, reiser4_key *key) -+{ -+ assert("nikita-1634", node != NULL); -+ assert("nikita-1635", key != NULL); -+ -+ if (!node_is_empty(node)) { -+ coord_t first_item; -+ -+ coord_init_first_unit(&first_item, (znode *) node); -+ item_key_by_coord(&first_item, key); -+ } else -+ *key = *reiser4_max_key(); -+ return key; -+} -+ -+node_plugin node_plugins[LAST_NODE_ID] = { -+ [NODE40_ID] = { -+ .h = { -+ .type_id = REISER4_NODE_PLUGIN_TYPE, -+ .id = NODE40_ID, -+ .pops = NULL, -+ .label = "unified", -+ .desc = "unified node layout", -+ .linkage = {NULL, NULL} -+ }, -+ .item_overhead = item_overhead_node40, -+ .free_space = free_space_node40, -+ .lookup = lookup_node40, -+ .num_of_items = num_of_items_node40, -+ .item_by_coord = item_by_coord_node40, -+ .length_by_coord = length_by_coord_node40, -+ .plugin_by_coord = plugin_by_coord_node40, -+ .key_at = key_at_node40, -+ .estimate = estimate_node40, -+ .check = check_node40, -+ .parse = parse_node40, -+ .init = init_node40, -+#ifdef GUESS_EXISTS -+ .guess = guess_node40, -+#endif -+ .change_item_size = change_item_size_node40, -+ .create_item = create_item_node40, -+ .update_item_key = update_item_key_node40, -+ .cut_and_kill = kill_node40, -+ .cut = cut_node40, -+ .shift = shift_node40, -+ .shrink_item = shrink_item_node40, -+ .fast_insert = fast_insert_node40, -+ .fast_paste = fast_paste_node40, -+ .fast_cut = fast_cut_node40, -+ .max_item_size = max_item_size_node40, -+ .prepare_removal = prepare_removal_node40, -+ .set_item_plugin = set_item_plugin_node40 -+ } -+}; -+ -+/* -+ Local variables: -+ c-indentation-style: "K&R" -+ mode-name: "LC" -+ c-basic-offset: 8 -+ tab-width: 8 -+ fill-column: 120 -+ scroll-step: 1 -+ End: -+*/ -diff --git a/fs/reiser4/plugin/node/node.h b/fs/reiser4/plugin/node/node.h -new file mode 100644 -index 0000000..af0c641 ---- /dev/null -+++ b/fs/reiser4/plugin/node/node.h -@@ -0,0 +1,272 @@ -+/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ -+ -+/* We need a definition of the default node layout here. */ -+ -+/* Generally speaking, it is best to have free space in the middle of the -+ node so that two sets of things can grow towards it, and to have the -+ item bodies on the left so that the last one of them grows into free -+ space. We optimize for the case where we append new items to the end -+ of the node, or grow the last item, because it hurts nothing to so -+ optimize and it is a common special case to do massive insertions in -+ increasing key order (and one of cases more likely to have a real user -+ notice the delay time for). -+ -+ formatted leaf default layout: (leaf1) -+ -+ |node header:item bodies:free space:key + pluginid + item offset| -+ -+ We grow towards the middle, optimizing layout for the case where we -+ append new items to the end of the node. The node header is fixed -+ length. Keys, and item offsets plus pluginids for the items -+ corresponding to them are in increasing key order, and are fixed -+ length. Item offsets are relative to start of node (16 bits creating -+ a node size limit of 64k, 12 bits might be a better choice....). Item -+ bodies are in decreasing key order. Item bodies have a variable size. -+ There is a one to one to one mapping of keys to item offsets to item -+ bodies. Item offsets consist of pointers to the zeroth byte of the -+ item body. Item length equals the start of the next item minus the -+ start of this item, except the zeroth item whose length equals the end -+ of the node minus the start of that item (plus a byte). In other -+ words, the item length is not recorded anywhere, and it does not need -+ to be since it is computable. -+ -+ Leaf variable length items and keys layout : (lvar) -+ -+ |node header:key offset + item offset + pluginid triplets:free space:key bodies:item bodies| -+ -+ We grow towards the middle, optimizing layout for the case where we -+ append new items to the end of the node. The node header is fixed -+ length. Keys and item offsets for the items corresponding to them are -+ in increasing key order, and keys are variable length. Item offsets -+ are relative to start of node (16 bits). Item bodies are in -+ decreasing key order. Item bodies have a variable size. There is a -+ one to one to one mapping of keys to item offsets to item bodies. -+ Item offsets consist of pointers to the zeroth byte of the item body. -+ Item length equals the start of the next item's key minus the start of -+ this item, except the zeroth item whose length equals the end of the -+ node minus the start of that item (plus a byte). -+ -+ leaf compressed keys layout: (lcomp) -+ -+ |node header:key offset + key inherit + item offset pairs:free space:key bodies:item bodies| -+ -+ We grow towards the middle, optimizing layout for the case where we -+ append new items to the end of the node. The node header is fixed -+ length. Keys and item offsets for the items corresponding to them are -+ in increasing key order, and keys are variable length. The "key -+ inherit" field indicates how much of the key prefix is identical to -+ the previous key (stem compression as described in "Managing -+ Gigabytes" is used). key_inherit is a one byte integer. The -+ intra-node searches performed through this layout are linear searches, -+ and this is theorized to not hurt performance much due to the high -+ cost of processor stalls on modern CPUs, and the small number of keys -+ in a single node. Item offsets are relative to start of node (16 -+ bits). Item bodies are in decreasing key order. Item bodies have a -+ variable size. There is a one to one to one mapping of keys to item -+ offsets to item bodies. Item offsets consist of pointers to the -+ zeroth byte of the item body. Item length equals the start of the -+ next item minus the start of this item, except the zeroth item whose -+ length equals the end of the node minus the start of that item (plus a -+ byte). In other words, item length and key length is not recorded -+ anywhere, and it does not need to be since it is computable. -+ -+ internal node default layout: (idef1) -+ -+ just like ldef1 except that item bodies are either blocknrs of -+ children or extents, and moving them may require updating parent -+ pointers in the nodes that they point to. -+*/ -+ -+/* There is an inherent 3-way tradeoff between optimizing and -+ exchanging disks between different architectures and code -+ complexity. This is optimal and simple and inexchangeable. -+ Someone else can do the code for exchanging disks and make it -+ complex. It would not be that hard. Using other than the PAGE_SIZE -+ might be suboptimal. -+*/ -+ -+#if !defined( __REISER4_NODE_H__ ) -+#define __REISER4_NODE_H__ -+ -+#define LEAF40_NODE_SIZE PAGE_CACHE_SIZE -+ -+#include "../../dformat.h" -+#include "../plugin_header.h" -+ -+#include -+ -+typedef enum { -+ NS_FOUND = 0, -+ NS_NOT_FOUND = -ENOENT -+} node_search_result; -+ -+/* Maximal possible space overhead for creation of new item in a node */ -+#define REISER4_NODE_MAX_OVERHEAD ( sizeof( reiser4_key ) + 32 ) -+ -+typedef enum { -+ REISER4_NODE_DKEYS = (1 << 0), -+ REISER4_NODE_TREE_STABLE = (1 << 1) -+} reiser4_node_check_flag; -+ -+/* cut and cut_and_kill have too long list of parameters. This structure is just to safe some space on stack */ -+struct cut_list { -+ coord_t *from; -+ coord_t *to; -+ const reiser4_key *from_key; -+ const reiser4_key *to_key; -+ reiser4_key *smallest_removed; -+ carry_plugin_info *info; -+ __u32 flags; -+ struct inode *inode; /* this is to pass list of eflushed jnodes down to extent_kill_hook */ -+ lock_handle *left; -+ lock_handle *right; -+}; -+ -+struct carry_cut_data; -+struct carry_kill_data; -+ -+/* The responsibility of the node plugin is to store and give access -+ to the sequence of items within the node. */ -+typedef struct node_plugin { -+ /* generic plugin fields */ -+ plugin_header h; -+ -+ /* calculates the amount of space that will be required to store an -+ item which is in addition to the space consumed by the item body. -+ (the space consumed by the item body can be gotten by calling -+ item->estimate) */ -+ size_t(*item_overhead) (const znode * node, flow_t * f); -+ -+ /* returns free space by looking into node (i.e., without using -+ znode->free_space). */ -+ size_t(*free_space) (znode * node); -+ /* search within the node for the one item which might -+ contain the key, invoking item->search_within to search within -+ that item to see if it is in there */ -+ node_search_result(*lookup) (znode * node, const reiser4_key * key, -+ lookup_bias bias, coord_t * coord); -+ /* number of items in node */ -+ int (*num_of_items) (const znode * node); -+ -+ /* store information about item in @coord in @data */ -+ /* break into several node ops, don't add any more uses of this before doing so */ -+ /*int ( *item_at )( const coord_t *coord, reiser4_item_data *data ); */ -+ char *(*item_by_coord) (const coord_t * coord); -+ int (*length_by_coord) (const coord_t * coord); -+ item_plugin *(*plugin_by_coord) (const coord_t * coord); -+ -+ /* store item key in @key */ -+ reiser4_key *(*key_at) (const coord_t * coord, reiser4_key * key); -+ /* conservatively estimate whether unit of what size can fit -+ into node. This estimation should be performed without -+ actually looking into the node's content (free space is saved in -+ znode). */ -+ size_t(*estimate) (znode * node); -+ -+ /* performs every consistency check the node plugin author could -+ imagine. Optional. */ -+ int (*check) (const znode * node, __u32 flags, const char **error); -+ -+ /* Called when node is read into memory and node plugin is -+ already detected. This should read some data into znode (like free -+ space counter) and, optionally, check data consistency. -+ */ -+ int (*parse) (znode * node); -+ /* This method is called on a new node to initialise plugin specific -+ data (header, etc.) */ -+ int (*init) (znode * node); -+ /* Check whether @node content conforms to this plugin format. -+ Probably only useful after support for old V3.x formats is added. -+ Uncomment after 4.0 only. -+ */ -+ /* int ( *guess )( const znode *node ); */ -+#if REISER4_DEBUG -+ void (*print) (const char *prefix, const znode * node, __u32 flags); -+#endif -+ /* change size of @item by @by bytes. @item->node has enough free -+ space. When @by > 0 - free space is appended to end of item. When -+ @by < 0 - item is truncated - it is assumed that last @by bytes if -+ the item are freed already */ -+ void (*change_item_size) (coord_t * item, int by); -+ -+ /* create new item @length bytes long in coord @target */ -+ int (*create_item) (coord_t * target, const reiser4_key * key, -+ reiser4_item_data * data, carry_plugin_info * info); -+ -+ /* update key of item. */ -+ void (*update_item_key) (coord_t * target, const reiser4_key * key, -+ carry_plugin_info * info); -+ -+ int (*cut_and_kill) (struct carry_kill_data *, carry_plugin_info *); -+ int (*cut) (struct carry_cut_data *, carry_plugin_info *); -+ -+ /* -+ * shrink item pointed to by @coord by @delta bytes. -+ */ -+ int (*shrink_item) (coord_t * coord, int delta); -+ -+ /* copy as much as possible but not more than up to @stop from -+ @stop->node to @target. If (pend == append) then data from beginning of -+ @stop->node are copied to the end of @target. If (pend == prepend) then -+ data from the end of @stop->node are copied to the beginning of -+ @target. Copied data are removed from @stop->node. Information -+ about what to do on upper level is stored in @todo */ -+ int (*shift) (coord_t * stop, znode * target, shift_direction pend, -+ int delete_node, int including_insert_coord, -+ carry_plugin_info * info); -+ /* return true if this node allows skip carry() in some situations -+ (see fs/reiser4/tree.c:insert_by_coord()). Reiser3.x format -+ emulation doesn't. -+ -+ This will speedup insertions that doesn't require updates to the -+ parent, by bypassing initialisation of carry() structures. It's -+ believed that majority of insertions will fit there. -+ -+ */ -+ int (*fast_insert) (const coord_t * coord); -+ int (*fast_paste) (const coord_t * coord); -+ int (*fast_cut) (const coord_t * coord); -+ /* this limits max size of item which can be inserted into a node and -+ number of bytes item in a node may be appended with */ -+ int (*max_item_size) (void); -+ int (*prepare_removal) (znode * empty, carry_plugin_info * info); -+ /* change plugin id of items which are in a node already. Currently it is Used in tail conversion for regular -+ * files */ -+ int (*set_item_plugin) (coord_t * coord, item_id); -+} node_plugin; -+ -+typedef enum { -+ /* standard unified node layout used for both leaf and internal -+ nodes */ -+ NODE40_ID, -+ LAST_NODE_ID -+} reiser4_node_id; -+ -+extern reiser4_key *leftmost_key_in_node(const znode * node, reiser4_key * key); -+#if REISER4_DEBUG -+extern void print_node_content(const char *prefix, const znode * node, -+ __u32 flags); -+#endif -+ -+extern void indent_znode(const znode * node); -+ -+typedef struct common_node_header { -+ /* -+ * identifier of node plugin. Must be located at the very beginning of -+ * a node. -+ */ -+ __le16 plugin_id; -+} common_node_header; -+ -+/* __REISER4_NODE_H__ */ -+#endif -+/* -+ * Local variables: -+ * c-indentation-style: "K&R" -+ * mode-name: "LC" -+ * c-basic-offset: 8 -+ * tab-width: 8 -+ * fill-column: 79 -+ * scroll-step: 1 -+ * End: -+ */ -diff --git a/fs/reiser4/plugin/node/node40.c b/fs/reiser4/plugin/node/node40.c -new file mode 100644 -index 0000000..6a9cc73 ---- /dev/null -+++ b/fs/reiser4/plugin/node/node40.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/node/node40.c linux-2.6.20/fs/reiser4/plugin/node/node40.c +--- linux-2.6.20.orig/fs/reiser4/plugin/node/node40.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/node/node40.c 2007-05-06 14:50:43.831016969 +0400 @@ -0,0 +1,2924 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -58982,11 +58027,9 @@ index 0000000..6a9cc73 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/node/node40.h b/fs/reiser4/plugin/node/node40.h -new file mode 100644 -index 0000000..8ae375b ---- /dev/null -+++ b/fs/reiser4/plugin/node/node40.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/node/node40.h linux-2.6.20/fs/reiser4/plugin/node/node40.h +--- linux-2.6.20.orig/fs/reiser4/plugin/node/node40.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/node/node40.h 2007-05-06 14:50:43.835018219 +0400 @@ -0,0 +1,125 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -59113,11 +58156,420 @@ index 0000000..8ae375b + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/object.c b/fs/reiser4/plugin/object.c -new file mode 100644 -index 0000000..ae999e3 ---- /dev/null -+++ b/fs/reiser4/plugin/object.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/node/node.c linux-2.6.20/fs/reiser4/plugin/node/node.c +--- linux-2.6.20.orig/fs/reiser4/plugin/node/node.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/node/node.c 2007-05-06 14:50:43.835018219 +0400 +@@ -0,0 +1,131 @@ ++/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ ++ ++/* Node plugin interface. ++ ++ Description: The tree provides the abstraction of flows, which it ++ internally fragments into items which it stores in nodes. ++ ++ A key_atom is a piece of data bound to a single key. ++ ++ For reasonable space efficiency to be achieved it is often ++ necessary to store key_atoms in the nodes in the form of items, where ++ an item is a sequence of key_atoms of the same or similar type. It is ++ more space-efficient, because the item can implement (very) ++ efficient compression of key_atom's bodies using internal knowledge ++ about their semantics, and it can often avoid having a key for each ++ key_atom. Each type of item has specific operations implemented by its ++ item handler (see balance.c). ++ ++ Rationale: the rest of the code (specifically balancing routines) ++ accesses leaf level nodes through this interface. This way we can ++ implement various block layouts and even combine various layouts ++ within the same tree. Balancing/allocating algorithms should not ++ care about peculiarities of splitting/merging specific item types, ++ but rather should leave that to the item's item handler. ++ ++ Items, including those that provide the abstraction of flows, have ++ the property that if you move them in part or in whole to another ++ node, the balancing code invokes their is_left_mergeable() ++ item_operation to determine if they are mergeable with their new ++ neighbor in the node you have moved them to. For some items the ++ is_left_mergeable() function always returns null. ++ ++ When moving the bodies of items from one node to another: ++ ++ if a partial item is shifted to another node the balancing code invokes ++ an item handler method to handle the item splitting. ++ ++ if the balancing code needs to merge with an item in the node it ++ is shifting to, it will invoke an item handler method to handle ++ the item merging. ++ ++ if it needs to move whole item bodies unchanged, the balancing code uses xmemcpy() ++ adjusting the item headers after the move is done using the node handler. ++*/ ++ ++#include "../../forward.h" ++#include "../../debug.h" ++#include "../../key.h" ++#include "../../coord.h" ++#include "../plugin_header.h" ++#include "../item/item.h" ++#include "node.h" ++#include "../plugin.h" ++#include "../../znode.h" ++#include "../../tree.h" ++#include "../../super.h" ++#include "../../reiser4.h" ++ ++/** ++ * leftmost_key_in_node - get the smallest key in node ++ * @node: ++ * @key: store result here ++ * ++ * Stores the leftmost key of @node in @key. ++ */ ++reiser4_key *leftmost_key_in_node(const znode *node, reiser4_key *key) ++{ ++ assert("nikita-1634", node != NULL); ++ assert("nikita-1635", key != NULL); ++ ++ if (!node_is_empty(node)) { ++ coord_t first_item; ++ ++ coord_init_first_unit(&first_item, (znode *) node); ++ item_key_by_coord(&first_item, key); ++ } else ++ *key = *reiser4_max_key(); ++ return key; ++} ++ ++node_plugin node_plugins[LAST_NODE_ID] = { ++ [NODE40_ID] = { ++ .h = { ++ .type_id = REISER4_NODE_PLUGIN_TYPE, ++ .id = NODE40_ID, ++ .pops = NULL, ++ .label = "unified", ++ .desc = "unified node layout", ++ .linkage = {NULL, NULL} ++ }, ++ .item_overhead = item_overhead_node40, ++ .free_space = free_space_node40, ++ .lookup = lookup_node40, ++ .num_of_items = num_of_items_node40, ++ .item_by_coord = item_by_coord_node40, ++ .length_by_coord = length_by_coord_node40, ++ .plugin_by_coord = plugin_by_coord_node40, ++ .key_at = key_at_node40, ++ .estimate = estimate_node40, ++ .check = check_node40, ++ .parse = parse_node40, ++ .init = init_node40, ++#ifdef GUESS_EXISTS ++ .guess = guess_node40, ++#endif ++ .change_item_size = change_item_size_node40, ++ .create_item = create_item_node40, ++ .update_item_key = update_item_key_node40, ++ .cut_and_kill = kill_node40, ++ .cut = cut_node40, ++ .shift = shift_node40, ++ .shrink_item = shrink_item_node40, ++ .fast_insert = fast_insert_node40, ++ .fast_paste = fast_paste_node40, ++ .fast_cut = fast_cut_node40, ++ .max_item_size = max_item_size_node40, ++ .prepare_removal = prepare_removal_node40, ++ .set_item_plugin = set_item_plugin_node40 ++ } ++}; ++ ++/* ++ Local variables: ++ c-indentation-style: "K&R" ++ mode-name: "LC" ++ c-basic-offset: 8 ++ tab-width: 8 ++ fill-column: 120 ++ scroll-step: 1 ++ End: ++*/ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/node/node.h linux-2.6.20/fs/reiser4/plugin/node/node.h +--- linux-2.6.20.orig/fs/reiser4/plugin/node/node.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/node/node.h 2007-05-06 14:50:43.835018219 +0400 +@@ -0,0 +1,272 @@ ++/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ ++ ++/* We need a definition of the default node layout here. */ ++ ++/* Generally speaking, it is best to have free space in the middle of the ++ node so that two sets of things can grow towards it, and to have the ++ item bodies on the left so that the last one of them grows into free ++ space. We optimize for the case where we append new items to the end ++ of the node, or grow the last item, because it hurts nothing to so ++ optimize and it is a common special case to do massive insertions in ++ increasing key order (and one of cases more likely to have a real user ++ notice the delay time for). ++ ++ formatted leaf default layout: (leaf1) ++ ++ |node header:item bodies:free space:key + pluginid + item offset| ++ ++ We grow towards the middle, optimizing layout for the case where we ++ append new items to the end of the node. The node header is fixed ++ length. Keys, and item offsets plus pluginids for the items ++ corresponding to them are in increasing key order, and are fixed ++ length. Item offsets are relative to start of node (16 bits creating ++ a node size limit of 64k, 12 bits might be a better choice....). Item ++ bodies are in decreasing key order. Item bodies have a variable size. ++ There is a one to one to one mapping of keys to item offsets to item ++ bodies. Item offsets consist of pointers to the zeroth byte of the ++ item body. Item length equals the start of the next item minus the ++ start of this item, except the zeroth item whose length equals the end ++ of the node minus the start of that item (plus a byte). In other ++ words, the item length is not recorded anywhere, and it does not need ++ to be since it is computable. ++ ++ Leaf variable length items and keys layout : (lvar) ++ ++ |node header:key offset + item offset + pluginid triplets:free space:key bodies:item bodies| ++ ++ We grow towards the middle, optimizing layout for the case where we ++ append new items to the end of the node. The node header is fixed ++ length. Keys and item offsets for the items corresponding to them are ++ in increasing key order, and keys are variable length. Item offsets ++ are relative to start of node (16 bits). Item bodies are in ++ decreasing key order. Item bodies have a variable size. There is a ++ one to one to one mapping of keys to item offsets to item bodies. ++ Item offsets consist of pointers to the zeroth byte of the item body. ++ Item length equals the start of the next item's key minus the start of ++ this item, except the zeroth item whose length equals the end of the ++ node minus the start of that item (plus a byte). ++ ++ leaf compressed keys layout: (lcomp) ++ ++ |node header:key offset + key inherit + item offset pairs:free space:key bodies:item bodies| ++ ++ We grow towards the middle, optimizing layout for the case where we ++ append new items to the end of the node. The node header is fixed ++ length. Keys and item offsets for the items corresponding to them are ++ in increasing key order, and keys are variable length. The "key ++ inherit" field indicates how much of the key prefix is identical to ++ the previous key (stem compression as described in "Managing ++ Gigabytes" is used). key_inherit is a one byte integer. The ++ intra-node searches performed through this layout are linear searches, ++ and this is theorized to not hurt performance much due to the high ++ cost of processor stalls on modern CPUs, and the small number of keys ++ in a single node. Item offsets are relative to start of node (16 ++ bits). Item bodies are in decreasing key order. Item bodies have a ++ variable size. There is a one to one to one mapping of keys to item ++ offsets to item bodies. Item offsets consist of pointers to the ++ zeroth byte of the item body. Item length equals the start of the ++ next item minus the start of this item, except the zeroth item whose ++ length equals the end of the node minus the start of that item (plus a ++ byte). In other words, item length and key length is not recorded ++ anywhere, and it does not need to be since it is computable. ++ ++ internal node default layout: (idef1) ++ ++ just like ldef1 except that item bodies are either blocknrs of ++ children or extents, and moving them may require updating parent ++ pointers in the nodes that they point to. ++*/ ++ ++/* There is an inherent 3-way tradeoff between optimizing and ++ exchanging disks between different architectures and code ++ complexity. This is optimal and simple and inexchangeable. ++ Someone else can do the code for exchanging disks and make it ++ complex. It would not be that hard. Using other than the PAGE_SIZE ++ might be suboptimal. ++*/ ++ ++#if !defined( __REISER4_NODE_H__ ) ++#define __REISER4_NODE_H__ ++ ++#define LEAF40_NODE_SIZE PAGE_CACHE_SIZE ++ ++#include "../../dformat.h" ++#include "../plugin_header.h" ++ ++#include ++ ++typedef enum { ++ NS_FOUND = 0, ++ NS_NOT_FOUND = -ENOENT ++} node_search_result; ++ ++/* Maximal possible space overhead for creation of new item in a node */ ++#define REISER4_NODE_MAX_OVERHEAD ( sizeof( reiser4_key ) + 32 ) ++ ++typedef enum { ++ REISER4_NODE_DKEYS = (1 << 0), ++ REISER4_NODE_TREE_STABLE = (1 << 1) ++} reiser4_node_check_flag; ++ ++/* cut and cut_and_kill have too long list of parameters. This structure is just to safe some space on stack */ ++struct cut_list { ++ coord_t *from; ++ coord_t *to; ++ const reiser4_key *from_key; ++ const reiser4_key *to_key; ++ reiser4_key *smallest_removed; ++ carry_plugin_info *info; ++ __u32 flags; ++ struct inode *inode; /* this is to pass list of eflushed jnodes down to extent_kill_hook */ ++ lock_handle *left; ++ lock_handle *right; ++}; ++ ++struct carry_cut_data; ++struct carry_kill_data; ++ ++/* The responsibility of the node plugin is to store and give access ++ to the sequence of items within the node. */ ++typedef struct node_plugin { ++ /* generic plugin fields */ ++ plugin_header h; ++ ++ /* calculates the amount of space that will be required to store an ++ item which is in addition to the space consumed by the item body. ++ (the space consumed by the item body can be gotten by calling ++ item->estimate) */ ++ size_t(*item_overhead) (const znode * node, flow_t * f); ++ ++ /* returns free space by looking into node (i.e., without using ++ znode->free_space). */ ++ size_t(*free_space) (znode * node); ++ /* search within the node for the one item which might ++ contain the key, invoking item->search_within to search within ++ that item to see if it is in there */ ++ node_search_result(*lookup) (znode * node, const reiser4_key * key, ++ lookup_bias bias, coord_t * coord); ++ /* number of items in node */ ++ int (*num_of_items) (const znode * node); ++ ++ /* store information about item in @coord in @data */ ++ /* break into several node ops, don't add any more uses of this before doing so */ ++ /*int ( *item_at )( const coord_t *coord, reiser4_item_data *data ); */ ++ char *(*item_by_coord) (const coord_t * coord); ++ int (*length_by_coord) (const coord_t * coord); ++ item_plugin *(*plugin_by_coord) (const coord_t * coord); ++ ++ /* store item key in @key */ ++ reiser4_key *(*key_at) (const coord_t * coord, reiser4_key * key); ++ /* conservatively estimate whether unit of what size can fit ++ into node. This estimation should be performed without ++ actually looking into the node's content (free space is saved in ++ znode). */ ++ size_t(*estimate) (znode * node); ++ ++ /* performs every consistency check the node plugin author could ++ imagine. Optional. */ ++ int (*check) (const znode * node, __u32 flags, const char **error); ++ ++ /* Called when node is read into memory and node plugin is ++ already detected. This should read some data into znode (like free ++ space counter) and, optionally, check data consistency. ++ */ ++ int (*parse) (znode * node); ++ /* This method is called on a new node to initialise plugin specific ++ data (header, etc.) */ ++ int (*init) (znode * node); ++ /* Check whether @node content conforms to this plugin format. ++ Probably only useful after support for old V3.x formats is added. ++ Uncomment after 4.0 only. ++ */ ++ /* int ( *guess )( const znode *node ); */ ++#if REISER4_DEBUG ++ void (*print) (const char *prefix, const znode * node, __u32 flags); ++#endif ++ /* change size of @item by @by bytes. @item->node has enough free ++ space. When @by > 0 - free space is appended to end of item. When ++ @by < 0 - item is truncated - it is assumed that last @by bytes if ++ the item are freed already */ ++ void (*change_item_size) (coord_t * item, int by); ++ ++ /* create new item @length bytes long in coord @target */ ++ int (*create_item) (coord_t * target, const reiser4_key * key, ++ reiser4_item_data * data, carry_plugin_info * info); ++ ++ /* update key of item. */ ++ void (*update_item_key) (coord_t * target, const reiser4_key * key, ++ carry_plugin_info * info); ++ ++ int (*cut_and_kill) (struct carry_kill_data *, carry_plugin_info *); ++ int (*cut) (struct carry_cut_data *, carry_plugin_info *); ++ ++ /* ++ * shrink item pointed to by @coord by @delta bytes. ++ */ ++ int (*shrink_item) (coord_t * coord, int delta); ++ ++ /* copy as much as possible but not more than up to @stop from ++ @stop->node to @target. If (pend == append) then data from beginning of ++ @stop->node are copied to the end of @target. If (pend == prepend) then ++ data from the end of @stop->node are copied to the beginning of ++ @target. Copied data are removed from @stop->node. Information ++ about what to do on upper level is stored in @todo */ ++ int (*shift) (coord_t * stop, znode * target, shift_direction pend, ++ int delete_node, int including_insert_coord, ++ carry_plugin_info * info); ++ /* return true if this node allows skip carry() in some situations ++ (see fs/reiser4/tree.c:insert_by_coord()). Reiser3.x format ++ emulation doesn't. ++ ++ This will speedup insertions that doesn't require updates to the ++ parent, by bypassing initialisation of carry() structures. It's ++ believed that majority of insertions will fit there. ++ ++ */ ++ int (*fast_insert) (const coord_t * coord); ++ int (*fast_paste) (const coord_t * coord); ++ int (*fast_cut) (const coord_t * coord); ++ /* this limits max size of item which can be inserted into a node and ++ number of bytes item in a node may be appended with */ ++ int (*max_item_size) (void); ++ int (*prepare_removal) (znode * empty, carry_plugin_info * info); ++ /* change plugin id of items which are in a node already. Currently it is Used in tail conversion for regular ++ * files */ ++ int (*set_item_plugin) (coord_t * coord, item_id); ++} node_plugin; ++ ++typedef enum { ++ /* standard unified node layout used for both leaf and internal ++ nodes */ ++ NODE40_ID, ++ LAST_NODE_ID ++} reiser4_node_id; ++ ++extern reiser4_key *leftmost_key_in_node(const znode * node, reiser4_key * key); ++#if REISER4_DEBUG ++extern void print_node_content(const char *prefix, const znode * node, ++ __u32 flags); ++#endif ++ ++extern void indent_znode(const znode * node); ++ ++typedef struct common_node_header { ++ /* ++ * identifier of node plugin. Must be located at the very beginning of ++ * a node. ++ */ ++ __le16 plugin_id; ++} common_node_header; ++ ++/* __REISER4_NODE_H__ */ ++#endif ++/* ++ * Local variables: ++ * c-indentation-style: "K&R" ++ * mode-name: "LC" ++ * c-basic-offset: 8 ++ * tab-width: 8 ++ * fill-column: 79 ++ * scroll-step: 1 ++ * End: ++ */ +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/object.c linux-2.6.20/fs/reiser4/plugin/object.c +--- linux-2.6.20.orig/fs/reiser4/plugin/object.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/object.c 2007-05-06 14:50:43.835018219 +0400 @@ -0,0 +1,516 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -59635,11 +59087,9 @@ index 0000000..ae999e3 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/object.h b/fs/reiser4/plugin/object.h -new file mode 100644 -index 0000000..440c369 ---- /dev/null -+++ b/fs/reiser4/plugin/object.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/object.h linux-2.6.20/fs/reiser4/plugin/object.h +--- linux-2.6.20.orig/fs/reiser4/plugin/object.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/object.h 2007-05-06 14:50:43.839019469 +0400 @@ -0,0 +1,121 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -59762,11 +59212,9 @@ index 0000000..440c369 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/plugin.c b/fs/reiser4/plugin/plugin.c -new file mode 100644 -index 0000000..8261878 ---- /dev/null -+++ b/fs/reiser4/plugin/plugin.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/plugin.c linux-2.6.20/fs/reiser4/plugin/plugin.c +--- linux-2.6.20.orig/fs/reiser4/plugin/plugin.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/plugin.c 2007-05-06 14:50:43.839019469 +0400 @@ -0,0 +1,578 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -60346,11 +59794,9 @@ index 0000000..8261878 + * fill-column: 120 + * End: + */ -diff --git a/fs/reiser4/plugin/plugin.h b/fs/reiser4/plugin/plugin.h -new file mode 100644 -index 0000000..a1d1097 ---- /dev/null -+++ b/fs/reiser4/plugin/plugin.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/plugin.h linux-2.6.20/fs/reiser4/plugin/plugin.h +--- linux-2.6.20.orig/fs/reiser4/plugin/plugin.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/plugin.h 2007-05-06 14:50:43.855024468 +0400 @@ -0,0 +1,920 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -61272,11 +60718,9 @@ index 0000000..a1d1097 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/plugin_header.h b/fs/reiser4/plugin/plugin_header.h -new file mode 100644 -index 0000000..68cf5b0 ---- /dev/null -+++ b/fs/reiser4/plugin/plugin_header.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/plugin_header.h linux-2.6.20/fs/reiser4/plugin/plugin_header.h +--- linux-2.6.20.orig/fs/reiser4/plugin/plugin_header.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/plugin_header.h 2007-05-06 14:50:43.855024468 +0400 @@ -0,0 +1,144 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -61422,11 +60866,9 @@ index 0000000..68cf5b0 + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/plugin/plugin_set.c b/fs/reiser4/plugin/plugin_set.c -new file mode 100644 -index 0000000..528632d ---- /dev/null -+++ b/fs/reiser4/plugin/plugin_set.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/plugin_set.c linux-2.6.20/fs/reiser4/plugin/plugin_set.c +--- linux-2.6.20.orig/fs/reiser4/plugin/plugin_set.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/plugin_set.c 2007-05-06 14:50:43.855024468 +0400 @@ -0,0 +1,379 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -61807,11 +61249,9 @@ index 0000000..528632d + * fill-column: 120 + * End: + */ -diff --git a/fs/reiser4/plugin/plugin_set.h b/fs/reiser4/plugin/plugin_set.h -new file mode 100644 -index 0000000..8edcaea ---- /dev/null -+++ b/fs/reiser4/plugin/plugin_set.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/plugin_set.h linux-2.6.20/fs/reiser4/plugin/plugin_set.h +--- linux-2.6.20.orig/fs/reiser4/plugin/plugin_set.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/plugin_set.h 2007-05-06 14:50:43.855024468 +0400 @@ -0,0 +1,77 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -61890,21 +61330,17 @@ index 0000000..8edcaea + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/security/Makefile b/fs/reiser4/plugin/security/Makefile -new file mode 100644 -index 0000000..645dbb5 ---- /dev/null -+++ b/fs/reiser4/plugin/security/Makefile +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/security/Makefile linux-2.6.20/fs/reiser4/plugin/security/Makefile +--- linux-2.6.20.orig/fs/reiser4/plugin/security/Makefile 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/security/Makefile 2007-05-06 14:50:43.855024468 +0400 @@ -0,0 +1,4 @@ +obj-$(CONFIG_REISER4_FS) += security_plugins.o + +security_plugins-objs := \ + perm.o -diff --git a/fs/reiser4/plugin/security/perm.c b/fs/reiser4/plugin/security/perm.c -new file mode 100644 -index 0000000..ab3b4fc ---- /dev/null -+++ b/fs/reiser4/plugin/security/perm.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/security/perm.c linux-2.6.20/fs/reiser4/plugin/security/perm.c +--- linux-2.6.20.orig/fs/reiser4/plugin/security/perm.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/security/perm.c 2007-05-06 14:50:43.859025718 +0400 @@ -0,0 +1,44 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -61950,11 +61386,9 @@ index 0000000..ab3b4fc + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/plugin/security/perm.h b/fs/reiser4/plugin/security/perm.h -new file mode 100644 -index 0000000..747e8f7 ---- /dev/null -+++ b/fs/reiser4/plugin/security/perm.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/security/perm.h linux-2.6.20/fs/reiser4/plugin/security/perm.h +--- linux-2.6.20.orig/fs/reiser4/plugin/security/perm.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/security/perm.h 2007-05-06 14:50:43.859025718 +0400 @@ -0,0 +1,82 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -62038,21 +61472,9 @@ index 0000000..747e8f7 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/plugin/space/Makefile b/fs/reiser4/plugin/space/Makefile -new file mode 100644 -index 0000000..5a0c94f ---- /dev/null -+++ b/fs/reiser4/plugin/space/Makefile -@@ -0,0 +1,4 @@ -+obj-$(CONFIG_REISER4_FS) += space_plugins.o -+ -+space_plugins-objs := \ -+ bitmap.o -diff --git a/fs/reiser4/plugin/space/bitmap.c b/fs/reiser4/plugin/space/bitmap.c -new file mode 100644 -index 0000000..a0ff17a ---- /dev/null -+++ b/fs/reiser4/plugin/space/bitmap.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/space/bitmap.c linux-2.6.20/fs/reiser4/plugin/space/bitmap.c +--- linux-2.6.20.orig/fs/reiser4/plugin/space/bitmap.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/space/bitmap.c 2007-05-06 14:50:43.859025718 +0400 @@ -0,0 +1,1585 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -63639,11 +63061,9 @@ index 0000000..a0ff17a + * scroll-step: 1 + * End: + */ -diff --git a/fs/reiser4/plugin/space/bitmap.h b/fs/reiser4/plugin/space/bitmap.h -new file mode 100644 -index 0000000..be867f1 ---- /dev/null -+++ b/fs/reiser4/plugin/space/bitmap.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/space/bitmap.h linux-2.6.20/fs/reiser4/plugin/space/bitmap.h +--- linux-2.6.20.orig/fs/reiser4/plugin/space/bitmap.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/space/bitmap.h 2007-05-06 14:50:43.863026968 +0400 @@ -0,0 +1,47 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -63692,11 +63112,17 @@ index 0000000..be867f1 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/space/space_allocator.h b/fs/reiser4/plugin/space/space_allocator.h -new file mode 100644 -index 0000000..5bfa9a3 ---- /dev/null -+++ b/fs/reiser4/plugin/space/space_allocator.h +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/space/Makefile linux-2.6.20/fs/reiser4/plugin/space/Makefile +--- linux-2.6.20.orig/fs/reiser4/plugin/space/Makefile 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/space/Makefile 2007-05-06 14:50:43.863026968 +0400 +@@ -0,0 +1,4 @@ ++obj-$(CONFIG_REISER4_FS) += space_plugins.o ++ ++space_plugins-objs := \ ++ bitmap.o +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/space/space_allocator.h linux-2.6.20/fs/reiser4/plugin/space/space_allocator.h +--- linux-2.6.20.orig/fs/reiser4/plugin/space/space_allocator.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/space/space_allocator.h 2007-05-06 14:50:43.863026968 +0400 @@ -0,0 +1,80 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -63778,11 +63204,9 @@ index 0000000..5bfa9a3 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/plugin/tail_policy.c b/fs/reiser4/plugin/tail_policy.c -new file mode 100644 -index 0000000..43f4ae7 ---- /dev/null -+++ b/fs/reiser4/plugin/tail_policy.c +diff -urN linux-2.6.20.orig/fs/reiser4/plugin/tail_policy.c linux-2.6.20/fs/reiser4/plugin/tail_policy.c +--- linux-2.6.20.orig/fs/reiser4/plugin/tail_policy.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/plugin/tail_policy.c 2007-05-06 14:50:43.863026968 +0400 @@ -0,0 +1,113 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -63897,11 +63321,9 @@ index 0000000..43f4ae7 + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/pool.c b/fs/reiser4/pool.c -new file mode 100644 -index 0000000..f4303da ---- /dev/null -+++ b/fs/reiser4/pool.c +diff -urN linux-2.6.20.orig/fs/reiser4/pool.c linux-2.6.20/fs/reiser4/pool.c +--- linux-2.6.20.orig/fs/reiser4/pool.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/pool.c 2007-05-06 14:50:43.863026968 +0400 @@ -0,0 +1,234 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -64137,11 +63559,9 @@ index 0000000..f4303da + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/pool.h b/fs/reiser4/pool.h -new file mode 100644 -index 0000000..174d3c6 ---- /dev/null -+++ b/fs/reiser4/pool.h +diff -urN linux-2.6.20.orig/fs/reiser4/pool.h linux-2.6.20/fs/reiser4/pool.h +--- linux-2.6.20.orig/fs/reiser4/pool.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/pool.h 2007-05-06 14:50:43.863026968 +0400 @@ -0,0 +1,55 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -64198,11 +63618,9 @@ index 0000000..174d3c6 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/readahead.c b/fs/reiser4/readahead.c -new file mode 100644 -index 0000000..8e5a9f1 ---- /dev/null -+++ b/fs/reiser4/readahead.c +diff -urN linux-2.6.20.orig/fs/reiser4/readahead.c linux-2.6.20/fs/reiser4/readahead.c +--- linux-2.6.20.orig/fs/reiser4/readahead.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/readahead.c 2007-05-06 14:50:43.867028218 +0400 @@ -0,0 +1,138 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -64342,11 +63760,9 @@ index 0000000..8e5a9f1 + fill-column: 80 + End: +*/ -diff --git a/fs/reiser4/readahead.h b/fs/reiser4/readahead.h -new file mode 100644 -index 0000000..524c574 ---- /dev/null -+++ b/fs/reiser4/readahead.h +diff -urN linux-2.6.20.orig/fs/reiser4/readahead.h linux-2.6.20/fs/reiser4/readahead.h +--- linux-2.6.20.orig/fs/reiser4/readahead.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/readahead.h 2007-05-06 14:50:43.867028218 +0400 @@ -0,0 +1,48 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -64396,11 +63812,138 @@ index 0000000..524c574 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/reiser4.h b/fs/reiser4/reiser4.h -new file mode 100644 -index 0000000..77d720e ---- /dev/null -+++ b/fs/reiser4/reiser4.h +diff -urN linux-2.6.20.orig/fs/reiser4/README linux-2.6.20/fs/reiser4/README +--- linux-2.6.20.orig/fs/reiser4/README 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/README 2007-05-06 14:50:43.867028218 +0400 +@@ -0,0 +1,125 @@ ++[LICENSING] ++ ++Reiser4 is hereby licensed under the GNU General ++Public License version 2. ++ ++Source code files that contain the phrase "licensing governed by ++reiser4/README" are "governed files" throughout this file. Governed ++files are licensed under the GPL. The portions of them owned by Hans ++Reiser, or authorized to be licensed by him, have been in the past, ++and likely will be in the future, licensed to other parties under ++other licenses. If you add your code to governed files, and don't ++want it to be owned by Hans Reiser, put your copyright label on that ++code so the poor blight and his customers can keep things straight. ++All portions of governed files not labeled otherwise are owned by Hans ++Reiser, and by adding your code to it, widely distributing it to ++others or sending us a patch, and leaving the sentence in stating that ++licensing is governed by the statement in this file, you accept this. ++It will be a kindness if you identify whether Hans Reiser is allowed ++to license code labeled as owned by you on your behalf other than ++under the GPL, because he wants to know if it is okay to do so and put ++a check in the mail to you (for non-trivial improvements) when he ++makes his next sale. He makes no guarantees as to the amount if any, ++though he feels motivated to motivate contributors, and you can surely ++discuss this with him before or after contributing. You have the ++right to decline to allow him to license your code contribution other ++than under the GPL. ++ ++Further licensing options are available for commercial and/or other ++interests directly from Hans Reiser: reiser@namesys.com. If you interpret ++the GPL as not allowing those additional licensing options, you read ++it wrongly, and Richard Stallman agrees with me, when carefully read ++you can see that those restrictions on additional terms do not apply ++to the owner of the copyright, and my interpretation of this shall ++govern for this license. ++ ++[END LICENSING] ++ ++Reiser4 is a file system based on dancing tree algorithms, and is ++described at http://www.namesys.com ++ ++mkfs.reiser4 and other utilities are on our webpage or wherever your ++Linux provider put them. You really want to be running the latest ++version off the website if you use fsck. ++ ++Yes, if you update your reiser4 kernel module you do have to ++recompile your kernel, most of the time. The errors you get will be ++quite cryptic if your forget to do so. ++ ++Hideous Commercial Pitch: Spread your development costs across other OS ++vendors. Select from the best in the world, not the best in your ++building, by buying from third party OS component suppliers. Leverage ++the software component development power of the internet. Be the most ++aggressive in taking advantage of the commercial possibilities of ++decentralized internet development, and add value through your branded ++integration that you sell as an operating system. Let your competitors ++be the ones to compete against the entire internet by themselves. Be ++hip, get with the new economic trend, before your competitors do. Send ++email to reiser@namesys.com ++ ++Hans Reiser was the primary architect of Reiser4, but a whole team ++chipped their ideas in. He invested everything he had into Namesys ++for 5.5 dark years of no money before Reiser3 finally started to work well ++enough to bring in money. He owns the copyright. ++ ++DARPA was the primary sponsor of Reiser4. DARPA does not endorse ++Reiser4, it merely sponsors it. DARPA is, in solely Hans's personal ++opinion, unique in its willingness to invest into things more ++theoretical than the VC community can readily understand, and more ++longterm than allows them to be sure that they will be the ones to ++extract the economic benefits from. DARPA also integrated us into a ++security community that transformed our security worldview. ++ ++Vladimir Saveliev is our lead programmer, with us from the beginning, ++and he worked long hours writing the cleanest code. This is why he is ++now the lead programmer after years of commitment to our work. He ++always made the effort to be the best he could be, and to make his ++code the best that it could be. What resulted was quite remarkable. I ++don't think that money can ever motivate someone to work the way he ++did, he is one of the most selfless men I know. ++ ++Alexander Lyamin was our sysadmin, and helped to educate us in ++security issues. Moscow State University and IMT were very generous ++in the internet access they provided us, and in lots of other little ++ways that a generous institution can be. ++ ++Alexander Zarochentcev (sometimes known as zam, or sasha), wrote the ++locking code, the block allocator, and finished the flushing code. ++His code is always crystal clean and well structured. ++ ++Nikita Danilov wrote the core of the balancing code, the core of the ++plugins code, and the directory code. He worked a steady pace of long ++hours that produced a whole lot of well abstracted code. He is our ++senior computer scientist. ++ ++Vladimir Demidov wrote the parser. Writing an in kernel parser is ++something very few persons have the skills for, and it is thanks to ++him that we can say that the parser is really not so big compared to ++various bits of our other code, and making a parser work in the kernel ++was not so complicated as everyone would imagine mainly because it was ++him doing it... ++ ++Joshua McDonald wrote the transaction manager, and the flush code. ++The flush code unexpectedly turned out be extremely hairy for reasons ++you can read about on our web page, and he did a great job on an ++extremely difficult task. ++ ++Nina Reiser handled our accounting, government relations, and much ++more. ++ ++Ramon Reiser developed our website. ++ ++Beverly Palmer drew our graphics. ++ ++Vitaly Fertman developed librepair, userspace plugins repair code, fsck ++and worked with Umka on developing libreiser4 and userspace plugins. ++ ++Yury Umanets (aka Umka) developed libreiser4, userspace plugins and ++userspace tools (reiser4progs). ++ ++Oleg Drokin (aka Green) is the release manager who fixes everything. ++It is so nice to have someone like that on the team. He (plus Chris ++and Jeff) make it possible for the entire rest of the Namesys team to ++focus on Reiser4, and he fixed a whole lot of Reiser4 bugs also. It ++is just amazing to watch his talent for spotting bugs in action. ++ +diff -urN linux-2.6.20.orig/fs/reiser4/reiser4.h linux-2.6.20/fs/reiser4/reiser4.h +--- linux-2.6.20.orig/fs/reiser4/reiser4.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/reiser4.h 2007-05-06 14:50:43.867028218 +0400 @@ -0,0 +1,269 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -64671,11 +64214,9 @@ index 0000000..77d720e + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/safe_link.c b/fs/reiser4/safe_link.c -new file mode 100644 -index 0000000..1253bdb ---- /dev/null -+++ b/fs/reiser4/safe_link.c +diff -urN linux-2.6.20.orig/fs/reiser4/safe_link.c linux-2.6.20/fs/reiser4/safe_link.c +--- linux-2.6.20.orig/fs/reiser4/safe_link.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/safe_link.c 2007-05-06 14:50:43.867028218 +0400 @@ -0,0 +1,351 @@ +/* Copyright 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -65028,11 +64569,9 @@ index 0000000..1253bdb + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/safe_link.h b/fs/reiser4/safe_link.h -new file mode 100644 -index 0000000..7ae4458 ---- /dev/null -+++ b/fs/reiser4/safe_link.h +diff -urN linux-2.6.20.orig/fs/reiser4/safe_link.h linux-2.6.20/fs/reiser4/safe_link.h +--- linux-2.6.20.orig/fs/reiser4/safe_link.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/safe_link.h 2007-05-06 14:50:43.867028218 +0400 @@ -0,0 +1,29 @@ +/* Copyright 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -65063,11 +64602,9 @@ index 0000000..7ae4458 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/seal.c b/fs/reiser4/seal.c -new file mode 100644 -index 0000000..c91cf52 ---- /dev/null -+++ b/fs/reiser4/seal.c +diff -urN linux-2.6.20.orig/fs/reiser4/seal.c linux-2.6.20/fs/reiser4/seal.c +--- linux-2.6.20.orig/fs/reiser4/seal.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/seal.c 2007-05-06 14:50:43.871029467 +0400 @@ -0,0 +1,218 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ +/* Seals implementation. */ @@ -65287,11 +64824,9 @@ index 0000000..c91cf52 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/seal.h b/fs/reiser4/seal.h -new file mode 100644 -index 0000000..5c3c5e0 ---- /dev/null -+++ b/fs/reiser4/seal.h +diff -urN linux-2.6.20.orig/fs/reiser4/seal.h linux-2.6.20/fs/reiser4/seal.h +--- linux-2.6.20.orig/fs/reiser4/seal.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/seal.h 2007-05-06 14:50:43.871029467 +0400 @@ -0,0 +1,49 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -65342,11 +64877,9 @@ index 0000000..5c3c5e0 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/search.c b/fs/reiser4/search.c -new file mode 100644 -index 0000000..9d35e11 ---- /dev/null -+++ b/fs/reiser4/search.c +diff -urN linux-2.6.20.orig/fs/reiser4/search.c linux-2.6.20/fs/reiser4/search.c +--- linux-2.6.20.orig/fs/reiser4/search.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/search.c 2007-05-06 14:50:43.871029467 +0400 @@ -0,0 +1,1611 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -66959,11 +66492,9 @@ index 0000000..9d35e11 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/status_flags.c b/fs/reiser4/status_flags.c -new file mode 100644 -index 0000000..b32f89a ---- /dev/null -+++ b/fs/reiser4/status_flags.c +diff -urN linux-2.6.20.orig/fs/reiser4/status_flags.c linux-2.6.20/fs/reiser4/status_flags.c +--- linux-2.6.20.orig/fs/reiser4/status_flags.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/status_flags.c 2007-05-06 14:50:43.875030717 +0400 @@ -0,0 +1,175 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -67140,11 +66671,9 @@ index 0000000..b32f89a + get_super_private(sb)->status_bio = NULL; + return 0; +} -diff --git a/fs/reiser4/status_flags.h b/fs/reiser4/status_flags.h -new file mode 100644 -index 0000000..6cfa5ad ---- /dev/null -+++ b/fs/reiser4/status_flags.h +diff -urN linux-2.6.20.orig/fs/reiser4/status_flags.h linux-2.6.20/fs/reiser4/status_flags.h +--- linux-2.6.20.orig/fs/reiser4/status_flags.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/status_flags.h 2007-05-06 14:50:43.875030717 +0400 @@ -0,0 +1,43 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -67189,11 +66718,9 @@ index 0000000..6cfa5ad +int reiser4_status_finish(void); + +#endif -diff --git a/fs/reiser4/super.c b/fs/reiser4/super.c -new file mode 100644 -index 0000000..bc4113e ---- /dev/null -+++ b/fs/reiser4/super.c +diff -urN linux-2.6.20.orig/fs/reiser4/super.c linux-2.6.20/fs/reiser4/super.c +--- linux-2.6.20.orig/fs/reiser4/super.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/super.c 2007-05-06 14:50:43.875030717 +0400 @@ -0,0 +1,316 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -67511,11 +67038,9 @@ index 0000000..bc4113e + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/super.h b/fs/reiser4/super.h -new file mode 100644 -index 0000000..120f021 ---- /dev/null -+++ b/fs/reiser4/super.h +diff -urN linux-2.6.20.orig/fs/reiser4/super.h linux-2.6.20/fs/reiser4/super.h +--- linux-2.6.20.orig/fs/reiser4/super.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/super.h 2007-05-06 14:50:43.875030717 +0400 @@ -0,0 +1,464 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -67981,12 +67506,10 @@ index 0000000..120f021 + * fill-column: 120 + * End: + */ -diff --git a/fs/reiser4/super_ops.c b/fs/reiser4/super_ops.c -new file mode 100644 -index 0000000..41e9c1a ---- /dev/null -+++ b/fs/reiser4/super_ops.c -@@ -0,0 +1,730 @@ +diff -urN linux-2.6.20.orig/fs/reiser4/super_ops.c linux-2.6.20/fs/reiser4/super_ops.c +--- linux-2.6.20.orig/fs/reiser4/super_ops.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/super_ops.c 2007-05-06 14:50:43.879031967 +0400 +@@ -0,0 +1,728 @@ +/* Copyright 2005 by Hans Reiser, licensing governed by + * reiser4/README */ + @@ -68567,11 +68090,8 @@ index 0000000..41e9c1a + * + * Reiser4 mount entry. + */ -+static int reiser4_get_sb(struct file_system_type *fs_type, -+ int flags, -+ const char *dev_name, -+ void *data, -+ struct vfsmount *mnt) ++static int reiser4_get_sb(struct file_system_type *fs_type, int flags, ++ const char *dev_name, void *data, struct vfsmount *mnt) +{ + return get_sb_bdev(fs_type, flags, dev_name, data, fill_super, mnt); +} @@ -68588,6 +68108,7 @@ index 0000000..41e9c1a + +void destroy_reiser4_cache(struct kmem_cache **cachep) +{ ++ BUG_ON(*cachep == NULL); + kmem_cache_destroy(*cachep); + *cachep = NULL; +} @@ -68717,11 +68238,9 @@ index 0000000..41e9c1a + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/tap.c b/fs/reiser4/tap.c -new file mode 100644 -index 0000000..cfa5179 ---- /dev/null -+++ b/fs/reiser4/tap.c +diff -urN linux-2.6.20.orig/fs/reiser4/tap.c linux-2.6.20/fs/reiser4/tap.c +--- linux-2.6.20.orig/fs/reiser4/tap.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/tap.c 2007-05-06 14:50:43.879031967 +0400 @@ -0,0 +1,377 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -69100,11 +68619,9 @@ index 0000000..cfa5179 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/tap.h b/fs/reiser4/tap.h -new file mode 100644 -index 0000000..1416729 ---- /dev/null -+++ b/fs/reiser4/tap.h +diff -urN linux-2.6.20.orig/fs/reiser4/tap.h linux-2.6.20/fs/reiser4/tap.h +--- linux-2.6.20.orig/fs/reiser4/tap.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/tap.h 2007-05-06 14:50:43.879031967 +0400 @@ -0,0 +1,70 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -69176,11 +68693,9 @@ index 0000000..1416729 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/tree.c b/fs/reiser4/tree.c -new file mode 100644 -index 0000000..32548d2 ---- /dev/null -+++ b/fs/reiser4/tree.c +diff -urN linux-2.6.20.orig/fs/reiser4/tree.c linux-2.6.20/fs/reiser4/tree.c +--- linux-2.6.20.orig/fs/reiser4/tree.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/tree.c 2007-05-06 14:50:43.883033217 +0400 @@ -0,0 +1,1876 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -71058,11 +70573,9 @@ index 0000000..32548d2 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/tree.h b/fs/reiser4/tree.h -new file mode 100644 -index 0000000..73aa70a ---- /dev/null -+++ b/fs/reiser4/tree.h +diff -urN linux-2.6.20.orig/fs/reiser4/tree.h linux-2.6.20/fs/reiser4/tree.h +--- linux-2.6.20.orig/fs/reiser4/tree.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/tree.h 2007-05-06 14:50:43.883033217 +0400 @@ -0,0 +1,577 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -71641,11 +71154,9 @@ index 0000000..73aa70a + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/tree_mod.c b/fs/reiser4/tree_mod.c -new file mode 100644 -index 0000000..bcc6548 ---- /dev/null -+++ b/fs/reiser4/tree_mod.c +diff -urN linux-2.6.20.orig/fs/reiser4/tree_mod.c linux-2.6.20/fs/reiser4/tree_mod.c +--- linux-2.6.20.orig/fs/reiser4/tree_mod.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/tree_mod.c 2007-05-06 14:50:43.887034467 +0400 @@ -0,0 +1,386 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -72033,11 +71544,9 @@ index 0000000..bcc6548 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/tree_mod.h b/fs/reiser4/tree_mod.h -new file mode 100644 -index 0000000..1519641 ---- /dev/null -+++ b/fs/reiser4/tree_mod.h +diff -urN linux-2.6.20.orig/fs/reiser4/tree_mod.h linux-2.6.20/fs/reiser4/tree_mod.h +--- linux-2.6.20.orig/fs/reiser4/tree_mod.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/tree_mod.h 2007-05-06 14:50:43.887034467 +0400 @@ -0,0 +1,29 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -72068,11 +71577,9 @@ index 0000000..1519641 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/tree_walk.c b/fs/reiser4/tree_walk.c -new file mode 100644 -index 0000000..cde4875 ---- /dev/null -+++ b/fs/reiser4/tree_walk.c +diff -urN linux-2.6.20.orig/fs/reiser4/tree_walk.c linux-2.6.20/fs/reiser4/tree_walk.c +--- linux-2.6.20.orig/fs/reiser4/tree_walk.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/tree_walk.c 2007-05-06 14:50:43.887034467 +0400 @@ -0,0 +1,927 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -73001,11 +72508,9 @@ index 0000000..cde4875 + fill-column: 80 + End: +*/ -diff --git a/fs/reiser4/tree_walk.h b/fs/reiser4/tree_walk.h -new file mode 100644 -index 0000000..3d5f09f ---- /dev/null -+++ b/fs/reiser4/tree_walk.h +diff -urN linux-2.6.20.orig/fs/reiser4/tree_walk.h linux-2.6.20/fs/reiser4/tree_walk.h +--- linux-2.6.20.orig/fs/reiser4/tree_walk.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/tree_walk.h 2007-05-06 14:50:43.887034467 +0400 @@ -0,0 +1,125 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -73132,11 +72637,9 @@ index 0000000..3d5f09f + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/txnmgr.c b/fs/reiser4/txnmgr.c -new file mode 100644 -index 0000000..72d525b ---- /dev/null -+++ b/fs/reiser4/txnmgr.c +diff -urN linux-2.6.20.orig/fs/reiser4/txnmgr.c linux-2.6.20/fs/reiser4/txnmgr.c +--- linux-2.6.20.orig/fs/reiser4/txnmgr.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/txnmgr.c 2007-05-06 14:50:43.895036966 +0400 @@ -0,0 +1,3164 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -76302,11 +75805,9 @@ index 0000000..72d525b + * fill-column: 79 + * End: + */ -diff --git a/fs/reiser4/txnmgr.h b/fs/reiser4/txnmgr.h -new file mode 100644 -index 0000000..6ad4b5a ---- /dev/null -+++ b/fs/reiser4/txnmgr.h +diff -urN linux-2.6.20.orig/fs/reiser4/txnmgr.h linux-2.6.20/fs/reiser4/txnmgr.h +--- linux-2.6.20.orig/fs/reiser4/txnmgr.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/txnmgr.h 2007-05-06 14:50:43.899038216 +0400 @@ -0,0 +1,708 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -77016,11 +76517,9 @@ index 0000000..6ad4b5a + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/type_safe_hash.h b/fs/reiser4/type_safe_hash.h -new file mode 100644 -index 0000000..b2fdacd ---- /dev/null -+++ b/fs/reiser4/type_safe_hash.h +diff -urN linux-2.6.20.orig/fs/reiser4/type_safe_hash.h linux-2.6.20/fs/reiser4/type_safe_hash.h +--- linux-2.6.20.orig/fs/reiser4/type_safe_hash.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/type_safe_hash.h 2007-05-06 14:50:43.899038216 +0400 @@ -0,0 +1,320 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -77342,11 +76841,9 @@ index 0000000..b2fdacd + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/vfs_ops.c b/fs/reiser4/vfs_ops.c -new file mode 100644 -index 0000000..31afd3e ---- /dev/null -+++ b/fs/reiser4/vfs_ops.c +diff -urN linux-2.6.20.orig/fs/reiser4/vfs_ops.c linux-2.6.20/fs/reiser4/vfs_ops.c +--- linux-2.6.20.orig/fs/reiser4/vfs_ops.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/vfs_ops.c 2007-05-06 14:50:43.899038216 +0400 @@ -0,0 +1,259 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -77607,11 +77104,9 @@ index 0000000..31afd3e + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/vfs_ops.h b/fs/reiser4/vfs_ops.h -new file mode 100644 -index 0000000..03e16ce ---- /dev/null -+++ b/fs/reiser4/vfs_ops.h +diff -urN linux-2.6.20.orig/fs/reiser4/vfs_ops.h linux-2.6.20/fs/reiser4/vfs_ops.h +--- linux-2.6.20.orig/fs/reiser4/vfs_ops.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/vfs_ops.h 2007-05-06 14:50:43.899038216 +0400 @@ -0,0 +1,53 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -77666,11 +77161,9 @@ index 0000000..03e16ce + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/wander.c b/fs/reiser4/wander.c -new file mode 100644 -index 0000000..6d1d1d9 ---- /dev/null -+++ b/fs/reiser4/wander.c +diff -urN linux-2.6.20.orig/fs/reiser4/wander.c linux-2.6.20/fs/reiser4/wander.c +--- linux-2.6.20.orig/fs/reiser4/wander.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/wander.c 2007-05-06 14:50:43.903039466 +0400 @@ -0,0 +1,1797 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -78231,7 +77724,7 @@ index 0000000..6d1d1d9 + jnode *node; + + pg = bio->bi_io_vec[i].bv_page; -+ end_page_writeback(pg); ++ ClearPageWriteback(pg); + node = jprivate(pg); + spin_lock_jnode(node); + JF_CLR(node, JNODE_WRITEBACK); @@ -79469,11 +78962,9 @@ index 0000000..6d1d1d9 + fill-column: 80 + End: +*/ -diff --git a/fs/reiser4/wander.h b/fs/reiser4/wander.h -new file mode 100644 -index 0000000..8746710 ---- /dev/null -+++ b/fs/reiser4/wander.h +diff -urN linux-2.6.20.orig/fs/reiser4/wander.h linux-2.6.20/fs/reiser4/wander.h +--- linux-2.6.20.orig/fs/reiser4/wander.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/wander.h 2007-05-06 14:50:43.903039466 +0400 @@ -0,0 +1,135 @@ +/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */ + @@ -79610,11 +79101,9 @@ index 0000000..8746710 + scroll-step: 1 + End: +*/ -diff --git a/fs/reiser4/writeout.h b/fs/reiser4/writeout.h -new file mode 100644 -index 0000000..446b63b ---- /dev/null -+++ b/fs/reiser4/writeout.h +diff -urN linux-2.6.20.orig/fs/reiser4/writeout.h linux-2.6.20/fs/reiser4/writeout.h +--- linux-2.6.20.orig/fs/reiser4/writeout.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/writeout.h 2007-05-06 14:50:43.907040716 +0400 @@ -0,0 +1,21 @@ +/* Copyright 2002, 2003, 2004 by Hans Reiser, licensing governed by reiser4/README */ + @@ -79637,11 +79126,9 @@ index 0000000..446b63b + fill-column: 80 + End: +*/ -diff --git a/fs/reiser4/znode.c b/fs/reiser4/znode.c -new file mode 100644 -index 0000000..b695111 ---- /dev/null -+++ b/fs/reiser4/znode.c +diff -urN linux-2.6.20.orig/fs/reiser4/znode.c linux-2.6.20/fs/reiser4/znode.c +--- linux-2.6.20.orig/fs/reiser4/znode.c 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/znode.c 2007-05-06 14:50:43.907040716 +0400 @@ -0,0 +1,1029 @@ +/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -80672,11 +80159,9 @@ index 0000000..b695111 + fill-column: 120 + End: +*/ -diff --git a/fs/reiser4/znode.h b/fs/reiser4/znode.h -new file mode 100644 -index 0000000..4699d0f ---- /dev/null -+++ b/fs/reiser4/znode.h +diff -urN linux-2.6.20.orig/fs/reiser4/znode.h linux-2.6.20/fs/reiser4/znode.h +--- linux-2.6.20.orig/fs/reiser4/znode.h 1970-01-01 03:00:00.000000000 +0300 ++++ linux-2.6.20/fs/reiser4/znode.h 2007-05-06 14:50:43.907040716 +0400 @@ -0,0 +1,434 @@ +/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by + * reiser4/README */ @@ -81112,11 +80597,10 @@ index 0000000..4699d0f + fill-column: 120 + End: +*/ -diff --git a/include/linux/fs.h b/include/linux/fs.h -index 1410e53..dd12411 100644 ---- a/include/linux/fs.h -+++ b/include/linux/fs.h -@@ -1165,6 +1165,8 @@ struct super_operations { +diff -urN linux-2.6.20.orig/include/linux/fs.h linux-2.6.20/include/linux/fs.h +--- linux-2.6.20.orig/include/linux/fs.h 2007-05-06 15:04:41.352625543 +0400 ++++ linux-2.6.20/include/linux/fs.h 2007-05-06 14:50:43.911041966 +0400 +@@ -1165,6 +1165,8 @@ void (*clear_inode) (struct inode *); void (*umount_begin) (struct vfsmount *, int); @@ -81125,7 +80609,7 @@ index 1410e53..dd12411 100644 int (*show_options)(struct seq_file *, struct vfsmount *); int (*show_stats)(struct seq_file *, struct vfsmount *); #ifdef CONFIG_QUOTA -@@ -1583,6 +1585,7 @@ extern int invalidate_inode_pages2(struct address_space *mapping); +@@ -1583,6 +1585,7 @@ extern int invalidate_inode_pages2_range(struct address_space *mapping, pgoff_t start, pgoff_t end); extern int write_inode_now(struct inode *, int); @@ -81133,11 +80617,10 @@ index 1410e53..dd12411 100644 extern int filemap_fdatawrite(struct address_space *); extern int filemap_flush(struct address_space *); extern int filemap_fdatawait(struct address_space *); -diff --git a/lib/radix-tree.c b/lib/radix-tree.c -index d69ddbe..ed3e15f 100644 ---- a/lib/radix-tree.c -+++ b/lib/radix-tree.c -@@ -151,6 +151,7 @@ int radix_tree_preload(gfp_t gfp_mask) +diff -urN linux-2.6.20.orig/lib/radix-tree.c linux-2.6.20/lib/radix-tree.c +--- linux-2.6.20.orig/lib/radix-tree.c 2007-05-06 15:04:42.096858012 +0400 ++++ linux-2.6.20/lib/radix-tree.c 2007-05-06 14:50:43.915043216 +0400 +@@ -151,6 +151,7 @@ out: return ret; } @@ -81145,11 +80628,10 @@ index d69ddbe..ed3e15f 100644 static inline void tag_set(struct radix_tree_node *node, unsigned int tag, int offset) -diff --git a/mm/filemap.c b/mm/filemap.c -index 8332c77..b16d2cb 100644 ---- a/mm/filemap.c -+++ b/mm/filemap.c -@@ -121,6 +121,7 @@ void __remove_from_page_cache(struct page *page) +diff -urN linux-2.6.20.orig/mm/filemap.c linux-2.6.20/mm/filemap.c +--- linux-2.6.20.orig/mm/filemap.c 2007-05-06 15:04:42.108861762 +0400 ++++ linux-2.6.20/mm/filemap.c 2007-05-06 14:50:43.919044465 +0400 +@@ -121,6 +121,7 @@ mapping->nrpages--; __dec_zone_page_state(page, NR_FILE_PAGES); } @@ -81157,7 +80639,7 @@ index 8332c77..b16d2cb 100644 void remove_from_page_cache(struct page *page) { -@@ -132,6 +133,7 @@ void remove_from_page_cache(struct page *page) +@@ -132,6 +133,7 @@ __remove_from_page_cache(page); write_unlock_irq(&mapping->tree_lock); } @@ -81165,35 +80647,34 @@ index 8332c77..b16d2cb 100644 static int sync_page(void *word) { -@@ -465,6 +467,7 @@ int add_to_page_cache_lru(struct page *page, struct address_space *mapping, - lru_cache_add(page); +@@ -738,6 +740,7 @@ + read_unlock_irq(&mapping->tree_lock); return ret; } +EXPORT_SYMBOL(add_to_page_cache_lru); - #ifdef CONFIG_NUMA - struct page *__page_cache_alloc(gfp_t gfp) -@@ -738,6 +741,7 @@ unsigned find_get_pages(struct address_space *mapping, pgoff_t start, + /** + * find_get_pages_contig - gang contiguous pagecache lookup +@@ -798,6 +801,7 @@ read_unlock_irq(&mapping->tree_lock); return ret; } +EXPORT_SYMBOL(find_get_pages); /** - * find_get_pages_contig - gang contiguous pagecache lookup -@@ -798,6 +802,7 @@ unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, - read_unlock_irq(&mapping->tree_lock); - return ret; + * grab_cache_page_nowait - returns locked page at given index in given cache +@@ -855,6 +859,7 @@ + + ra->ra_pages /= 4; } +EXPORT_SYMBOL(find_get_pages_tag); /** - * grab_cache_page_nowait - returns locked page at given index in given cache -diff --git a/mm/readahead.c b/mm/readahead.c -index 0f539e8..9db41de 100644 ---- a/mm/readahead.c -+++ b/mm/readahead.c -@@ -568,6 +568,7 @@ void handle_ra_miss(struct address_space *mapping, + * do_generic_mapping_read - generic file read routine +diff -urN linux-2.6.20.orig/mm/readahead.c linux-2.6.20/mm/readahead.c +--- linux-2.6.20.orig/mm/readahead.c 2007-05-06 15:04:42.144873010 +0400 ++++ linux-2.6.20/mm/readahead.c 2007-05-06 14:50:43.919044465 +0400 +@@ -568,6 +568,7 @@ ra->flags &= ~RA_FLAG_INCACHE; ra->cache_hit = 0; } @@ -81201,3 +80682,4 @@ index 0f539e8..9db41de 100644 /* * Given a desired number of PAGE_CACHE_SIZE readahead pages, return a +Files linux-2.6.20.orig/scripts/kconfig/mconf and linux-2.6.20/scripts/kconfig/mconf differ -- 2.39.2