kunmap_atomic(kaddr, KM_USER0);
}
if ((em->block_start != EXTENT_MAP_HOLE &&
- em->block_start != EXTENT_MAP_INLINE) &&
+ em->block_start != EXTENT_MAP_INLINE) &&
!isnew && !PageUptodate(page) &&
(block_off_end > to || block_off_start < from) &&
!test_range_bit(tree, block_start, cur_end,
u64 extent_offset = block_start - em->start;
size_t iosize;
sector = (em->block_start + extent_offset) >> 9;
- iosize = (cur_end - block_start + blocksize - 1) &
+ iosize = (cur_end - block_start + blocksize) &
~((u64)blocksize - 1);
/*
* we've already got the extent locked, but we
mutex_lock(&root->fs_info->fs_mutex);
err = btrfs_check_free_space(root, PAGE_CACHE_SIZE, 0);
- mutex_lock(&root->fs_info->fs_mutex);
+ mutex_unlock(&root->fs_info->fs_mutex);
if (err)
return -ENOSPC;