From: NeilBrown Date: Sun, 18 Jul 2010 17:17:07 +0000 (+0200) Subject: Remove pointless code duplication in refile. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=9c8d28443edc0a5335a466772ce82167da138b29;p=LaFS.git Remove pointless code duplication in refile. Just get fs from inode once. Signed-off-by: NeilBrown --- diff --git a/index.c b/index.c index 517b3f2..c20a06c 100644 --- a/index.c +++ b/index.c @@ -857,6 +857,7 @@ void lafs_refile(struct block *b, int dec) clear_bit(B_PinPending, &b->flags); ph = !!test_bit(B_Phase1, &b->flags); + fs = fs_from_inode(b->inode); /* See if we still need to be pinned */ /* FIXME need some locking here ... */ if (test_bit(B_Pinned, &b->flags) && @@ -872,7 +873,6 @@ void lafs_refile(struct block *b, int dec) atomic_read(&iblk(b)->pincnt[1]) == 0)) ) { /* Don't need to be Pinned any more */ - fs = fs_from_inode(b->inode); lafs_checkpoint_lock(fs); if (test_and_clear_bit(B_Pinned, &b->flags)) { if (onlru) { @@ -914,7 +914,6 @@ void lafs_refile(struct block *b, int dec) list_del_init(&b->lru); /* unlock */ } - fs = fs_from_inode(b->inode); spin_lock(&fs->lock); if (list_empty(&b->lru)) { if (test_bit(B_Realloc, &b->flags)) @@ -940,7 +939,6 @@ void lafs_refile(struct block *b, int dec) (1<inode); /* Don't need ->parent any more */ if (next_parent == NULL) next_parent = &b->parent->b;