	.file	"extr_suballoc.c_ocfs2_reserve_new_metadata_blocks.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	ocfs2_reserve_new_metadata_blocks
	.type	ocfs2_reserve_new_metadata_blocks, @function
ocfs2_reserve_new_metadata_blocks:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12d, esi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	mov	rbx, rdx
	sub	rsp, 8
	.cfi_def_cfa_offset 48
	call	ocfs2_get_meta_steal_slot@PLT
	mov	esi, DWORD PTR GFP_KERNEL[rip]
	mov	edi, 12
	mov	ebp, eax
	call	kzalloc@PLT
	mov	QWORD PTR [rbx], rax
	test	rax, rax
	je	.L27
	mov	edx, DWORD PTR OCFS2_AC_USE_META[rip]
	cmp	DWORD PTR OCFS2_INVALID_SLOT[rip], ebp
	mov	DWORD PTR [rax], r12d
	mov	DWORD PTR 8[rax], edx
	mov	edx, DWORD PTR ocfs2_block_group_search[rip]
	mov	DWORD PTR 4[rax], edx
	je	.L9
	mov	rdi, r13
	call	atomic_read@PLT
	cmp	rax, QWORD PTR OCFS2_MAX_TO_STEAL[rip]
	jl	.L8
.L9:
	xor	esi, esi
	mov	rdi, r13
	call	atomic_set@PLT
	mov	ecx, DWORD PTR 8[r13]
	mov	rsi, QWORD PTR [rbx]
	xor	r8d, r8d
	mov	edx, DWORD PTR EXTENT_ALLOC_SYSTEM_INODE[rip]
	mov	r9d, DWORD PTR ALLOC_GROUPS_FROM_GLOBAL[rip]
	mov	rdi, r13
	or	r9d, DWORD PTR ALLOC_NEW_GROUP[rip]
	call	ocfs2_reserve_suballoc_bits@PLT
	mov	r12d, eax
	test	eax, eax
	jns	.L28
	add	eax, DWORD PTR ENOSPC[rip]
	jne	.L24
	mov	rdi, QWORD PTR [rbx]
	call	ocfs2_free_ac_resource@PLT
.L8:
	mov	rsi, QWORD PTR [rbx]
	mov	rdi, r13
	call	ocfs2_steal_meta@PLT
	mov	rdi, r13
	mov	r12d, eax
	call	atomic_inc@PLT
	test	r12d, r12d
	js	.L29
.L25:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	r12d, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	cmp	DWORD PTR OCFS2_INVALID_SLOT[rip], ebp
	je	.L25
	mov	rdi, r13
	call	ocfs2_init_meta_steal_slot@PLT
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L29:
	mov	eax, r12d
	add	eax, DWORD PTR ENOSPC[rip]
	je	.L3
.L24:
	mov	edi, r12d
	call	mlog_errno@PLT
.L3:
	mov	rdi, QWORD PTR [rbx]
	test	rdi, rdi
	je	.L14
	call	ocfs2_free_alloc_context@PLT
	mov	QWORD PTR [rbx], 0
.L14:
	mov	edi, r12d
	call	mlog_errno@PLT
.L30:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r12d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	mov	ebp, DWORD PTR ENOMEM[rip]
	mov	r12d, ebp
	neg	r12d
	mov	edi, r12d
	call	mlog_errno@PLT
	test	ebp, ebp
	jg	.L3
	je	.L25
	mov	edi, r12d
	call	mlog_errno@PLT
	jmp	.L30
	.cfi_endproc
.LFE0:
	.size	ocfs2_reserve_new_metadata_blocks, .-ocfs2_reserve_new_metadata_blocks
	.comm	ocfs2_block_group_search,4,4
	.comm	OCFS2_MAX_TO_STEAL,8,8
	.comm	OCFS2_INVALID_SLOT,4,4
	.comm	OCFS2_AC_USE_META,4,4
	.comm	GFP_KERNEL,4,4
	.comm	EXTENT_ALLOC_SYSTEM_INODE,4,4
	.comm	ENOSPC,4,4
	.comm	ENOMEM,4,4
	.comm	ALLOC_NEW_GROUP,4,4
	.comm	ALLOC_GROUPS_FROM_GLOBAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_suballoc.c_ocfs2_reserve_new_metadata_blocks.c"
	.text
	.align	2
	.global	ocfs2_reserve_new_metadata_blocks
	.syntax unified
	.arm
	.fpu softvfp
	.type	ocfs2_reserve_new_metadata_blocks, %function
