]> git.neil.brown.name Git - LaFS.git/commitdiff
roll: don't update index if block address hasn't changed.
authorNeilBrown <neilb@suse.de>
Fri, 13 Aug 2010 11:32:11 +0000 (21:32 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 13 Aug 2010 11:32:11 +0000 (21:32 +1000)
This is quite possible if the block was pushed out in the previous
phase, and could save some work

Signed-off-by: NeilBrown <neilb@suse.de>
roll.c

diff --git a/roll.c b/roll.c
index e6f605b43bcfeac4ff6ed6f3c186740b25968421..c75b1b42f6e470c9d00c5a7acade4bdbca21f1b9 100644 (file)
--- a/roll.c
+++ b/roll.c
@@ -327,6 +327,9 @@ roll_block(struct fs *fs, int fsnum, int inum, int trunc, int flg,
                err = lafs_find_block(blk, ADOPT);
                if (err)
                        break;
+               if (blk->b.physaddr == baddr)
+                       /* already correctly indexed */
+                       break;
 
                /* FIXME do I need to dirty the inode to flush
                 * this change into the datablock?