int free_me = 0;
struct inode *checkpin = NULL;
struct inode *myi = NULL;
+ struct datablock *db;
set_lru(b);
lafs_checkpoint_unlock(fs);
}
- spin_lock(&lafs_hash_lock);
+
+ if (dec && _putref_norefile(b)) {
+ spin_lock(&lafs_hash_lock);
/* PinPending disappears with the last non-lru reference,
* (or possibly at other times).
*/
- if (atomic_read(&b->refcnt) == dec)
clear_bit(B_PinPending, &b->flags);
ph = !!test_bit(B_Phase1, &b->flags);
!test_bit(B_PinPending, &b->flags) &&
!test_bit(B_Dirty, &b->flags) &&
!test_bit(B_Realloc, &b->flags) &&
- atomic_read(&b->refcnt) == dec &&
(!test_bit(B_Index, &b->flags) ||
(iblk(b)->uninc_table.pending_cnt == 0 &&
iblk(b)->uninc == NULL &&
}
/* check the ->parent link */
- if (atomic_read(&b->refcnt) == dec) {
if (b->parent &&
!(b->flags & (
(1<<B_Pinned) |
}
freelist.freecnt++;
}
- }
-
- if (dec) {
- if (_putref_norefile(b)) {
/* last reference to a dblock with no page
* requires special handling
* The first block on a page must be freed,
* the other blocks hold a reference on that
* first block which must be dropped.
*/
- struct datablock *db = dblk(b);
+ db = dblk(b);
if (!test_bit(B_Index, &b->flags) &&
!PagePrivate(db->page)) {
int bits = (PAGE_SHIFT -
spin_unlock(&b->inode->i_data
.private_lock);
}
- }
- }
/* Free a delayed-release inode */
- if (atomic_read(&b->refcnt) == 0 &&
- !test_bit(B_Index, &b->flags) &&
+ if (!test_bit(B_Index, &b->flags) &&
(myi = rcu_my_inode(dblk(b))) != NULL &&
(!PagePrivate(dblk(b)->page) ||
test_bit(I_Destroyed, &LAFSI(myi)->iflags))) {
lafs_destroy_inode(myi);
} else
spin_unlock(&lafs_hash_lock);
+ }
rcu_iput(myi);
if (physref) {