]> git.neil.brown.name Git - LaFS.git/log
LaFS.git
15 years agoinode_orphan: convert do-while to a normal while.
NeilBrown [Thu, 10 Jun 2010 06:24:05 +0000 (16:24 +1000)]
inode_orphan: convert do-while to a normal while.

The justification for the do-while has long since gone,
so use a more natural while loop.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoREADME update
NeilBrown [Thu, 10 Jun 2010 06:15:45 +0000 (16:15 +1000)]
README update

15 years agoinclude iolock info in strblk
NeilBrown [Thu, 10 Jun 2010 06:12:49 +0000 (16:12 +1000)]
include iolock info in strblk

Also make sure info is useful when iolock_written is used.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agogrow_index_tree: handle B_Root correctly
NeilBrown [Thu, 10 Jun 2010 06:02:14 +0000 (16:02 +1000)]
grow_index_tree: handle B_Root correctly

When a grow the index tree for the root inode, the B_Root
bit needs to be moved to the new block.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoEnsure indexblock is clean when truncate finished.
NeilBrown [Thu, 10 Jun 2010 05:57:07 +0000 (15:57 +1000)]
Ensure indexblock is clean when truncate finished.

When truncate finishes and we are about to delete the inode,
we need to have the index block clean and unpinned so it can disappear
cleanly.
lafs_cluster_allocate nicely does this for us.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoAvoid deadlock between orphan-truncate and cluster-write
NeilBrown [Thu, 10 Jun 2010 05:52:45 +0000 (15:52 +1000)]
Avoid deadlock between orphan-truncate and cluster-write

If, during truncate, we find an index block in writeback,
we need to give up on the orphan and return back up
to the cleaner thread so that the writeback can be
properly handled.
Otherwise the cleaner thread is blocked waiting for the cleaner thread
to make progress.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agocorrect arg to kfree in refile
NeilBrown [Thu, 10 Jun 2010 05:39:38 +0000 (15:39 +1000)]
correct arg to kfree in refile

'b' is a struct-block, technically a virtual type.
Need to get container_of - dblk in this case - before calling
kfree.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agolafs_iblock_alloc: remove duplicate assignment
NeilBrown [Thu, 10 Jun 2010 05:38:22 +0000 (15:38 +1000)]
lafs_iblock_alloc: remove duplicate assignment

Signed-off-by: <neilb@suse.de>
15 years agoCheck still dirty before calling cluster_allocate
NeilBrown [Thu, 10 Jun 2010 05:36:55 +0000 (15:36 +1000)]
Check still dirty before calling cluster_allocate

If we wait (iolock) before calling cluster_allocate we need to check
again if it is dirty, as cluster_allocate only likes dirty/realloc
blocks.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoIntroduce constants for 'sync' and 'adopt' flags.
NeilBrown [Wed, 9 Jun 2010 03:55:00 +0000 (13:55 +1000)]
Introduce constants for 'sync' and 'adopt' flags.

This is much better than having '0' and '1' and arguments in hard to
remember places.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoSet PrimaryRef in do_incorporate_internal
NeilBrown [Wed, 9 Jun 2010 03:45:05 +0000 (13:45 +1000)]
Set PrimaryRef in do_incorporate_internal

Add primaryref handling in do_incorporate_internal to
match do_incorporate_leaf.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoFix Primary Ref counting when removing an unincorporated block.
NeilBrown [Wed, 9 Jun 2010 03:40:07 +0000 (13:40 +1000)]
Fix Primary Ref counting when removing an unincorporated block.

incorp_index did the wrong thing here, and we didn't differentiate
where in a primary_ref chain we were.
Fixed now I hope.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoFix handling of empty index blocks during incorporation.
NeilBrown [Wed, 9 Jun 2010 03:23:14 +0000 (13:23 +1000)]
Fix handling of empty index blocks during incorporation.

If an index block becomes empty we incorporate the address space into
the next index block, and so need to update the address of the leading
children and fix the indexes in the parent properly.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoFix problem with mobility of internal index blocks.
NeilBrown [Wed, 9 Jun 2010 02:14:07 +0000 (12:14 +1000)]
Fix problem with mobility of internal index blocks.

