static int check_page_uptodate(struct extent_map_tree *tree,
struct page *page)
{
- u64 start = page->index << PAGE_CACHE_SHIFT;
+ u64 start = (u64)page->index << PAGE_CACHE_SHIFT;
u64 end = start + PAGE_CACHE_SIZE - 1;
if (test_range_bit(tree, start, end, EXTENT_UPTODATE, 1))
SetPageUptodate(page);
static int check_page_locked(struct extent_map_tree *tree,
struct page *page)
{
- u64 start = page->index << PAGE_CACHE_SHIFT;
+ u64 start = (u64)page->index << PAGE_CACHE_SHIFT;
u64 end = start + PAGE_CACHE_SIZE - 1;
if (!test_range_bit(tree, start, end, EXTENT_LOCKED, 0))
unlock_page(page);
static int check_page_writeback(struct extent_map_tree *tree,
struct page *page)
{
- u64 start = page->index << PAGE_CACHE_SHIFT;
+ u64 start = (u64)page->index << PAGE_CACHE_SHIFT;
u64 end = start + PAGE_CACHE_SIZE - 1;
if (!test_range_bit(tree, start, end, EXTENT_WRITEBACK, 0))
end_page_writeback(page);
do {
struct page *page = bvec->bv_page;
- start = (page->index << PAGE_CACHE_SHIFT) + bvec->bv_offset;
+ start = ((u64)page->index << PAGE_CACHE_SHIFT) +
+ bvec->bv_offset;
end = start + bvec->bv_len - 1;
if (bvec->bv_offset == 0 && bvec->bv_len == PAGE_CACHE_SIZE)
do {
struct page *page = bvec->bv_page;
- start = (page->index << PAGE_CACHE_SHIFT) + bvec->bv_offset;
+ start = ((u64)page->index << PAGE_CACHE_SHIFT) +
+ bvec->bv_offset;
end = start + bvec->bv_len - 1;
if (bvec->bv_offset == 0 && bvec->bv_len == PAGE_CACHE_SIZE)
do {
struct page *page = bvec->bv_page;
- start = (page->index << PAGE_CACHE_SHIFT) + bvec->bv_offset;
+ start = ((u64)page->index << PAGE_CACHE_SHIFT) +
+ bvec->bv_offset;
end = start + bvec->bv_len - 1;
if (--bvec >= bio->bi_io_vec)
get_extent_t *get_extent)
{
struct inode *inode = page->mapping->host;
- u64 start = page->index << PAGE_CACHE_SHIFT;
+ u64 start = (u64)page->index << PAGE_CACHE_SHIFT;
u64 page_end = start + PAGE_CACHE_SIZE - 1;
u64 end;
u64 cur = start;
struct writeback_control *wbc)
{
struct inode *inode = page->mapping->host;
- u64 start = page->index << PAGE_CACHE_SHIFT;
+ u64 start = (u64)page->index << PAGE_CACHE_SHIFT;
u64 page_end = start + PAGE_CACHE_SIZE - 1;
u64 end;
u64 cur = start;
int extent_invalidatepage(struct extent_map_tree *tree,
struct page *page, unsigned long offset)
{
- u64 start = (page->index << PAGE_CACHE_SHIFT);
+ u64 start = ((u64)page->index << PAGE_CACHE_SHIFT);
u64 end = start + PAGE_CACHE_SIZE - 1;
size_t blocksize = page->mapping->host->i_sb->s_blocksize;
struct inode *inode, struct page *page,
unsigned from, unsigned to, get_extent_t *get_extent)
{
- u64 page_start = page->index << PAGE_CACHE_SHIFT;
+ u64 page_start = (u64)page->index << PAGE_CACHE_SHIFT;
u64 page_end = page_start + PAGE_CACHE_SIZE - 1;
u64 block_start;
u64 orig_block_start;
int try_release_extent_mapping(struct extent_map_tree *tree, struct page *page)
{
struct extent_map *em;
- u64 start = page->index << PAGE_CACHE_SHIFT;
+ u64 start = (u64)page->index << PAGE_CACHE_SHIFT;
u64 end = start + PAGE_CACHE_SIZE - 1;
u64 orig_start = start;
int ret = 1;
if ((i == 0 && (eb->start & (PAGE_CACHE_SIZE - 1))) ||
((i == num_pages - 1) &&
((eb->start + eb->len) & (PAGE_CACHE_SIZE - 1)))) {
- start = page->index << PAGE_CACHE_SHIFT;
+ start = (u64)page->index << PAGE_CACHE_SHIFT;
end = start + PAGE_CACHE_SIZE - 1;
if (test_range_bit(tree, start, end,
EXTENT_DIRTY, 0)) {
struct btrfs_trans_handle *trans;
char *kaddr;
int ret;
- u64 page_start = page->index << PAGE_CACHE_SHIFT;
+ u64 page_start = (u64)page->index << PAGE_CACHE_SHIFT;
size_t offset = start - page_start;
mutex_lock(&root->fs_info->fs_mutex);
int btrfs_readpage_end_io_hook(struct page *page, u64 start, u64 end)
{
- size_t offset = start - (page->index << PAGE_CACHE_SHIFT);
+ size_t offset = start - ((u64)page->index << PAGE_CACHE_SHIFT);
struct inode *inode = page->mapping->host;
struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
char *kaddr;
char *kaddr;
int ret = 0;
struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
- u64 page_start = page->index << PAGE_CACHE_SHIFT;
+ u64 page_start = (u64)page->index << PAGE_CACHE_SHIFT;
u64 page_end = page_start + PAGE_CACHE_SIZE - 1;
set_page_extent_mapped(page);
goto out;
}
}
- page_start = page->index << PAGE_CACHE_SHIFT;
+ page_start = (u64)page->index << PAGE_CACHE_SHIFT;
ret = btrfs_cow_one_page(inode, page, offset);
goto out;
}
- extent_offset = (page->index << PAGE_CACHE_SHIFT) -
+ extent_offset = ((u64)page->index << PAGE_CACHE_SHIFT) -
extent_start + page_offset;
copy_size = min_t(u64, PAGE_CACHE_SIZE - page_offset,
size - extent_offset);
lock_page(page);
wait_on_page_writeback(page);
size = i_size_read(inode);
- page_start = page->index << PAGE_CACHE_SHIFT;
+ page_start = (u64)page->index << PAGE_CACHE_SHIFT;
if ((page->mapping != inode->i_mapping) ||
(page_start > size)) {
goto out_unlock;
}
}
- page_start = page->index << PAGE_CACHE_SHIFT;
+ page_start = (u64)page->index << PAGE_CACHE_SHIFT;
page_end = page_start + PAGE_CACHE_SIZE - 1;
lock_extent(em_tree, page_start, page_end, GFP_NOFS);