Example #1
0
static u64 ocfs2_group_from_res(struct ocfs2_suballoc_result *res)
{
	if (res->sr_blkno == 0)
		return 0;

	if (res->sr_bg_blkno)
		return res->sr_bg_blkno;

	return ocfs2_which_suballoc_group(res->sr_blkno, res->sr_bit_offset);
}
Example #2
0
int ocfs2_free_extent_block(handle_t *handle,
			    struct inode *eb_alloc_inode,
			    struct buffer_head *eb_alloc_bh,
			    struct ocfs2_extent_block *eb)
{
	u64 blk = le64_to_cpu(eb->h_blkno);
	u16 bit = le16_to_cpu(eb->h_suballoc_bit);
	u64 bg_blkno = ocfs2_which_suballoc_group(blk, bit);

	return ocfs2_free_suballoc_bits(handle, eb_alloc_inode, eb_alloc_bh,
					bit, bg_blkno, 1);
}
Example #3
0
int ocfs2_free_dinode(handle_t *handle,
		      struct inode *inode_alloc_inode,
		      struct buffer_head *inode_alloc_bh,
		      struct ocfs2_dinode *di)
{
	u64 blk = le64_to_cpu(di->i_blkno);
	u16 bit = le16_to_cpu(di->i_suballoc_bit);
	u64 bg_blkno = ocfs2_which_suballoc_group(blk, bit);

	return ocfs2_free_suballoc_bits(handle, inode_alloc_inode,
					inode_alloc_bh, bit, bg_blkno, 1);
}