Commit 3831c89d authored by Vladimir Saveliev's avatar Vladimir Saveliev Committed by James Toy

This is the main reiserfs4 filesystem.

Q&A wrt this patch:

- A really short guide to how to get up and running with this filesystem.

        Reiser4 is a file system based on dancing tree algorithms, and
        is described at http://www.namesys.com.  One should be able to get it
        up and running just like any of the other filesystems supported by
        Linux.  Configure it to be compiled either builtin or as a module. 
        Create reiser4 filesystem with mkfs.reiser4, mount and use it.  More
        detailed info can be found at
        http://thebsh.namesys.com/snapshots/LATEST/READ.ME.

- The direct URL which people use to obtain the mkfs tool for this
  filesystem.  Also fsck and anything else.

        Reiser4 userland tools can be obtained at
        ftp://ftp.namesys.com/pub/reiser4progs. 
        ftp://ftp.namesys.com/pub/reiser4progs/README contains detailed
        instructions on how to compile and install these tools.  Also all
        reiser4 progs have man pages.  

- Any known shortcomings, caveats, etc.

        Reiser4 has been tested on i386 yet only.  Quota support is
        not ready yet.  Should be ready soon.  Reiser4 was tested extensively,
        and we got to where the mailing list was not able to hit any bugs, but
        then we told people that, got an order of magnitude increase in users,
        and they are able to hit bugs that we are working on now.

        Reiser's Law of Software Engineering: Each order of magnitude
        increase in users finds more bugs, in a quantity equal to the previous
        order of magnitude increase in users.  Success for software developers
        is measured by how long the frustration lasts.

        Only the very core functionality is working.  Exotic plugins,
        an API for multiple operation transactions and accessing multiple
        small files in one syscall, compression, inheritance, all have been
        postponed until after the core functionality is shipped.  The
        compression plugin needs a code review before anyone should use it.

- A statement on compatibility with reiserfs3 filesytems.

        To upgrade from reiserfs V3 to V4, use tar, or sponsor us to
        write a convertfs.

- Bear in mind that people will immediately benchmark this filesytem, and
  first impressions count.  Now is your chance to communicate any tuning
  guidelines, mount options or whatever which you'd like people to understand
  BEFORE they start publishing benchmark info.

        Reiser4 is not tuned for fsync/sync/O_SYNC performance yet.  

        If you see results that are much different from those at
        www.namesys.com/benchmarks.html, let us know.  If you see performance
        characteristics that don't quite make sense, email
        reiserfs-list@namesys.com, such things are always of interest.

        reiser4 is not tuned for mmaping and dirtying more than
        physical ram like IOzone does.  This is quite different in its code
        path from writing and dirtying more than physical ram.  There are
        those who think that what IOZone does is rarely done by real programs,
        and therefor we should not bother to optimize what it does.  All I
        know is, this month we are not optimized for it.

        Please consider its space savings when you benchmark it also.

[michal.k.k.piotrowski@gmail.com: kill #include "linux/config.h"]
[akpm@linux-foundation.org: reiser4_drop_page: don't call remove_from_page_cache]
[bunk@stusta.de: fs/reiser4/: possible cleanups]
Signed-off-by: default avatarVladimir Saveliev <vs@namesys.com>
Signed-off-by: default avatarHans Reiser <reiser@namesys.com>
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
DESC
reiser4: fix for drop-unused-semaphores.patch
EDESC
Wait for tail conversion completion when acquiring exclusive access by
. mmap_unix_file()
. setattr_unix_file()
. release_unix_file()
Update comments.
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
Cc Jonathan Briggs <jbriggs@esoft.com>
DESC
reiser4-slab-allocators-remove-slab_debug_initial-flag
EDESC
Cc: Christoph Lameter <cl@linux-foundation.org>.com>
DESC
reiser4: use simple_prepare_write to zero page data
EDESC
It's common for file systems to need to zero data on either side of a
write, if a page is not Uptodate during prepare_write.  It just so happens
that simple_prepare_write() in libfs.c does exactly that, so we can avoid
duplication and just call that function to zero page data.
Signed-off-by: default avatarNate Diller <nate.diller@gmail.com>
Cc: Vladimir Saveliev <vs@namesys.com>
Cc: Edward Shishkin <edward@namesys.com>
DESC
reiser4-fix
EDESC

DESC
reiser4: use zero_user_page
EDESC
Use zero_user_page() instead of open-coding it.
Signed-off-by: default avatarNate Diller <nate.diller@gmail.com>
Cc: Vladimir Saveliev <vs@namesys.com>
Cc: Edward Shishkin <edward@namesys.com>
DESC
reiser4: remove typedefs
EDESC
. Reduce number of typedefs from 289 to 248
. Remove unused file plugin/file/invert.c
. Update comments

DESC
reiser4: fix write_extent
EDESC
Prepared-by Ignatich <ignatich@gmail.com>

Fix reiser4_write_extent():
   1) handling incomplete writes missed in reiser4-temp-fix.patch
   2) bugs in the case of returned errors
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
DESC
reiser4 make sync_inodes non-void
EDESC
Make reiser4_sync_inodes non-void
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
DESC
Reiser4: Drop 'size' argument from bio_endio and bi_end_io
EDESC
Reiser4: Drop 'size' argument from bio_endio and bi_end_io

This patch pushes into Reiser4 the changes introduced by
commit 6712ecf8:

	As bi_end_io is only called once when the request is complete,
	the 'size' argument is now redundant.  Remove it.

	Now there is no need for bio_endio to subtract the size completed
	from bi_size.  So don't do that either.

	While we are at it, change bi_end_io to return void.
