698 (unsigned long long)ac->ac_max_block);
699
700 if (!ocfs2_local_alloc_in_range(local_alloc_inode, ac,
701 bits_wanted)) {
702
703
704
705
706
707 status = -EFBIG;
708 goto bail;
709 }
710
711 ac->ac_inode = local_alloc_inode;
712
713 ac->ac_alloc_slot = osb->slot_num;
714 ac->ac_which = OCFS2_AC_USE_LOCAL;
715 get_bh(osb->local_alloc_bh);
716 ac->ac_bh = osb->local_alloc_bh;
717 status = 0;
718bail:
719 if (status < 0 && local_alloc_inode) {
720 mutex_unlock(&local_alloc_inode->i_mutex);
721 iput(local_alloc_inode);
722 }
723
724 mlog(0, "bits=%d, slot=%d, ret=%d\n", bits_wanted, osb->slot_num,
725 status);
726
727 mlog_exit(status);
728 return status;
729}
730
731int ocfs2_claim_local_alloc_bits(struct ocfs2_super *osb,
732 handle_t *handle,
733 struct ocfs2_alloc_context *ac,
734 u32 bits_wanted,
735 u32 *bit_off,
736 u32 *num_bits)
737{
738 int status, start;