As index blocks can change address if they are or become the first
block in the parent, we must not put too much weight on the first
address stored in an internal index block - it must always be treated
as the same as the address of that internal index block.

So pass around the current block's address where needed, and use it in
preference to the first address recorded in the block.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agolafs_incorporate: bug on not dirty.
NeilBrown [Tue, 8 Jun 2010 08:25:18 +0000 (18:25 +1000)]
lafs_incorporate: bug on not dirty.

We already had some of these, but a few more doesn't hurt :-)

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoremove_from_index: various fixes.
NeilBrown [Tue, 8 Jun 2010 08:22:39 +0000 (18:22 +1000)]
remove_from_index: various fixes.

1/ Skip offset for InoIdx
2/ when moving address down, clear the space at the end
3/ stop when we find the last address.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agolafs_walk_leaf_index
NeilBrown [Tue, 8 Jun 2010 08:18:59 +0000 (18:18 +1000)]
lafs_walk_leaf_index

remove stray handler initialisation.
Both walk_indirect and walk_extent do an initialisation
so there is no point doing another one.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agowalk_extent: don't keep walking past the end of the list of addresses
NeilBrown [Tue, 8 Jun 2010 08:15:54 +0000 (18:15 +1000)]
walk_extent:  don't keep walking past the end of the list of addresses

Once we find a len of 0, there is nothing more worth finding.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoadd_extent fixes.
NeilBrown [Tue, 8 Jun 2010 08:13:13 +0000 (18:13 +1000)]
add_extent fixes.

add_extent tries to detect consecutive extents being added
and merges them.  But it got it wrong.
So change last* to actually refer to the "next" and get it right.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agotruncate: fixes for pruning addresses.
NeilBrown [Tue, 8 Jun 2010 08:10:37 +0000 (18:10 +1000)]
truncate: fixes for pruning addresses.

1/ after pruning addresses, we need to clear the index block
2/ InoIdx blocks don't follow the rule that physaddr==0 means empty.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agotruncate: can only safely lafs_incorporate dirty blocks.
NeilBrown [Tue, 8 Jun 2010 08:07:59 +0000 (18:07 +1000)]
truncate: can only safely lafs_incorporate dirty blocks.

So if the block isn't dirty, don't try.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoSet depth to 0 when InoIdx becomes empty.
NeilBrown [Tue, 8 Jun 2010 07:49:04 +0000 (17:49 +1000)]
Set depth to 0 when InoIdx becomes empty.

The code set depth to zero always, which is clearly broken.

We don't incrementally reduce the height of an indexing tree as it
shrinks.  Rather the high remains at the max until it is completely
empty, then it suddenly becomes zero.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoClear B_OnFree when removing from freelist.
NeilBrown [Tue, 8 Jun 2010 07:32:57 +0000 (17:32 +1000)]
Clear B_OnFree when removing from freelist.

This isn't strictly necessary as if refile want to use the
LRU for something else, it will clear this bit.
However clearing it both places makes for more consistency and less
confusing data structures.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoREADME sync
NeilBrown [Mon, 7 Jun 2010 03:23:59 +0000 (13:23 +1000)]
README sync

and typo fix

15 years agoRemove stray test is inode_handle_orphan
NeilBrown [Mon, 7 Jun 2010 03:20:08 +0000 (13:20 +1000)]
Remove stray test is inode_handle_orphan

As we no longer clear B_Valid on empty index blocks,
there is no point or need to test for it.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoBUG_ON in lafs_allocated_block.
NeilBrown [Mon, 7 Jun 2010 03:18:43 +0000 (13:18 +1000)]
BUG_ON in lafs_allocated_block.

We never allocate an InoIdx block - on the data block.
So add a BUG check.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoFix a BUG_ON in lafs_erase_dblock
NeilBrown [Mon, 7 Jun 2010 03:16:45 +0000 (13:16 +1000)]
Fix a BUG_ON  in lafs_erase_dblock