ocfs2_reserve_new_metadata_blocks:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	sub	sp, sp, #12
	mov	r6, r2
	mov	r4, r1
	mov	r5, r0
	bl	ocfs2_get_meta_steal_slot
	ldr	r3, .L27
	mov	r7, r0
	ldr	r1, [r3]
	mov	r0, #12
	bl	kzalloc
	cmp	r0, #0
	str	r0, [r6]
	beq	.L23
	ldr	r2, .L27+4
	ldr	r8, .L27+8
	ldr	r3, .L27+12
	ldr	r1, [r2]
	ldr	r2, [r8]
	ldr	r3, [r3]
	cmp	r2, r7
	str	r4, [r0]
	str	r1, [r0, #8]
	str	r3, [r0, #4]
	beq	.L9
	mov	r0, r5
	bl	atomic_read
	ldr	r3, .L27+16
	ldr	r3, [r3]
	cmp	r0, r3
	blt	.L8
.L9:
	mov	r9, #0
	mov	r0, r5
	mov	r1, r9
	bl	atomic_set
	ldr	r2, .L27+20
	ldr	r3, .L27+24
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r2, .L27+28
	orr	r3, r3, r1
	str	r3, [sp, #4]
	str	r9, [sp]
	mov	r0, r5
	ldr	r2, [r2]
	ldr	r3, [r5, #4]
	ldr	r1, [r6]
	bl	ocfs2_reserve_suballoc_bits
	subs	r4, r0, #0
	bge	.L24
	ldr	r3, .L27+32
	ldr	r3, [r3]
	cmn	r4, r3
	bne	.L21
	ldr	r0, [r6]
	bl	ocfs2_free_ac_resource
.L8:
	ldr	r1, [r6]
	mov	r0, r5
	bl	ocfs2_steal_meta
	mov	r4, r0
	mov	r0, r5
	bl	atomic_inc
	cmp	r4, #0
	blt	.L25
.L13:
	mov	r4, #0
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L24:
	ldr	r3, [r8]
	cmp	r3, r7
	beq	.L13
	mov	r4, r9
	mov	r0, r5
	bl	ocfs2_init_meta_steal_slot
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L25:
	ldr	r3, .L27+32
	ldr	r3, [r3]
	cmn	r4, r3
	beq	.L3
	mov	r0, r4
.L21:
	bl	mlog_errno
.L3:
	ldr	r0, [r6]
	cmp	r0, #0
	beq	.L14
	bl	ocfs2_free_alloc_context
	mov	r3, #0
	str	r3, [r6]
.L14:
	mov	r0, r4
	bl	mlog_errno
.L26:
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L23:
	ldr	r3, .L27+36
	ldr	r5, [r3]
	rsb	r4, r5, #0
	mov	r0, r4
	bl	mlog_errno
	cmp	r5, #0
	bgt	.L3
	beq	.L13
	mov	r0, r4
	bl	mlog_errno
	b	.L26
.L28:
	.align	2
.L27:
	.word	GFP_KERNEL
	.word	OCFS2_AC_USE_META
	.word	OCFS2_INVALID_SLOT
	.word	ocfs2_block_group_search
	.word	OCFS2_MAX_TO_STEAL
	.word	ALLOC_NEW_GROUP
	.word	ALLOC_GROUPS_FROM_GLOBAL
	.word	EXTENT_ALLOC_SYSTEM_INODE
	.word	ENOSPC
	.word	ENOMEM
	.size	ocfs2_reserve_new_metadata_blocks, .-ocfs2_reserve_new_metadata_blocks
	.comm	ocfs2_block_group_search,4,4
	.comm	OCFS2_MAX_TO_STEAL,4,4
	.comm	OCFS2_INVALID_SLOT,4,4
	.comm	OCFS2_AC_USE_META,4,4
	.comm	GFP_KERNEL,4,4
	.comm	EXTENT_ALLOC_SYSTEM_INODE,4,4
	.comm	ENOSPC,4,4
	.comm	ENOMEM,4,4
	.comm	ALLOC_NEW_GROUP,4,4
	.comm	ALLOC_GROUPS_FROM_GLOBAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