Signed-off-by: default avatarLaurent Riffard <laurent.riffard@free.fr>
Acked-by: default avatarJens Axboe <jens.axboe@oracle.com>
Acked-by: default avatarEdward Shishkin <edward@namesys.com>
DESC
mm: clean up and kernelify shrinker registration
EDESC
I can never remember what the function to register to receive VM pressure
is called.  I have to trace down from __alloc_pages() to find it.

It's called "set_shrinker()", and it needs Your Help.

1) Don't hide struct shrinker.  It contains no magic.
2) Don't allocate "struct shrinker".  It's not helpful.
3) Call them "register_shrinker" and "unregister_shrinker".
4) Call the function "shrink" not "shrinker".
5) Reduce the 17 lines of waffly comments to 13, but document it properly.

The comment in reiser4 makes me a little queasy.
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Cc: Vladimir Saveliev <vs@namesys.com>
Acked-by: default avatarEdward Shishkin <edward@namesys.com>
DESC
reiser4: fix NULL dereference in __mnt_is_readonly in ftruncate()
EDESC
Signed-off-by: default avatarDave Hansen <haveblue@us.ibm.com>
Cc: Edward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
reiser4: fix extent2tail
EDESC
Fixed bug in extent2tail conversion.

Bug description:
when converting partially converted file
(with flag REISER4_PART_MIXED installed)
reiser4_cut_tree() starts to cut old metatada
from wrong offset. Result is data corruption.
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
DESC
reiser4: fix read_tail
EDESC
Update hint when reading tails
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
DESC
reiser4: fix unix-file readpages filler
EDESC
Protect page (via incrementing page count) from being reclaimed when looking
for extent pointer in unix-file specific readpages filler.
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
DESC
reiser4: fix readpage_unix_file
EDESC
. If nominated (by VFS) page is out of file size, then fill it
  by zeros instead of returning -EINVAL (this prevents returning
  an unexpected error (-EINVAL) by some apps that don't check
  file size).

. Check if the page became uptodate while it was being unlocked.
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
Cc: Zan Lynx <zlynx@acm.org>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
reiser4: fix for new aops patches
EDESC
Cc: Vladimir Saveliev <vs@namesys.com>
Cc: Edward Shishkin <edward@namesys.com>
DESC
reiser4: do not allocate struct file on stack
EDESC
Do not allocate struct file on stack, pass the persistent one instead.
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
Tested-by: default avatarZan Lynx <zlynx@acm.org>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
git-block-vs-reiser4
EDESC
Hope this is right.

Hope you know what you're doing ;)

