Example #1
0
static void __discard_prealloc (struct reiserfs_transaction_handle * th,
                                struct inode * inode)
{
    unsigned long save = inode->u.reiserfs_i.i_prealloc_block ;
#ifdef CONFIG_REISERFS_CHECK
    if (inode->u.reiserfs_i.i_prealloc_count < 0)
        reiserfs_warning("zam-4001:%s: inode has negative prealloc blocks count.\n", __FUNCTION__ );
#endif
    while (inode->u.reiserfs_i.i_prealloc_count > 0) {
        reiserfs_free_prealloc_block(th,inode->u.reiserfs_i.i_prealloc_block);
        inode->u.reiserfs_i.i_prealloc_block++;
        inode->u.reiserfs_i.i_prealloc_count --;
    }
    inode->u.reiserfs_i.i_prealloc_block = save ;
    list_del (&(inode->u.reiserfs_i.i_prealloc_list));
}
Example #2
0
static void __discard_prealloc (struct reiserfs_transaction_handle * th,
				struct reiserfs_inode_info *ei)
{
    unsigned long save = ei->i_prealloc_block ;
#ifdef CONFIG_REISERFS_CHECK
    if (ei->i_prealloc_count < 0)
	reiserfs_warning("zam-4001:%s: inode has negative prealloc blocks count.\n", __FUNCTION__ );
#endif
    while (ei->i_prealloc_count > 0) {
	reiserfs_free_prealloc_block(th,ei->i_prealloc_block);
	ei->i_prealloc_block++;
	ei->i_prealloc_count --;
    }
    ei->i_prealloc_block = save;
    list_del_init(&(ei->i_prealloc_list));
}
Example #3
0
static void __discard_prealloc (struct reiserfs_transaction_handle * th,
                                struct reiserfs_inode_info *ei)
{
    unsigned long save = ei->i_prealloc_block ;
    int dirty = 0;
    struct inode *inode = &ei->vfs_inode;
    BUG_ON (!th->t_trans_id);
#ifdef CONFIG_REISERFS_CHECK
    if (ei->i_prealloc_count < 0)
        reiserfs_warning (th->t_super, "zam-4001:%s: inode has negative prealloc blocks count.", __FUNCTION__ );
#endif
    while (ei->i_prealloc_count > 0) {
        reiserfs_free_prealloc_block(th, inode, ei->i_prealloc_block);
        ei->i_prealloc_block++;
        ei->i_prealloc_count --;
        dirty = 1;
    }
    if (dirty)
        reiserfs_update_sd(th, inode);
    ei->i_prealloc_block = save;
    list_del_init(&(ei->i_prealloc_list));
}