As we no longer clear the Valid flag on index blocks when
they become empty, we can no longer trigger a bug if it
is still set.
However depth should definitely be 0, so test for that.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoAdd some error checking to lafs_mount
NeilBrown [Mon, 7 Jun 2010 03:13:54 +0000 (13:13 +1000)]
Add some error checking to lafs_mount

i.e. just return the error code if there is one.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoMake sure find_block loads data from inode.
NeilBrown [Mon, 7 Jun 2010 01:30:48 +0000 (11:30 +1000)]
Make sure find_block loads data from inode.

lafs_load_block expects not to need to read block 0
of a depth==0 inode as lafs_find_block is expected to
load that.
However there is a case where find_block (called from lafs_find_block)
skips the load.  So remove that case.

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoFix compile warning / incorrect test.
NeilBrown [Mon, 7 Jun 2010 01:27:33 +0000 (11:27 +1000)]
Fix compile warning / incorrect test.

New compiler noticed this...

Signed-off-by: NeilBrown <neilb@suse.de>
15 years agoDon't clear B_Valid when index block is empty
NeilBrown [Mon, 28 Sep 2009 02:32:48 +0000 (12:32 +1000)]
Don't clear B_Valid when index block is empty

This overloading just caused problem. Invent a new flag instead.

16 years agoincorporate: handle empty block correctly.
NeilBrown [Mon, 28 Sep 2009 02:26:29 +0000 (12:26 +1000)]
incorporate: handle empty block correctly.

When a block becomes empty, we need to remove it from the
indexing tree, causing the next block to take over the address
space if possible, else maybe the previous block.

16 years agoFORMAT CHANGE - include start address explicitly in indirect blocks.
NeilBrown [Mon, 28 Sep 2009 00:16:17 +0000 (10:16 +1000)]
FORMAT CHANGE - include start address explicitly in indirect blocks.

By storing the address of the first block in an indirect block,
that block can be relocated in the index tree with no adverse effects.
This makes it easier to handle blocks that have become empty.

So an indirect block now contains:
   u16 0x01   'indirect' indicator
   u32 addr   virtual address of first indexed block
   u48 paddr  physical address of first indexblock block
   u48 paddr2 next block ... etc

16 years agoREADME notes for changes to index management.
NeilBrown [Mon, 28 Sep 2009 00:16:15 +0000 (10:16 +1000)]
README notes for changes to index management.

16 years agoHandle index blocks becoming empty better.
NeilBrown [Mon, 28 Sep 2009 00:16:13 +0000 (10:16 +1000)]
Handle index blocks becoming empty better.

MORE TEXT HERE

16 years agoDon't lose path to index blocks that haven't been incorporated
NeilBrown [Mon, 28 Sep 2009 00:16:02 +0000 (10:16 +1000)]
Don't lose path to index blocks that haven't been incorporated

Before a new index block is incorporated, we can find it only by
finding a sibling and walking the sibling list.
If that primary sibling gets released, the new block becomes
unfindable.
So hold a reference to such primaries until incorporation,
and ensure that there is always a primary in the same parent
by incorporating more promptly after a split.

16 years agoGroup B_ flags by which sort of block they apply to.
NeilBrown [Sun, 13 Sep 2009 23:47:59 +0000 (09:47 +1000)]
Group B_ flags by which sort of block they apply to.

This will allow us to overlap the 'Data' and 'Index' groups
later if that proves necessary.

16 years agodir: replace wrong constant with correct symbolic version.
NeilBrown [Thu, 3 Sep 2009 06:07:45 +0000 (16:07 +1000)]
dir: replace wrong constant with correct symbolic version.

16 years agoDrop excess 'clean2' reference.
NeilBrown [Thu, 3 Sep 2009 05:54:15 +0000 (15:54 +1000)]
Drop excess 'clean2' reference.

16 years agolafs_wait_block fixes
NeilBrown [Thu, 3 Sep 2009 05:46:38 +0000 (15:46 +1000)]
lafs_wait_block fixes

If the block is already Valid, there is no need to wait for
it to be unlocked.
This avoids extra async blocks lying around.