Cc: Vladimir Saveliev <vs@namesys.com>
Cc: Edward Shishkin <edward@namesys.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
DESC
reiser4: cryptcompress misc fixups
EDESC
.  Fix a race (reproducible by fsx + sync (1)) between
  checkin_page_cluster operations: serialize them via special per-inode
  checkin_mutex (usual i_mutex is not suitable for this purpose, as
  ->writepages() also calls checkin_page_cluster();

.  Add comments for checkin/checkout technique for synchronization of
  primary and secondary caches with proof of correctness;

.  Fix missed right neighbor when updating disk clusters by
  handle_pos_on_leaf() during squalloc (should use upper levels to get
  expected non-connected neighbor);

.  Resolve a race between read and truncate (when read finds partially
  truncated and, hence, unrecoverable disk cluster) via keeping a track of
  leftmost truncated disk clusters in cryptcompress-specific part of inode;

. Introduce size translators and size modulators for
  common needs;

. Update comments;

. Rename badly sounding function names;

. Fix coding style;

. Add my part of credits.
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
reiser4: cryptcompress misc fixups-2
EDESC
Check a file plugin id before manipulating with plugin-specific counter.
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
fs/reiser4/plugin/: make 3 functions static
EDESC
This patch makes the following needlessly global functions static:
- file/cryptcompress.c: __put_page_cluster()
- file/cryptcompress.c: put_hint_cluster()
- item/ctail.c: ctail_read_disk_cluster()
Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
Cc: Edward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
reiser4: change error code base
EDESC
Change REISER4_ERROR_CODE_BASE to 10000 to not overlap real errnos
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
reiser4: use lzo library functions
EDESC
. Convert Reiser4 to use lzo implementation in lib/lzo/ instead of
  including its own copy of minilzo;
. Do not set zeros to workmem region.
Signed-off-by: default avatarEdward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
fs/reiser4/plugin/file/cryptcompress.c: kmalloc + memset conversion to kzalloc
EDESC
 fs/reiser4/plugin/file/cryptcompress.c | 101386 -> 101352 (-34 bytes)
 fs/reiser4/plugin/file/cryptcompress.o | 456784 -> 456644 (-140 bytes)
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Edward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
reiser4: kmalloc + memset conversion to kzalloc
EDESC
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Edward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
fs/reiser4/init_super.c: kmalloc + memset conversion to kzalloc
EDESC
 fs/reiser4/init_super.c | 19283 -> 19246 (-37 bytes)
 fs/reiser4/init_super.o | 155348 -> 155152 (-196 bytes)
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Edward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
fs/reiser4/plugin/inode_ops_rename.c: kmalloc + memset conversion to kzalloc
EDESC
 fs/reiser4/plugin/inode_ops_rename.c | 28474 -> 28344 (-130 bytes)
 fs/reiser4/plugin/inode_ops_rename.o | 142600 -> 142476 (-124 bytes)
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Edward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
fs/reiser4/ktxnmgrd.c: kmalloc + memset conversion to kzalloc
EDESC
 fs/reiser4/ktxnmgrd.c | 5314 -> 5277 (-37 bytes)
 fs/reiser4/ktxnmgrd.o | 131624 -> 131496 (-128 bytes)
Signed-off-by: default avatarMariusz Kozlowski <m.kozlowski@tuxland.pl>
Cc: Edward Shishkin <edward@namesys.com>
Cc: "Vladimir V. Saveliev" <vs@namesys.com>
DESC
Use helpers to obtain task pid in printks
EDESC
The task_struct->pid member is going to be deprecated, so start
using the helpers (task_pid_nr/task_pid_vnr/task_pid_nr_ns) in
the kernel.

The first thing to start with is the pid, printed to dmesg - in
this case we may safely use task_pid_nr(). Besides, printks produce
more (much more) than a half of all the explicit pid usage.
Signed-off-by: default avatarPavel Emelyanov <xemul@openvz.org>
DESC
Subject: [PATCH 1/2] remove asm/bitops.h includes
EDESC
remove asm/bitops.h includes

including asm/bitops directly may cause compile errors. don't include it
and include linux/bitops instead. next patch will deny including asm header
directly.

Cc: Adrian Bunk <bunk@kernel.org>
Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
parent acd341e2
...@@ -36,6 +36,7 @@ o module-init-tools 0.9.10 # depmod -V ...@@ -36,6 +36,7 @@ o module-init-tools 0.9.10 # depmod -V
o e2fsprogs 1.41.4 # e2fsck -V o e2fsprogs 1.41.4 # e2fsck -V
o jfsutils 1.1.3 # fsck.jfs -V o jfsutils 1.1.3 # fsck.jfs -V
o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs o reiserfsprogs 3.6.3 # reiserfsck -V 2>&1|grep reiserfsprogs
o reiser4progs 1.0.0 # fsck.reiser4 -V
o xfsprogs 2.6.0 # xfs_db -V o xfsprogs 2.6.0 # xfs_db -V
o squashfs-tools 4.0 # mksquashfs -version o squashfs-tools 4.0 # mksquashfs -version
o btrfs-progs 0.18 # btrfsck o btrfs-progs 0.18 # btrfsck
...@@ -155,6 +156,13 @@ The reiserfsprogs package should be used for reiserfs-3.6.x ...@@ -155,6 +156,13 @@ The reiserfsprogs package should be used for reiserfs-3.6.x
versions of mkreiserfs, resize_reiserfs, debugreiserfs and versions of mkreiserfs, resize_reiserfs, debugreiserfs and
reiserfsck. These utils work on both i386 and alpha platforms. reiserfsck. These utils work on both i386 and alpha platforms.
Reiser4progs
------------
The reiser4progs package contains utilities for the reiser4 file system.
Detailed instructions are provided in the README file located at:
<ftp://ftp.namesys.com/pub/reiser4progs/README>.
Xfsprogs Xfsprogs
-------- --------
...@@ -343,6 +351,10 @@ Reiserfsprogs ...@@ -343,6 +351,10 @@ Reiserfsprogs
------------- -------------
o <http://www.namesys.com/pub/reiserfsprogs/reiserfsprogs-3.6.3.tar.gz> o <http://www.namesys.com/pub/reiserfsprogs/reiserfsprogs-3.6.3.tar.gz>
Reiser4progs
------------
o <ftp://ftp.namesys.com/pub/reiser4progs/>
Xfsprogs Xfsprogs
-------- --------
o <ftp://oss.sgi.com/projects/xfs/download/> o <ftp://oss.sgi.com/projects/xfs/download/>
......
Reiser4 filesystem
==================
Reiser4 is a file system based on dancing tree algorithms, and is
described at http://www.namesys.com
References
==========
web page http://namesys.com/v4/v4.html
source code ftp://ftp.namesys.com/pub/reiser4-for-2.6/
userland tools ftp://ftp.namesys.com/pub/reiser4progs/
install page http://www.namesys.com/install_v4.html
Compile options
===============
Enable reiser4 debug mode
This checks everything imaginable while reiser4
runs
Mount options
=============
tmgr.atom_max_size=N
Atoms containing more than N blocks will be forced to commit.
N is decimal.
Default is nr_free_pagecache_pages() / 2 at mount time.
tmgr.atom_max_age=N
Atoms older than N seconds will be forced to commit. N is decimal.
Default is 600.
tmgr.atom_max_flushers=N
Limit of concurrent flushers for one atom. 0 means no limit.
Default is 0.
tree.cbk_cache.nr_slots=N
Number of slots in the cbk cache.
flush.relocate_threshold=N
If flush finds more than N adjacent dirty leaf-level blocks it
will force them to be relocated.
Default is 64.
flush.relocate_distance=N
If flush finds can find a block allocation closer than at most
N from the preceder it will relocate to that position.
Default is 64.
flush.scan_maxnodes=N
The maximum number of nodes to scan left on a level during
flush.
Default is 10000.
optimal_io_size=N
Preferred IO size. This value is used to set st_blksize of
struct stat.
Default is 65536.
bsdgroups
Turn on BSD-style gid assignment.
32bittimes
By default file in reiser4 have 64 bit timestamps. Files
created when filesystem is mounted with 32bittimes mount
option will get 32 bit timestamps.
mtflush
Turn off concurrent flushing.
nopseudo
Disable pseudo files support. See
http://namesys.com/v4/pseudo.html for more about pseudo files.
dont_load_bitmap
Don't load all bitmap blocks at mount time, it is useful for
machines with tiny RAM and large disks.
...@@ -28,6 +28,7 @@ config FS_MBCACHE ...@@ -28,6 +28,7 @@ config FS_MBCACHE
default m if EXT2_FS_XATTR || EXT3_FS_XATTR || EXT4_FS_XATTR default m if EXT2_FS_XATTR || EXT3_FS_XATTR || EXT4_FS_XATTR
source "fs/reiserfs/Kconfig" source "fs/reiserfs/Kconfig"
source "fs/reiser4/Kconfig"
source "fs/jfs/Kconfig" source "fs/jfs/Kconfig"
config FS_POSIX_ACL config FS_POSIX_ACL
......
...@@ -65,6 +65,7 @@ obj-$(CONFIG_DLM) += dlm/ ...@@ -65,6 +65,7 @@ obj-$(CONFIG_DLM) += dlm/
# Do not add any filesystems before this line # Do not add any filesystems before this line
obj-$(CONFIG_FSCACHE) += fscache/ obj-$(CONFIG_FSCACHE) += fscache/
obj-$(CONFIG_REISERFS_FS) += reiserfs/ 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_EXT3_FS) += ext3/ # Before ext2 so root fs can be ext3
obj-$(CONFIG_EXT2_FS) += ext2/ obj-$(CONFIG_EXT2_FS) += ext2/
# We place ext4 after ext2 so plain ext2 root fs's are mounted using ext2 # We place ext4 after ext2 so plain ext2 root fs's are mounted using ext2
......
config REISER4_FS
tristate "Reiser4 (EXPERIMENTAL)"
depends on EXPERIMENTAL
select ZLIB_INFLATE
select ZLIB_DEFLATE
select LZO_COMPRESS
select LZO_DECOMPRESS
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.
#
# 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/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
[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.
Edward Shishkin wrote cryptcompress file plugin (which manages files
built of encrypted and(or) compressed bodies) and other plugins related
to transparent encryption and compression support.
This diff is collapsed.
This diff is collapsed.
/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */
#if !defined(__FS_REISER4_BLOCK_ALLOC_H__)
#define __FS_REISER4_BLOCK_ALLOC_H__
#include "dformat.h"
#include "forward.h"
#include <linux/types.h> /* for __u?? */
#include <linux/fs.h>
/* Mask when is applied to given block number shows is that block number is a
fake one */
#define REISER4_FAKE_BLOCKNR_BIT_MASK 0x8000000000000000ULL
/* Mask which isolates a type of object this fake block number was assigned
to */
#define REISER4_BLOCKNR_STATUS_BIT_MASK 0xC000000000000000ULL
/*result after applying the REISER4_BLOCKNR_STATUS_BIT_MASK should be compared
against these two values to understand is the object unallocated or bitmap
shadow object (WORKING BITMAP block, look at the plugin/space/bitmap.c) */
#define REISER4_UNALLOCATED_STATUS_VALUE 0xC000000000000000ULL
#define REISER4_BITMAP_BLOCKS_STATUS_VALUE 0x8000000000000000ULL
/* specification how block allocation was counted in sb block counters */
typedef enum {
BLOCK_NOT_COUNTED = 0, /* reiser4 has no info about this block yet */
BLOCK_GRABBED = 1, /* free space grabbed for further allocation
of this block */
BLOCK_FLUSH_RESERVED = 2, /* block is reserved for flush needs. */
BLOCK_UNALLOCATED = 3, /* block is used for existing in-memory object
( unallocated formatted or unformatted
node) */
BLOCK_ALLOCATED = 4 /* block is mapped to disk, real on-disk block
number assigned */
} block_stage_t;
/* a hint for block allocator */
struct reiser4_blocknr_hint {
/* FIXME: I think we want to add a longterm lock on the bitmap block
here. This is to prevent jnode_flush() calls from interleaving
allocations on the same bitmap, once a hint is established. */
/* search start hint */
reiser4_block_nr blk;
/* if not zero, it is a region size we search for free blocks in */
reiser4_block_nr max_dist;
/* level for allocation, may be useful have branch-level and higher
write-optimized. */
tree_level level;
/* block allocator assumes that blocks, which will be mapped to disk,
are in this specified block_stage */
block_stage_t block_stage;
/* If direction = 1 allocate blocks in backward direction from the end
* of disk to the beginning of disk. */
unsigned int backward:1;
};
/* These flags control block allocation/deallocation behavior */
enum reiser4_ba_flags {
/* do allocatations from reserved (5%) area */
BA_RESERVED = (1 << 0),
/* block allocator can do commit trying to recover free space */
BA_CAN_COMMIT = (1 << 1),
/* if operation will be applied to formatted block */
BA_FORMATTED = (1 << 2),
/* defer actual block freeing until transaction commit */
BA_DEFER = (1 << 3),
/* allocate blocks for permanent fs objects (formatted or unformatted),
not wandered of log blocks */
BA_PERMANENT = (1 << 4),
/* grab space even it was disabled */
BA_FORCE = (1 << 5),
/* use default start value for free blocks search. */
BA_USE_DEFAULT_SEARCH_START = (1 << 6)
};
typedef enum reiser4_ba_flags reiser4_ba_flags_t;
extern void reiser4_blocknr_hint_init(reiser4_blocknr_hint * hint);
extern void reiser4_blocknr_hint_done(reiser4_blocknr_hint * hint);
extern void update_blocknr_hint_default(const struct super_block *,
const reiser4_block_nr *);
extern void get_blocknr_hint_default(reiser4_block_nr *);
extern reiser4_block_nr reiser4_fs_reserved_space(struct super_block *super);
int assign_fake_blocknr_formatted(reiser4_block_nr *);
reiser4_block_nr fake_blocknr_unformatted(int);
/* free -> grabbed -> fake_allocated -> used */
int reiser4_grab_space(__u64 count, reiser4_ba_flags_t flags);
void all_grabbed2free(void);
void grabbed2free(reiser4_context * , reiser4_super_info_data * , __u64 count);
void fake_allocated2free(__u64 count, reiser4_ba_flags_t flags);
void grabbed2flush_reserved_nolock(txn_atom * atom, __u64 count);
void grabbed2flush_reserved(__u64 count);
int reiser4_alloc_blocks(reiser4_blocknr_hint * hint,
reiser4_block_nr * start,
reiser4_block_nr * len, reiser4_ba_flags_t flags);
int reiser4_dealloc_blocks(const reiser4_block_nr *,
const reiser4_block_nr *,
block_stage_t, reiser4_ba_flags_t flags);
static inline int reiser4_alloc_block(reiser4_blocknr_hint * hint,
reiser4_block_nr * start,
reiser4_ba_flags_t flags)
{
reiser4_block_nr one = 1;
return reiser4_alloc_blocks(hint, start, &one, flags);
}
static inline int reiser4_dealloc_block(const reiser4_block_nr * block,
block_stage_t stage,
reiser4_ba_flags_t flags)
{
const reiser4_block_nr one = 1;
return reiser4_dealloc_blocks(block, &one, stage, flags);
}
#define reiser4_grab_space_force(count, flags) \
reiser4_grab_space(count, flags | BA_FORCE)
extern void grabbed2free_mark(__u64 mark);
extern int reiser4_grab_reserved(struct super_block *,
__u64, reiser4_ba_flags_t);
extern void reiser4_release_reserved(struct super_block *super);
/* grabbed -> fake_allocated */
/* fake_allocated -> used */
/* used -> fake_allocated -> grabbed -> free */
extern void flush_reserved2grabbed(txn_atom * atom, __u64 count);
extern int reiser4_blocknr_is_fake(const reiser4_block_nr * da);
extern void grabbed2cluster_reserved(int count);
extern void cluster_reserved2grabbed(int count);
extern void cluster_reserved2free(int count);
extern int reiser4_check_block_counters(const struct super_block *);
#if REISER4_DEBUG
extern void reiser4_check_block(const reiser4_block_nr *, int);
#else
# define reiser4_check_block(beg, val) noop
#endif
extern int reiser4_pre_commit_hook(void);
extern void reiser4_post_commit_hook(void);
extern void reiser4_post_write_back_hook(void);
#endif /* __FS_REISER4_BLOCK_ALLOC_H__ */
/* Make Linus happy.
Local variables:
c-indentation-style: "K&R"
mode-name: "LC"
c-basic-offset: 8
tab-width: 8
fill-column: 120
End:
*/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by
reiser4/README */
/* implementation of carry operations. See carry_ops.c for details. */
#if !defined(__CARRY_OPS_H__)
#define __CARRY_OPS_H__
#include "forward.h"
#include "znode.h"
#include "carry.h"
/* carry operation handlers */
typedef struct carry_op_handler {
/* perform operation */
int (*handler) (carry_op * op, carry_level * doing, carry_level * todo);
/* estimate memory requirements for @op */
int (*estimate) (carry_op * op, carry_level * level);
} carry_op_handler;
/* This is dispatch table for carry operations. It can be trivially
abstracted into useful plugin: tunable balancing policy is a good
thing. */
extern carry_op_handler op_dispatch_table[COP_LAST_OP];
unsigned int space_needed(const znode * node, const coord_t *coord,
const reiser4_item_data * data, int inserting);
extern carry_node *find_left_carry(carry_node * node, carry_level * level);
extern carry_node *find_right_carry(carry_node * node, carry_level * level);
/* __CARRY_OPS_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:
*/
/* Copyright 2002, 2003 by Hans Reiser, licensing governed by reiser4/README */
/* Manipulation of reiser4_context */
/*
* global context used during system call. Variable of this type is allocated
* on the stack at the beginning of the reiser4 part of the system call and
* pointer to it is stored in the current->fs_context. This allows us to avoid
* passing pointer to current transaction and current lockstack (both in
* one-to-one mapping with threads) all over the call chain.
*
* It's kind of like those global variables the prof used to tell you not to
* use in CS1, except thread specific.;-) Nikita, this was a good idea.
*
* In some situations it is desirable to have ability to enter reiser4_context
* more than once for the same thread (nested contexts). For example, there
* are some functions that can be called either directly from VFS/VM or from
* already active reiser4 context (->writepage, for example).
*
* In such situations "child" context acts like dummy: all activity is
* actually performed in the top level context, and get_current_context()
* always returns top level context.
* Of course, reiser4_init_context()/reiser4_done_context() have to be properly
* nested any way.
*
* Note that there is an important difference between reiser4 uses
* ->fs_context and the way other file systems use it. Other file systems
* (ext3 and reiserfs) use ->fs_context only for the duration of _transaction_
* (this is why ->fs_context was initially called ->journal_info). This means,
* that when ext3 or reiserfs finds that ->fs_context is not NULL on the entry
* to the file system, they assume that some transaction is already underway,
* and usually bail out, because starting nested transaction would most likely
* lead to the deadlock. This gives false positives with reiser4, because we
* set ->fs_context before starting transaction.
*/
#include "debug.h"
#include "super.h"
#include "context.h"
#include <linux/writeback.h> /* balance_dirty_pages() */
#include <linux/hardirq.h>
static void _reiser4_init_context(reiser4_context * context,
struct super_block *super)
{
memset(context, 0, sizeof(*context));
context->super = super;
context->magic = context_magic;
context->outer = current->journal_info;
current->journal_info = (void *)context;
context->nr_children = 0;
context->gfp_mask = GFP_KERNEL;
init_lock_stack(&context->stack);
reiser4_txn_begin(context);
/* initialize head of tap list */
INIT_LIST_HEAD(&context->taps);
#if REISER4_DEBUG
context->task = current;
#endif
grab_space_enable();
}
/* initialize context and bind it to the current thread
This function should be called at the beginning of reiser4 part of
syscall.
*/
reiser4_context * reiser4_init_context(struct super_block *super)
{
reiser4_context *context;
assert("nikita-2662", !in_interrupt() && !in_irq());
assert("nikita-3357", super != NULL);
assert("nikita-3358", super->s_op == NULL || is_reiser4_super(super));
context = get_current_context_check();
if (context && context->super == super) {
context = (reiser4_context *) current->journal_info;
context->nr_children++;
return context;
}
context = kmalloc(sizeof(*context), GFP_KERNEL);
if (context == NULL)
return ERR_PTR(RETERR(-ENOMEM));
_reiser4_init_context(context, super);
return context;
}
/* this is used in scan_mgr which is called with spinlock held and in
reiser4_fill_super magic */
void init_stack_context(reiser4_context *context, struct super_block *super)
{
assert("nikita-2662", !in_interrupt() && !in_irq());
assert("nikita-3357", super != NULL);
assert("nikita-3358", super->s_op == NULL || is_reiser4_super(super));
assert("vs-12", !is_in_reiser4_context());
_reiser4_init_context(context, super);
context->on_stack = 1;
return;
}
/* cast lock stack embedded into reiser4 context up to its container */
reiser4_context *get_context_by_lock_stack(lock_stack * owner)
{
return container_of(owner, reiser4_context, stack);
}
/* true if there is already _any_ reiser4 context for the current thread */
int is_in_reiser4_context(void)
{
reiser4_context *ctx;
ctx = current->journal_info;
return ctx != NULL && ((unsigned long)ctx->magic) == context_magic;
}
/*
* call balance dirty pages for the current context.
*
* File system is expected to call balance_dirty_pages_ratelimited() whenever
* it dirties a page. reiser4 does this for unformatted nodes (that is, during
* write---this covers vast majority of all dirty traffic), but we cannot do
* this immediately when formatted node is dirtied, because long term lock is
* usually held at that time. To work around this, dirtying of formatted node
* simply increases ->nr_marked_dirty counter in the current reiser4
* context. When we are about to leave this context,
* balance_dirty_pages_ratelimited() is called, if necessary.
*
* This introduces another problem: sometimes we do not want to run
* balance_dirty_pages_ratelimited() when leaving a context, for example
* because some important lock (like ->i_mutex on the parent directory) is
* held. To achieve this, ->nobalance flag can be set in the current context.
*/
static void balance_dirty_pages_at(reiser4_context *context)
{
reiser4_super_info_data *sbinfo = get_super_private(context->super);
/*
* call balance_dirty_pages_ratelimited() to process formatted nodes
* dirtied during this system call. Do that only if we are not in mount
* and there were nodes dirtied in this context and we are not in
* writepage (to avoid deadlock) and not in pdflush
*/
if (sbinfo != NULL && sbinfo->fake != NULL &&
context->nr_marked_dirty != 0 &&
!(current->flags & PF_MEMALLOC) &&
!current_is_pdflush())
balance_dirty_pages_ratelimited(sbinfo->fake->i_mapping);
}
/* release resources associated with context.
This function should be called at the end of "session" with reiser4,
typically just before leaving reiser4 driver back to VFS.
This is good place to put some degugging consistency checks, like that
thread released all locks and closed transcrash etc.
*/
static void reiser4_done_context(reiser4_context * context)
/* context being released */
{
assert("nikita-860", context != NULL);
assert("nikita-859", context->magic == context_magic);
assert("vs-646", (reiser4_context *) current->journal_info == context);
assert("zam-686", !in_interrupt() && !in_irq());
/* only do anything when leaving top-level reiser4 context. All nested
* contexts are just dummies. */
if (context->nr_children == 0) {
assert("jmacd-673", context->trans == NULL);
assert("jmacd-1002", lock_stack_isclean(&context->stack));
assert("nikita-1936", reiser4_no_counters_are_held());
assert("nikita-2626", list_empty_careful(reiser4_taps_list()));
assert("zam-1004", ergo(get_super_private(context->super),
get_super_private(context->super)->delete_mutex_owner !=
current));
/* release all grabbed but as yet unused blocks */
if (context->grabbed_blocks != 0)
all_grabbed2free();
/*
* synchronize against longterm_unlock_znode():
* wake_up_requestor() wakes up requestors without holding
* zlock (otherwise they will immediately bump into that lock
* after wake up on another CPU). To work around (rare)
* situation where requestor has been woken up asynchronously
* and managed to run until completion (and destroy its
* context and lock stack) before wake_up_requestor() called
* wake_up() on it, wake_up_requestor() synchronize on lock
* stack spin lock. It has actually been observed that spin
* lock _was_ locked at this point, because
* wake_up_requestor() took interrupt.
*/
spin_lock_stack(&context->stack);
spin_unlock_stack(&context->stack);
assert("zam-684", context->nr_children == 0);
/* restore original ->fs_context value */
current->journal_info = context->outer;
if (context->on_stack == 0)
kfree(context);
} else {
context->nr_children--;
#if REISER4_DEBUG
assert("zam-685", context->nr_children >= 0);
#endif
}
}
/*
* exit reiser4 context. Call balance_dirty_pages_at() if necessary. Close
* transaction. Call done_context() to do context related book-keeping.
*/
void reiser4_exit_context(reiser4_context * context)
{
assert("nikita-3021", reiser4_schedulable());
if (context->nr_children == 0) {
if (!context->nobalance) {
reiser4_txn_restart(context);
balance_dirty_pages_at(context);
}
/* if filesystem is mounted with -o sync or -o dirsync - commit
transaction. FIXME: TXNH_DONT_COMMIT is used to avoid
commiting on exit_context when inode semaphore is held and
to have ktxnmgrd to do commit instead to get better
concurrent filesystem accesses. But, when one mounts with -o
sync, he cares more about reliability than about
performance. So, for now we have this simple mount -o sync
support. */
if (context->super->s_flags & (MS_SYNCHRONOUS | MS_DIRSYNC)) {
txn_atom *atom;
atom = get_current_atom_locked_nocheck();
if (atom) {
atom->flags |= ATOM_FORCE_COMMIT;
context->trans->flags &= ~TXNH_DONT_COMMIT;
spin_unlock_atom(atom);
}
}
reiser4_txn_end(context);
}
reiser4_done_context(context);
}
void reiser4_ctx_gfp_mask_set(void)
{
reiser4_context *ctx;
ctx = get_current_context();
if (ctx->entd == 0 &&
list_empty(&ctx->stack.locks) &&
ctx->trans->atom == NULL)
ctx->gfp_mask = GFP_KERNEL;
else
ctx->gfp_mask = GFP_NOFS;
}
void reiser4_ctx_gfp_mask_force(gfp_t mask)
{
reiser4_context *ctx;
ctx = get_current_context();
assert("edward-1454", ctx != NULL);
ctx->gfp_mask = mask;
}
/*
* Local variables:
* c-indentation-style: "K&R"
* mode-name: "LC"
* c-basic-offset: 8
* tab-width: 8
* fill-column: 120
* scroll-step: 1
* End:
*/
/* Copyright 2001, 2002, 2003, 2004 by Hans Reiser, licensing governed by
* reiser4/README */
/* Reiser4 context. See context.c for details. */
#if !defined( __REISER4_CONTEXT_H__ )
#define __REISER4_CONTEXT_H__
#include "forward.h"
#include "debug.h"
#include "dformat.h"
#include "tap.h"
#include "lock.h"
#include <linux/types.h> /* for __u?? */
#include <linux/fs.h> /* for struct super_block */
#include <linux/spinlock.h>
#include <linux/sched.h> /* for struct task_struct */
/* reiser4 per-thread context */
struct reiser4_context {
/* magic constant. For identification of reiser4 contexts. */
__u32 magic;
/* current lock stack. See lock.[ch]. This is where list of all
locks taken by current thread is kept. This is also used in
deadlock detection. */
lock_stack stack;
/* current transcrash. */
txn_handle *trans;
/* transaction handle embedded into reiser4_context. ->trans points
* here by default. */
txn_handle trans_in_ctx;
/* super block we are working with. To get the current tree
use &get_super_private (reiser4_get_current_sb ())->tree. */
struct super_block *super;
/* parent fs activation */
struct fs_activation *outer;
/* per-thread grabbed (for further allocation) blocks counter */
reiser4_block_nr grabbed_blocks;
/* list of taps currently monitored. See tap.c */
struct list_head taps;
/* grabbing space is enabled */
unsigned int grab_enabled:1;
/* should be set when we are write dirty nodes to disk in jnode_flush or
* reiser4_write_logs() */
unsigned int writeout_mode:1;
/* true, if current thread is an ent thread */
unsigned int entd:1;
/* true, if balance_dirty_pages() should not be run when leaving this
* context. This is used to avoid lengthly balance_dirty_pages()
* operation when holding some important resource, like directory
* ->i_mutex */
unsigned int nobalance:1;
/* this bit is used on reiser4_done_context to decide whether context is
kmalloc-ed and has to be kfree-ed */
unsigned int on_stack:1;
/* count non-trivial jnode_set_dirty() calls */
unsigned long nr_marked_dirty;
/* reiser4_sync_inodes calls (via generic_sync_sb_inodes)
* reiser4_writepages for each of dirty inodes. Reiser4_writepages
* captures pages. When number of pages captured in one
* reiser4_sync_inodes reaches some threshold - some atoms get
* flushed */
int nr_captured;
int nr_children; /* number of child contexts */
#if REISER4_DEBUG
/* debugging information about reiser4 locks held by the current
* thread */
reiser4_lock_cnt_info locks;
struct task_struct *task; /* so we can easily find owner of the stack */
/*
* disk space grabbing debugging support
*/
/* how many disk blocks were grabbed by the first call to
* reiser4_grab_space() in this context */
reiser4_block_nr grabbed_initially;
/* list of all threads doing flush currently */
struct list_head flushers_link;
/* information about last error encountered by reiser4 */
err_site err;
#endif
void *vp;
gfp_t gfp_mask;
};
extern reiser4_context *get_context_by_lock_stack(lock_stack *);
/* Debugging helps. */
#if REISER4_DEBUG
extern void print_contexts(void);
#endif
#define current_tree (&(get_super_private(reiser4_get_current_sb())->tree))
#define current_blocksize reiser4_get_current_sb()->s_blocksize
#define current_blocksize_bits reiser4_get_current_sb()->s_blocksize_bits
extern reiser4_context *reiser4_init_context(struct super_block *);
extern void init_stack_context(reiser4_context *, struct super_block *);
extern void reiser4_exit_context(reiser4_context *);
/* magic constant we store in reiser4_context allocated at the stack. Used to
catch accesses to staled or uninitialized contexts. */
#define context_magic ((__u32) 0x4b1b5d0b)
extern int is_in_reiser4_context(void);
/*
* return reiser4_context for the thread @tsk
*/
static inline reiser4_context *get_context(const struct task_struct *tsk)
{
assert("vs-1682",
((reiser4_context *) tsk->journal_info)->magic == context_magic);
return (reiser4_context *) tsk->journal_info;
}
/*
* return reiser4 context of the current thread, or NULL if there is none.
*/
static inline reiser4_context *get_current_context_check(void)
{
if (is_in_reiser4_context())
return get_context(current);
else
return NULL;
}
static inline reiser4_context *get_current_context(void); /* __attribute__((const)); */
/* return context associated with current thread */
static inline reiser4_context *get_current_context(void)
{
return get_context(current);
}
static inline gfp_t reiser4_ctx_gfp_mask_get(void)
{
reiser4_context *ctx;
ctx = get_current_context_check();
return (ctx == NULL) ? GFP_KERNEL : ctx->gfp_mask;
}
void reiser4_ctx_gfp_mask_set(void);
void reiser4_ctx_gfp_mask_force (gfp_t mask);
/*
* true if current thread is in the write-out mode. Thread enters write-out
* mode during jnode_flush and reiser4_write_logs().
*/
static inline int is_writeout_mode(void)
{
return get_current_context()->writeout_mode;
}
/*
* enter write-out mode
*/
static inline void writeout_mode_enable(void)
{
assert("zam-941", !get_current_context()->writeout_mode);
get_current_context()->writeout_mode = 1;
}
/*
* leave write-out mode
*/
static inline void writeout_mode_disable(void)
{
assert("zam-942", get_current_context()->writeout_mode);
get_current_context()->writeout_mode = 0;
}
static inline void grab_space_enable(void)
{
get_current_context()->grab_enabled = 1;
}
static inline void grab_space_disable(void)
{
get_current_context()->grab_enabled = 0;
}
static inline void grab_space_set_enabled(int enabled)
{
get_current_context()->grab_enabled = enabled;
}
static inline int is_grab_enabled(reiser4_context * ctx)
{
return ctx->grab_enabled;
}
/* mark transaction handle in @ctx as TXNH_DONT_COMMIT, so that no commit or
* flush would be performed when it is closed. This is necessary when handle
* has to be closed under some coarse semaphore, like i_mutex of
* directory. Commit will be performed by ktxnmgrd. */
static inline void context_set_commit_async(reiser4_context * context)
{
context->nobalance = 1;
context->trans->flags |= TXNH_DONT_COMMIT;
}
/* __REISER4_CONTEXT_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:
*/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by
reiser4/README */
/* Formats of on-disk data and conversion functions. */
/* put all item formats in the files describing the particular items,
our model is, everything you need to do to add an item to reiser4,
(excepting the changes to the plugin that uses the item which go
into the file defining that plugin), you put into one file. */
/* Data on disk are stored in little-endian format.
To declare fields of on-disk structures, use d8, d16, d32 and d64.
d??tocpu() and cputod??() to convert. */
#if !defined(__FS_REISER4_DFORMAT_H__)
#define __FS_REISER4_DFORMAT_H__
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include <linux/types.h>
typedef __u8 d8;
typedef __le16 d16;
typedef __le32 d32;
typedef __le64 d64;
#define PACKED __attribute__((packed))
/* data-type for block number */
typedef __u64 reiser4_block_nr;
/* data-type for block number on disk, disk format */
typedef __le64 reiser4_dblock_nr;
/**
* disk_addr_eq - compare disk addresses
* @b1: pointer to block number ot compare
* @b2: pointer to block number ot compare
*
* Returns true if if disk addresses are the same
*/
static inline int disk_addr_eq(const reiser4_block_nr * b1,
const reiser4_block_nr * b2)
{
assert("nikita-1033", b1 != NULL);
assert("nikita-1266", b2 != NULL);
return !memcmp(b1, b2, sizeof *b1);
}
/* structure of master reiser4 super block */
typedef struct reiser4_master_sb {
char magic[16]; /* "ReIsEr4" */
__le16 disk_plugin_id; /* id of disk layout plugin */
__le16 blocksize;
char uuid[16]; /* unique id */
char label[16]; /* filesystem label */
__le64 diskmap; /* location of the diskmap. 0 if not present */
} reiser4_master_sb;
/* __FS_REISER4_DFORMAT_H__ */
#endif
/*
* Local variables:
* c-indentation-style: "K&R"
* mode-name: "LC"
* c-basic-offset: 8
* tab-width: 8
* fill-column: 79
* End:
*/
This diff is collapsed.
/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by
* reiser4/README */
/* Scalable on-disk integers. See dscale.h for details. */
#if !defined(__FS_REISER4_DSCALE_H__)
#define __FS_REISER4_DSCALE_H__
#include "dformat.h"
extern int dscale_read(unsigned char *address, __u64 *value);
extern int dscale_write(unsigned char *address, __u64 value);
extern int dscale_bytes_to_read(unsigned char *address);
extern int dscale_bytes_to_write(__u64 value);
extern int dscale_fit(__u64 value, __u64 other);
/* __FS_REISER4_DSCALE_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
End:
*/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/* Copyright 2001, 2002, 2003 by Hans Reiser, licensing governed by
* reiser4/README */
#if !defined(__REISER4_IOCTL_H__)
#define __REISER4_IOCTL_H__
#include <linux/fs.h>
/*
* ioctl(2) command used to "unpack" reiser4 file, that is, convert it into
* extents and fix in this state. This is used by applications that rely on
*
* . files being block aligned, and
*
* . files never migrating on disk
*
* for example, boot loaders (LILO) need this.
*
* This ioctl should be used as
*
* result = ioctl(fd, REISER4_IOC_UNPACK);
*
* File behind fd descriptor will be converted to the extents (if necessary),
* and its stat-data will be updated so that it will never be converted back
* into tails again.
*/
#define REISER4_IOC_UNPACK _IOW(0xCD, 1, long)
/* __REISER4_IOCTL_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:
*/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
obj-$(CONFIG_REISER4_FS) += compress_plugins.o
compress_plugins-objs := \
compress.o \
compress_mode.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
obj-$(CONFIG_REISER4_FS) += dir_plugins.o
dir_plugins-objs := \
hashed_dir.o \
seekable_dir.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment