summaryrefslogtreecommitdiff
path: root/fs/ocfs2
AgeCommit message (Collapse)AuthorFilesLines
2009-09-23ocfs2: Add support of decrementing refcount for delete.Tao Ma4-5/+265
Given a physical cpos and length, decrement the refcount in the tree. If the refcount for any portion of the extent goes to zero, that portion is queued for freeing. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Add support for incrementing refcount in the tree.Tao Ma4-7/+1073
Given a physical cpos and length, increment the refcount in the tree. If the extent has not been seen before, a refcount record is created for it. Refcount records may be merged or split by this operation. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: move tree path functions to alloc.h.Tao Ma2-53/+72
Now fs/ocfs2/alloc.c has more than 7000 lines. It contains our basic b-tree operation. Although we have already make our b-tree operation generic, the basic structrue ocfs2_path which is used to iterate one b-tree branch is still static and limited to only used in alloc.c. As refcount tree need them and I don't want to add any more b-tree unrelated code to alloc.c, export them out. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Add refcount b-tree as a new extent tree.Tao Ma2-0/+57
Add refcount b-tree as a new extent tree so that it can use the b-tree to store and maniuplate ocfs2_refcount_rec. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Abstract extent split process.Tao Ma1-50/+100
ocfs2_mark_extent_written actually does the following things: 1. check the parameters. 2. initialize the left_path and split_rec. 3. call __ocfs2_mark_extent_written. it will do: 1) check the flags of unwritten 2) do the real split work. The whole process is packed tightly somehow. So this patch will abstract 2 different functions so that future b-tree operation can work with it. 1. __ocfs2_split_extent will accept path and split_rec and do the real split work. 2. ocfs2_change_extent_flag will accept a new flag and initialize path and split_rec. So now ocfs2_mark_extent_written will do: 1. check the parameters. 2. call ocfs2_change_extent_flag. 1) initalize the left_path and split_rec. 2) check whether the new flags conflict with the old one. 3) call __ocfs2_split_extent to do the split. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Wrap ocfs2_extent_contig in ocfs2_extent_tree.Tao Ma1-16/+41
Add a new operation eo_ocfs2_extent_contig int the extent tree's operations vector. So that with the new refcount tree, We want this so that refcount trees can always return CONTIG_NONE and prevent extent merging. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Basic tree root operation.Tao Ma2-6/+353
Add basic refcount tree root operation. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Add refcount tree lock mechanism.Tao Ma4-0/+375
Implement locking around struct ocfs2_refcount_tree. This protects all read/write operations on refcount trees. ocfs2_refcount_tree has its own lock and its own caching_info, protecting buffers among multiple nodes. User must call ocfs2_lock_refcount_tree before his operation on the tree and unlock it after that. ocfs2_refcount_trees are referenced by the block number of the refcount tree root block, So we create an rb-tree on the ocfs2_super to look them up. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Add caching info for refcount tree.Tao Ma1-0/+59
refcount tree should use its own caching info so that when we downconvert the refcount tree lock, we can drop all the cached buffer head. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Add new refcount tree lock resource in dlmglue.Tao Ma4-0/+127
refcount tree lock resource is used to protect refcount tree read/write among multiple nodes. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Abstract caching info checkpoint.Tao Ma1-5/+13
In meta downconvert, we need to checkpoint the metadata in an inode. For refcount tree, we also need it. So abstract the process out. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Add ocfs2_read_refcount_block.Tao Ma5-0/+105
Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Add metaecc for ocfs2_refcount_block.Tao Ma2-0/+18
Add metaecc and journal trigger for ocfs2_refcount_block. Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-23ocfs2: Define refcount tree structure.Tao Ma1-3/+85
Signed-off-by: Tao Ma <tao.ma@oracle.com>
2009-09-22Merge branch 'for-linus' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (34 commits) trivial: fix typo in aic7xxx comment trivial: fix comment typo in drivers/ata/pata_hpt37x.c trivial: typo in kernel-parameters.txt trivial: fix typo in tracing documentation trivial: add __init/__exit macros in drivers/gpio/bt8xxgpio.c trivial: add __init macro/ fix of __exit macro location in ipmi_poweroff.c trivial: remove unnecessary semicolons trivial: Fix duplicated word "options" in comment trivial: kbuild: remove extraneous blank line after declaration of usage() trivial: improve help text for mm debug config options trivial: doc: hpfall: accept disk device to unload as argument trivial: doc: hpfall: reduce risk that hpfall can do harm trivial: SubmittingPatches: Fix reference to renumbered step trivial: fix typos "man[ae]g?ment" -> "management" trivial: media/video/cx88: add __init/__exit macros to cx88 drivers trivial: fix typo in CONFIG_DEBUG_FS in gcov doc trivial: fix missing printk space in amd_k7_smp_check trivial: fix typo s/ketymap/keymap/ in comment trivial: fix typo "to to" in multiple files trivial: fix typos in comments s/DGBU/DBGU/ ...
2009-09-22const: make struct super_block::s_qcop constAlexey Dobriyan1-1/+1
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-22const: make struct super_block::dq_op constAlexey Dobriyan2-2/+2
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-21trivial: remove unnecessary semicolonsJoe Perches1-1/+1
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-09-16HWPOISON: Enable .remove_error_page for migration aware file systemsAndi Kleen1-0/+1
Enable removing of corrupted pages through truncation for a bunch of file systems: ext*, xfs, gfs2, ocfs2, ntfs These should cover most server needs. I chose the set of migration aware file systems for this for now, assuming they have been especially audited. But in general it should be safe for all file systems on the data area that support read/write and truncate. Caveat: the hardware error handler does not take i_mutex for now before calling the truncate function. Is that ok? Cc: tytso@mit.edu Cc: hch@infradead.org Cc: mfasheh@suse.com Cc: aia21@cantab.net Cc: hugh.dickins@tiscali.co.uk Cc: swhiteho@redhat.com Signed-off-by: Andi Kleen <ak@linux.intel.com>
2009-09-14ocfs2: Update syncing after splicing to match generic versionJan Kara1-21/+6
Update ocfs2 specific splicing code to use generic syncing helper. The sync now does not happen under rw_lock because generic_write_sync() acquires i_mutex which ranks above rw_lock. That should not matter because standard fsync path does not hold it either. Acked-by: Joel Becker <Joel.Becker@oracle.com> Acked-by: Mark Fasheh <mfasheh@suse.com> CC: ocfs2-devel@oss.oracle.com Signed-off-by: Jan Kara <jack@suse.cz>
2009-09-14ocfs2: Use __generic_file_aio_write instead of generic_file_aio_write_nolockJan Kara1-10/+12
Use the new helper. We have to submit data pages ourselves in case of O_SYNC write because __generic_file_aio_write does not do it for us. OCFS2 developpers might think about moving the sync out of i_mutex which seems to be easily possible but that's out of scope of this patch. CC: ocfs2-devel@oss.oracle.com Acked-by: Joel Becker <joel.becker@oracle.com> Signed-off-by: Jan Kara <jack@suse.cz>
2009-09-11writeback: add name to backing_dev_infoJens Axboe1-0/+1
This enables us to track who does what and print info. Its main use is catching dirty inodes on the default_backing_dev_info, so we can fix that up. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2009-09-06Merge branch 'upstream-linus' of ↵Linus Torvalds2-2/+13
git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2 * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2: ocfs2: ocfs2_write_begin_nolock() should handle len=0 ocfs2: invalidate dentry if its dentry_lock isn't initialized.
2009-09-05ocfs2: Pass ocfs2_caching_info into ocfs_init_*_extent_tree().Joel Becker6-30/+35
With this commit, extent tree operations are divorced from inodes and rely on ocfs2_caching_info. Phew! Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: __ocfs2_mark_extent_written() doesn't need struct inode.Joel Becker1-4/+3
We only allow unwritten extents on data, so the toplevel ocfs2_mark_extent_written() can use an inode all it wants. But the subfunction isn't even using the inode argument. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: Teach ocfs2_replace_extent_rec() to use an extent_tree.Joel Becker1-5/+4
Don't use a struct inode anymore. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_split_and_insert() no longer needs struct inode.Joel Becker1-6/+5
It already has an extent_tree. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_remove_extent() no longer needs struct inode.Joel Becker3-24/+25
One more generic btree function that is isolated from struct inode. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_add_clusters_in_btree() no longer needs struct inode.Joel Becker4-19/+14
One more function that doesn't need a struct inode to pass to its children. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_insert_extent() no longer needs struct inode.Joel Becker4-22/+15
One more function down, no inode in the entire insert-extent chain. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: Make extent map insertion an extent_tree_operation.Joel Becker1-2/+27
ocfs2_insert_extent() wants to insert a record into the extent map if it's an inode data extent. But since many btrees can call that function, let's make it an op on ocfs2_extent_tree. Other tree types can leave it empty. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_figure_insert_type() no longer needs struct inode.Joel Becker1-3/+2
It's not using it, so remove it from the parameter list. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: Remove inode from ocfs2_figure_extent_contig().Joel Becker1-7/+6
It already has an ocfs2_extent_tree and doesn't need the inode. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: Swap inode for extent_tree in ocfs2_figure_merge_contig_type().Joel Becker1-13/+13
We don't want struct inode in generic btree operations. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_extent_contig() only requires the superblock.Joel Becker1-6/+6
Don't pass the inode in. We don't want it around for generic btree operations. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_do_insert_extent() and ocfs2_insert_path() no longer need an inode.Joel Becker1-8/+6
They aren't using it, so remove it from their parameter lists. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: Give ocfs2_split_record() an extent_tree instead of an inode.Joel Becker1-3/+4
Another on the way to generic btree functions. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_insert_at_leaf() doesn't need struct inode.Joel Becker1-9/+10
Give it an ocfs2_extent_tree and it is happy. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: Make truncating the extent map an extent_tree_operation.Joel Becker1-6/+31
ocfs2_remove_extent() wants to truncate the extent map if it's truncating an inode data extent. But since many btrees can call that function, let's make it an op on ocfs2_extent_tree. Other tree types can leave it empty. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_truncate_rec() doesn't need struct inode.Joel Becker1-13/+13
It's not using it anymore. Remove it from the parameter list. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_grow_branch() and ocfs2_append_rec_to_path() lose struct inode.Joel Becker1-44/+36
ocfs2_grow_branch() not really using it other than to pass it to the subfunctions ocfs2_shift_tree_depth(), ocfs2_find_branch_target(), and ocfs2_add_branch(). The first two weren't it either, so they drop the argument. ocfs2_add_branch() only passed it to ocfs2_adjust_rightmost_branch(), which drops the inode argument and uses the ocfs2_extent_tree as well. ocfs2_append_rec_to_path() can be take an ocfs2_extent_tree instead of the inode. The function ocfs2_adjust_rightmost_records() goes along for the ride. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_try_to_merge_extent() doesn't need struct inode.Joel Becker1-7/+5
It's not using it, so remove it from the parameter list. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_merge_rec_left/right() no longer need struct inode.Joel Becker1-30/+24
Drop it from the parameters - they already have ocfs2_extent_list. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_rotate_tree_left() no longer needs struct inode.Joel Becker1-30/+26
It already gets ocfs2_extent_tree, so we can just use that. This chains to the same modification for ocfs2_remove_rightmost_path() and ocfs2_rotate_rightmost_leaf_left(). Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: __ocfs2_rotate_tree_left() doesn't need struct inode.Joel Becker1-12/+12
It already has struct ocfs2_extent_tree, which has the caching info. So we don't need to pass it struct inode. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_rotate_subtree_left() doesn't need struct inode.Joel Becker1-9/+9
It already has struct ocfs2_extent_tree, which has the caching info. So we don't need to pass it struct inode. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_update_edge_lengths() doesn't need struct inode.Joel Becker1-4/+5
Pass in the extent tree, which is all we need. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: ocfs2_rotate_tree_right() doesn't need struct inode.Joel Becker1-2/+2
We don't need struct inode in ocfs2_rotate_tree_right() anymore. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: Drop struct inode from ocfs2_extent_tree_operations.Joel Becker3-59/+44
We can get to the inode from the caching information. Other parent types don't need it. Signed-off-by: Joel Becker <joel.becker@oracle.com>
2009-09-05ocfs2: Pass ocfs2_extent_tree to ocfs2_get_subtree_root()Joel Becker1-25/+27
Get rid of the inode argument. Use extent_tree instead. This means a few more functions have to pass an extent_tree around. Signed-off-by: Joel Becker <joel.becker@oracle.com>