16 years agoAvoid flushing inodes too soon.
NeilBrown [Thu, 3 Sep 2009 05:46:24 +0000 (15:46 +1000)]
Avoid flushing inodes too soon.

I'm not 100% sure of this, but it seems write.  Inode data blocks
don't have PinPending, rather the inode block is Pinned.

16 years agoMultiple improvements to inode dirtying
NeilBrown [Thu, 3 Sep 2009 05:28:22 +0000 (15:28 +1000)]
Multiple improvements to inode dirtying

- in a few places we didn't called dirty_inode when we should have
  done.
- after inode_{inc,dec}_link_count we don't need to dirty the inode
  because it has already been done.
- handle I_Dirty properly rather than unpinning the block
- allocate NCredits for inodes so that I_Dirty can succeed.

16 years agoREADME update
NeilBrown [Thu, 3 Sep 2009 05:28:21 +0000 (15:28 +1000)]
README update

16 years agoFix clearing of PinPending
NeilBrown [Thu, 3 Sep 2009 05:28:21 +0000 (15:28 +1000)]
Fix clearing of PinPending

PinPending must be cleared after marking dirty, not before.

16 years agoAdd support for unattended testing.
NeilBrown [Thu, 3 Sep 2009 05:28:21 +0000 (15:28 +1000)]
Add support for unattended testing.

Make sure the qemu exits when a test completes, and always
capture the kernel output.

16 years agounmount: push orphan handling along.
NeilBrown [Thu, 3 Sep 2009 05:28:21 +0000 (15:28 +1000)]
unmount: push orphan handling along.

Just waiting for the thread to do it doesn't seem to be
enough.

16 years agolafs_find_orphan: always release the lock.
NeilBrown [Thu, 3 Sep 2009 05:28:21 +0000 (15:28 +1000)]
lafs_find_orphan: always release the lock.

Forgot to unlock on the "not found" path.

16 years agoFixed to run_orphans.
NeilBrown [Thu, 3 Sep 2009 05:28:21 +0000 (15:28 +1000)]
Fixed to run_orphans.

We need to hold a reference to the db, as orphan_release
can drop it.
And an unclaimed inode block with no mx is always free to
be orphan_released.

16 years agoMove unmap_dblock closer to map.
NeilBrown [Thu, 3 Sep 2009 05:28:20 +0000 (15:28 +1000)]
Move unmap_dblock closer to map.

As this is an atomic region, keep it as short as possible.

16 years agoFix pruning of orphan file.
NeilBrown [Thu, 3 Sep 2009 05:28:20 +0000 (15:28 +1000)]
Fix pruning of orphan file.

The test for "now beyond EOF" was all wrong.

16 years agoDon't add Credits to Dirty blocks.
NeilBrown [Thu, 3 Sep 2009 05:28:20 +0000 (15:28 +1000)]
Don't add Credits to Dirty blocks.

If the Credit has moved to Dirty, we don't need to add
another one during prealloc.
Doing so means that prealloc can fail on a block which is
already adequately allocated.

16 years agoAdd some more "temp_credits" assignment to improve credit-watch
NeilBrown [Thu, 3 Sep 2009 05:28:20 +0000 (15:28 +1000)]
Add some more "temp_credits" assignment to improve credit-watch

16 years agoClear physaddr when growing an index tree.
NeilBrown [Thu, 3 Sep 2009 05:28:19 +0000 (15:28 +1000)]
Clear physaddr when growing an index tree.

The InoIdx block probably shouldn't have a phys address,
but we must be certainly it doesn't after a grow caused it to
not be an InoIdx block any more, else accounting will get
confused when we allocate it to another block.

16 years agoRelease the orphan status when finished deleting an inode.
NeilBrown [Thu, 3 Sep 2009 05:28:19 +0000 (15:28 +1000)]
Release the orphan status when finished deleting an inode.

and ensure that if the orphan_release fails, a subsequent attempt
has a chance of doing the right thing.

16 years agoBe sure to alway unlock new inodes.
NeilBrown [Thu, 3 Sep 2009 05:28:19 +0000 (15:28 +1000)]
Be sure to alway unlock new inodes.

