ext4: replace i_delalloc_reserved_flag with EXT4_STATE_DELALLOC_RESERVED
[cascardo/linux.git] / fs / ext4 / balloc.c
index 14c3af2..adf96b8 100644 (file)
@@ -592,7 +592,8 @@ ext4_fsblk_t ext4_new_meta_blocks(handle_t *handle, struct inode *inode,
         * Account for the allocated meta blocks.  We will never
         * fail EDQUOT for metdata, but we do account for it.
         */
-       if (!(*errp) && EXT4_I(inode)->i_delalloc_reserved_flag) {
+       if (!(*errp) &&
+           ext4_test_inode_state(inode, EXT4_STATE_DELALLOC_RESERVED)) {
                spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
                EXT4_I(inode)->i_allocated_meta_blocks += ar.len;
                spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);