All error paths must unlock the new inode.
And make sure nlink is 0 so that it will not be cached.

16 years agocorrectly handle attempt to load inode that is being deleted.
NeilBrown [Thu, 3 Sep 2009 05:28:19 +0000 (15:28 +1000)]
correctly handle attempt to load inode that is being deleted.

Make sure to return ENOENT in this case.

16 years agoInitialise empty index block during allocation.
NeilBrown [Thu, 3 Sep 2009 05:28:18 +0000 (15:28 +1000)]
Initialise empty index block during allocation.

I'm still not sure about this handling of empty index blocks,
but leaving it invalid certainly isn't correct.  I have to
initialise it and make it valid.

16 years agoAvoid inadvertently flush blocks that are in middle of a transaction.
NeilBrown [Thu, 3 Sep 2009 05:28:15 +0000 (15:28 +1000)]
Avoid inadvertently flush blocks that are in middle of a transaction.

If a directory block has PinPending, then a transaction is in progress
and flushing the block (e.g. pdflush) would be a bad idea, as we could
lose the credit before the final update.

16 years agoComplete proper pinning dir_handle_orphans.
NeilBrown [Wed, 2 Sep 2009 00:55:20 +0000 (10:55 +1000)]
Complete proper pinning dir_handle_orphans.

If the orphan handler is going to dirty a block, it must
first pin it (and check for errors), and must afterwards remove
the PinPending.
One of the places which caused change did this.  The other didn't.

16 years agoFix orphan flushing in rmdir
NeilBrown [Wed, 2 Sep 2009 00:55:20 +0000 (10:55 +1000)]
Fix orphan flushing in rmdir

lafs_dir_handle_orphan no longer requires drop_orphan,
and can drop the reference to the orphan block.
So we need to hold our own so we can test if it is still
and orphan after handling (in which case we must wait).

16 years agoFix beyond-eof check when cleaning
NeilBrown [Wed, 2 Sep 2009 00:55:20 +0000 (10:55 +1000)]
Fix beyond-eof check when cleaning

special files don't maintain i_size, so we must not compare against
that when cleaning them.

16 years agoRemove incorrect BUG_ON in checkpoint.
NeilBrown [Wed, 2 Sep 2009 00:55:20 +0000 (10:55 +1000)]
Remove incorrect BUG_ON in checkpoint.

It seems that this list can be empty fairly often without
any problems caused - I was afraid of infinite loops as it appears
there is nothing to do.
Maybe it is just the waiting that is needed.

16 years agoRemove incorrect assumption from erase_dblock
NeilBrown [Wed, 2 Sep 2009 00:55:07 +0000 (10:55 +1000)]
Remove incorrect assumption from erase_dblock

When erasing a pinned dblock, it might not be on the leaf list.
The fact that we have it locked can mean that it wasn't put there
yet.
So check leaf list membership explicitly.

Note that it cannot be in write-back, as we should have
waited for any writeback to finish, and won't have started any.

16 years agoAdd alloc_type to lafs_pin_dblock
NeilBrown [Wed, 2 Sep 2009 00:10:04 +0000 (10:10 +1000)]
Add alloc_type to lafs_pin_dblock

This is particularly needed for make_orphan which needs
to allocate new blocks sometimes just to delete files.

16 years agoImprove inode orphan handling.
NeilBrown [Wed, 2 Sep 2009 00:10:03 +0000 (10:10 +1000)]
Improve inode orphan handling.

And inode can be an orphan for an extended period of time and
should not be on the pending_orphans list all that time.
So we need to remove it if nothing needs doing for now, and
add it back on when it requires attention.

16 years agoImprove lafs_run_orphans list handling.
NeilBrown [Wed, 2 Sep 2009 00:10:03 +0000 (10:10 +1000)]
Improve lafs_run_orphans list handling.

Requiring the 'handle' routines to leave the orphan on the list and
then removing it if B_Orphan isn't set is not appropriate as we will
want to remove block while they still have B_Orphan set.
So do the list management differently to still ensure a single pass
through without needing the current block to hold our place.

16 years agoRemove special handling for i_nlink when reading inodes.
NeilBrown [Wed, 2 Sep 2009 00:09:52 +0000 (10:09 +1000)]
Remove special handling for i_nlink when reading inodes.

This was never "right" and is confusing orphan handling.
We should not lose those blocks anymore but if we do we need a better
fix.

16 years agoFlush orphans before failing rmdir due to not being empty.
NeilBrown [Wed, 2 Sep 2009 00:09:51 +0000 (10:09 +1000)]
Flush orphans before failing rmdir due to not being empty.

Before we can be sure if a directory is empty, we need to
flush and orphans that might be holding space in the directory
in use.  Only then can a check on the file size be meaningful.

16 years agoRun orphans from the cleaner thread, not immediately.
NeilBrown [Wed, 2 Sep 2009 00:09:49 +0000 (10:09 +1000)]
Run orphans from the cleaner thread, not immediately.

This involves:

 making dir_handle_orphans and inode_handle_orphans non-blocking.
 removing lots of explicit calls to handle_orphans.

16 years agomake lafs_leaf_find properly async
NeilBrown [Wed, 2 Sep 2009 00:09:07 +0000 (10:09 +1000)]
make lafs_leaf_find properly async

The new iolock_block calls weren't honouring 'async'.
So fix that.

16 years agolafs_make_orphan_nb - non-blocking version.
NeilBrown [Thu, 27 Aug 2009 01:51:03 +0000 (11:51 +1000)]
lafs_make_orphan_nb - non-blocking version.

We will need to in the 'dir' orphan handler which itself
needs to be non-blocking.

16 years agoFurther tidy up for make_orphan
NeilBrown [Thu, 27 Aug 2009 01:46:02 +0000 (11:46 +1000)]
Further tidy up for make_orphan

Move the calls to orphan_abort and orphan_commit into make_orphan
to follow the pattern used elsewhere.
This requires moving the i_mutex lock out into make_orphan,
but otherwise seems to be a good improvement.

16 years agoSplit orphan_commit out from orphan_pin
NeilBrown [Thu, 27 Aug 2009 01:46:01 +0000 (11:46 +1000)]
Split orphan_commit out from orphan_pin

It seems to work better as a separate function.

16 years agoUse orphan_abort in lafs_orphan_release
NeilBrown [Thu, 27 Aug 2009 01:46:00 +0000 (11:46 +1000)]
Use orphan_abort in lafs_orphan_release

lafs_orphan_release currently open-codes all of orphan_abort,
except the i_mutex locking is a bit different.  So change locking
rules for orphan_abort, then use that directly in lafs_orphan_release.

16 years agoGet rid of orphan_info structure.
NeilBrown [Thu, 27 Aug 2009 01:45:59 +0000 (11:45 +1000)]
Get rid of orphan_info structure.

It no longer contains anything really useful...

16 years agoTidy up release_orphan
NeilBrown [Thu, 27 Aug 2009 01:45:58 +0000 (11:45 +1000)]
Tidy up release_orphan

In particular it need to pin the dblocks, be async and get all the
references right.

16 years agoOrphan: simplify orphan creation.
NeilBrown [Thu, 27 Aug 2009 01:45:56 +0000 (11:45 +1000)]
Orphan:  simplify orphan creation.

We don't need to synchronise orphan creation with other parts of
direct ops etc.  We just make the block into an orphan if we
think that might be needed.  If this gets committed in a previous
checkpoint, there is no problem.

This simplifies things a lot and lets us get rid of some races.

16 years agoDiscard lafs_inode_prepare
NeilBrown [Wed, 26 Aug 2009 10:06:14 +0000 (20:06 +1000)]
Discard lafs_inode_prepare

This function has minimal content, and there is no matching
lafs_inode_pin, lafs_inode_commit etc.  So just remove it and
open-code instead.

16 years agoRemove some outdated comments.
NeilBrown [Wed, 26 Aug 2009 06:46:31 +0000 (16:46 +1000)]
Remove some outdated comments.

and some code that is pointless (dmap_dblock is identical to
map_dblock).

16 years agodir: fix use-after-put ordering error.
NeilBrown [Wed, 26 Aug 2009 06:26:12 +0000 (16:26 +1000)]
dir: fix use-after-put ordering error.

16 years agoumount: wait for last cluster to be written.
NeilBrown [Tue, 25 Aug 2009 07:21:30 +0000 (17:21 +1000)]
umount: wait for last cluster to be written.

checkpoint_unlock_wait only wait for the last cluster
to start.  We need to wait for all writes to be complete so
that no inodes remained pinned.

16 years agoAccount for some more temporary credits.
NeilBrown [Tue, 25 Aug 2009 07:09:55 +0000 (17:09 +1000)]
Account for some more temporary credits.

This might save us from a few check_credits warnings.

16 years agoDocumentation updates and some BUG_ON and tracing.
NeilBrown [Tue, 25 Aug 2009 07:09:55 +0000 (17:09 +1000)]
Documentation updates and some BUG_ON and tracing.

16 years agoSlight improvement in tracing in orphan_pin
NeilBrown [Tue, 25 Aug 2009 07:09:55 +0000 (17:09 +1000)]
Slight improvement in tracing in orphan_pin

16 years agoRename share_uninic to share_uninc
NeilBrown [Tue, 25 Aug 2009 07:09:55 +0000 (17:09 +1000)]
Rename  share_uninic to share_uninc

As the former is a typo.

16 years agoAvoid confusion with ref name "orphans"
NeilBrown [Tue, 25 Aug 2009 07:09:55 +0000 (17:09 +1000)]
Avoid confusion with ref name "orphans"

Two different places use the reference name "orphans", so change one
to avoid confusion.

16 years agoDemote check_credits from BUG to WARNING.
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
Demote check_credits from BUG to WARNING.

Races and other things can cause inbalances.

16 years agoAdd tracing for seg_move
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
Add tracing for seg_move

This turns out to be very useful for tracking segment usage.

16 years agosimplify seg_apply
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
simplify seg_apply

Just call seg_inc rather than open coding most of that
functionality.

16 years agolafs_print_tree: export and use in super.
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
lafs_print_tree: export and use in super.

This is for tracking an unmount bug, but print_tree seems
generally useful, so export it.

16 years agolafs_incorporate - don't clear a block with children.
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
lafs_incorporate - don't clear a block with children.

If an index block has children, then erasing it is pointless
and confusing.  So don't.

16 years agoImprove tracing for lafs_incorporate.
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
Improve tracing for lafs_incorporate.

Show the uninc list as well, and do it before trying to
incorporate.

16 years agosilly typo in do_incorporate_leaf.
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
silly typo in do_incorporate_leaf.

The 'type' header is 2 bytes.

16 years agoAccelerate walk_indirect.
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
Accelerate walk_indirect.

If an indirect block is being asked to incorporate an address that
is very must after the address of the block, it has to count all
the way up to that number, which is a waste of time.
So if there is an opportunity to jump forward, take it.

16 years agoincorporate: always call sort_blocks on the uninc list.
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
incorporate: always call sort_blocks on the uninc list.

Were were not calling it when trying the 'simple' incorporation.

16 years agoFix add_extent
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
Fix add_extent

We weren't updating the lastaddr/lastphys at all!!

16 years agocorrect some comments in lafs.h
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
correct some comments in lafs.h

I was spelling the idtag wrongly.

16 years agoIO: support loading of an index block from addr 0.
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
IO: support loading of an index block from addr 0.

This can happen when adding blocks to a prevously truncated
file, or even when continuing with a slow truncate.

phys==0 just means the index block is empty, so honour that.

16 years agotruncate: make sure index block is pinned and dirty when we prune it.
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
truncate: make sure index block is pinned and dirty when we prune it.

16 years agotruncate: make sure index changes get incorporated.
NeilBrown [Tue, 25 Aug 2009 07:09:54 +0000 (17:09 +1000)]
truncate: make sure index changes get incorporated.

When we have used lafs_incorporate to clear and unpin
an index block we need to incorporate the parent so that
the unpinned block gets fully released.