diff options
Diffstat (limited to 'fs/reiserfs/inode.c')
-rw-r--r-- | fs/reiserfs/inode.c | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index ae9e5b308cf9..d5c2e9c865de 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -386,7 +386,7 @@ static int _get_block_create_0(struct inode *inode, sector_t block, | |||
386 | goto finished; | 386 | goto finished; |
387 | } | 387 | } |
388 | /* read file tail into part of page */ | 388 | /* read file tail into part of page */ |
389 | offset = (cpu_key_k_offset(&key) - 1) & (PAGE_CACHE_SIZE - 1); | 389 | offset = (cpu_key_k_offset(&key) - 1) & (PAGE_SIZE - 1); |
390 | copy_item_head(&tmp_ih, ih); | 390 | copy_item_head(&tmp_ih, ih); |
391 | 391 | ||
392 | /* | 392 | /* |
@@ -587,10 +587,10 @@ static int convert_tail_for_hole(struct inode *inode, | |||
587 | return -EIO; | 587 | return -EIO; |
588 | 588 | ||
589 | /* always try to read until the end of the block */ | 589 | /* always try to read until the end of the block */ |
590 | tail_start = tail_offset & (PAGE_CACHE_SIZE - 1); | 590 | tail_start = tail_offset & (PAGE_SIZE - 1); |
591 | tail_end = (tail_start | (bh_result->b_size - 1)) + 1; | 591 | tail_end = (tail_start | (bh_result->b_size - 1)) + 1; |
592 | 592 | ||
593 | index = tail_offset >> PAGE_CACHE_SHIFT; | 593 | index = tail_offset >> PAGE_SHIFT; |
594 | /* | 594 | /* |
595 | * hole_page can be zero in case of direct_io, we are sure | 595 | * hole_page can be zero in case of direct_io, we are sure |
596 | * that we cannot get here if we write with O_DIRECT into tail page | 596 | * that we cannot get here if we write with O_DIRECT into tail page |
@@ -629,7 +629,7 @@ static int convert_tail_for_hole(struct inode *inode, | |||
629 | unlock: | 629 | unlock: |
630 | if (tail_page != hole_page) { | 630 | if (tail_page != hole_page) { |
631 | unlock_page(tail_page); | 631 | unlock_page(tail_page); |
632 | page_cache_release(tail_page); | 632 | put_page(tail_page); |
633 | } | 633 | } |
634 | out: | 634 | out: |
635 | return retval; | 635 | return retval; |
@@ -2189,11 +2189,11 @@ static int grab_tail_page(struct inode *inode, | |||
2189 | * we want the page with the last byte in the file, | 2189 | * we want the page with the last byte in the file, |
2190 | * not the page that will hold the next byte for appending | 2190 | * not the page that will hold the next byte for appending |
2191 | */ | 2191 | */ |
2192 | unsigned long index = (inode->i_size - 1) >> PAGE_CACHE_SHIFT; | 2192 | unsigned long index = (inode->i_size - 1) >> PAGE_SHIFT; |
2193 | unsigned long pos = 0; | 2193 | unsigned long pos = 0; |
2194 | unsigned long start = 0; | 2194 | unsigned long start = 0; |
2195 | unsigned long blocksize = inode->i_sb->s_blocksize; | 2195 | unsigned long blocksize = inode->i_sb->s_blocksize; |
2196 | unsigned long offset = (inode->i_size) & (PAGE_CACHE_SIZE - 1); | 2196 | unsigned long offset = (inode->i_size) & (PAGE_SIZE - 1); |
2197 | struct buffer_head *bh; | 2197 | struct buffer_head *bh; |
2198 | struct buffer_head *head; | 2198 | struct buffer_head *head; |
2199 | struct page *page; | 2199 | struct page *page; |
@@ -2251,7 +2251,7 @@ out: | |||
2251 | 2251 | ||
2252 | unlock: | 2252 | unlock: |
2253 | unlock_page(page); | 2253 | unlock_page(page); |
2254 | page_cache_release(page); | 2254 | put_page(page); |
2255 | return error; | 2255 | return error; |
2256 | } | 2256 | } |
2257 | 2257 | ||
@@ -2265,7 +2265,7 @@ int reiserfs_truncate_file(struct inode *inode, int update_timestamps) | |||
2265 | { | 2265 | { |
2266 | struct reiserfs_transaction_handle th; | 2266 | struct reiserfs_transaction_handle th; |
2267 | /* we want the offset for the first byte after the end of the file */ | 2267 | /* we want the offset for the first byte after the end of the file */ |
2268 | unsigned long offset = inode->i_size & (PAGE_CACHE_SIZE - 1); | 2268 | unsigned long offset = inode->i_size & (PAGE_SIZE - 1); |
2269 | unsigned blocksize = inode->i_sb->s_blocksize; | 2269 | unsigned blocksize = inode->i_sb->s_blocksize; |
2270 | unsigned length; | 2270 | unsigned length; |
2271 | struct page *page = NULL; | 2271 | struct page *page = NULL; |
@@ -2345,7 +2345,7 @@ int reiserfs_truncate_file(struct inode *inode, int update_timestamps) | |||
2345 | } | 2345 | } |
2346 | } | 2346 | } |
2347 | unlock_page(page); | 2347 | unlock_page(page); |
2348 | page_cache_release(page); | 2348 | put_page(page); |
2349 | } | 2349 | } |
2350 | 2350 | ||
2351 | reiserfs_write_unlock(inode->i_sb); | 2351 | reiserfs_write_unlock(inode->i_sb); |
@@ -2354,7 +2354,7 @@ int reiserfs_truncate_file(struct inode *inode, int update_timestamps) | |||
2354 | out: | 2354 | out: |
2355 | if (page) { | 2355 | if (page) { |
2356 | unlock_page(page); | 2356 | unlock_page(page); |
2357 | page_cache_release(page); | 2357 | put_page(page); |
2358 | } | 2358 | } |
2359 | 2359 | ||
2360 | reiserfs_write_unlock(inode->i_sb); | 2360 | reiserfs_write_unlock(inode->i_sb); |
@@ -2426,7 +2426,7 @@ research: | |||
2426 | } else if (is_direct_le_ih(ih)) { | 2426 | } else if (is_direct_le_ih(ih)) { |
2427 | char *p; | 2427 | char *p; |
2428 | p = page_address(bh_result->b_page); | 2428 | p = page_address(bh_result->b_page); |
2429 | p += (byte_offset - 1) & (PAGE_CACHE_SIZE - 1); | 2429 | p += (byte_offset - 1) & (PAGE_SIZE - 1); |
2430 | copy_size = ih_item_len(ih) - pos_in_item; | 2430 | copy_size = ih_item_len(ih) - pos_in_item; |
2431 | 2431 | ||
2432 | fs_gen = get_generation(inode->i_sb); | 2432 | fs_gen = get_generation(inode->i_sb); |
@@ -2525,7 +2525,7 @@ static int reiserfs_write_full_page(struct page *page, | |||
2525 | struct writeback_control *wbc) | 2525 | struct writeback_control *wbc) |
2526 | { | 2526 | { |
2527 | struct inode *inode = page->mapping->host; | 2527 | struct inode *inode = page->mapping->host; |
2528 | unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT; | 2528 | unsigned long end_index = inode->i_size >> PAGE_SHIFT; |
2529 | int error = 0; | 2529 | int error = 0; |
2530 | unsigned long block; | 2530 | unsigned long block; |
2531 | sector_t last_block; | 2531 | sector_t last_block; |
@@ -2535,7 +2535,7 @@ static int reiserfs_write_full_page(struct page *page, | |||
2535 | int checked = PageChecked(page); | 2535 | int checked = PageChecked(page); |
2536 | struct reiserfs_transaction_handle th; | 2536 | struct reiserfs_transaction_handle th; |
2537 | struct super_block *s = inode->i_sb; | 2537 | struct super_block *s = inode->i_sb; |
2538 | int bh_per_page = PAGE_CACHE_SIZE / s->s_blocksize; | 2538 | int bh_per_page = PAGE_SIZE / s->s_blocksize; |
2539 | th.t_trans_id = 0; | 2539 | th.t_trans_id = 0; |
2540 | 2540 | ||
2541 | /* no logging allowed when nonblocking or from PF_MEMALLOC */ | 2541 | /* no logging allowed when nonblocking or from PF_MEMALLOC */ |
@@ -2564,16 +2564,16 @@ static int reiserfs_write_full_page(struct page *page, | |||
2564 | if (page->index >= end_index) { | 2564 | if (page->index >= end_index) { |
2565 | unsigned last_offset; | 2565 | unsigned last_offset; |
2566 | 2566 | ||
2567 | last_offset = inode->i_size & (PAGE_CACHE_SIZE - 1); | 2567 | last_offset = inode->i_size & (PAGE_SIZE - 1); |
2568 | /* no file contents in this page */ | 2568 | /* no file contents in this page */ |
2569 | if (page->index >= end_index + 1 || !last_offset) { | 2569 | if (page->index >= end_index + 1 || !last_offset) { |
2570 | unlock_page(page); | 2570 | unlock_page(page); |
2571 | return 0; | 2571 | return 0; |
2572 | } | 2572 | } |
2573 | zero_user_segment(page, last_offset, PAGE_CACHE_SIZE); | 2573 | zero_user_segment(page, last_offset, PAGE_SIZE); |
2574 | } | 2574 | } |
2575 | bh = head; | 2575 | bh = head; |
2576 | block = page->index << (PAGE_CACHE_SHIFT - s->s_blocksize_bits); | 2576 | block = page->index << (PAGE_SHIFT - s->s_blocksize_bits); |
2577 | last_block = (i_size_read(inode) - 1) >> inode->i_blkbits; | 2577 | last_block = (i_size_read(inode) - 1) >> inode->i_blkbits; |
2578 | /* first map all the buffers, logging any direct items we find */ | 2578 | /* first map all the buffers, logging any direct items we find */ |
2579 | do { | 2579 | do { |
@@ -2774,7 +2774,7 @@ static int reiserfs_write_begin(struct file *file, | |||
2774 | *fsdata = (void *)(unsigned long)flags; | 2774 | *fsdata = (void *)(unsigned long)flags; |
2775 | } | 2775 | } |
2776 | 2776 | ||
2777 | index = pos >> PAGE_CACHE_SHIFT; | 2777 | index = pos >> PAGE_SHIFT; |
2778 | page = grab_cache_page_write_begin(mapping, index, flags); | 2778 | page = grab_cache_page_write_begin(mapping, index, flags); |
2779 | if (!page) | 2779 | if (!page) |
2780 | return -ENOMEM; | 2780 | return -ENOMEM; |
@@ -2822,7 +2822,7 @@ static int reiserfs_write_begin(struct file *file, | |||
2822 | } | 2822 | } |
2823 | if (ret) { | 2823 | if (ret) { |
2824 | unlock_page(page); | 2824 | unlock_page(page); |
2825 | page_cache_release(page); | 2825 | put_page(page); |
2826 | /* Truncate allocated blocks */ | 2826 | /* Truncate allocated blocks */ |
2827 | reiserfs_truncate_failed_write(inode); | 2827 | reiserfs_truncate_failed_write(inode); |
2828 | } | 2828 | } |
@@ -2909,7 +2909,7 @@ static int reiserfs_write_end(struct file *file, struct address_space *mapping, | |||
2909 | else | 2909 | else |
2910 | th = NULL; | 2910 | th = NULL; |
2911 | 2911 | ||
2912 | start = pos & (PAGE_CACHE_SIZE - 1); | 2912 | start = pos & (PAGE_SIZE - 1); |
2913 | if (unlikely(copied < len)) { | 2913 | if (unlikely(copied < len)) { |
2914 | if (!PageUptodate(page)) | 2914 | if (!PageUptodate(page)) |
2915 | copied = 0; | 2915 | copied = 0; |
@@ -2974,7 +2974,7 @@ out: | |||
2974 | if (locked) | 2974 | if (locked) |
2975 | reiserfs_write_unlock(inode->i_sb); | 2975 | reiserfs_write_unlock(inode->i_sb); |
2976 | unlock_page(page); | 2976 | unlock_page(page); |
2977 | page_cache_release(page); | 2977 | put_page(page); |
2978 | 2978 | ||
2979 | if (pos + len > inode->i_size) | 2979 | if (pos + len > inode->i_size) |
2980 | reiserfs_truncate_failed_write(inode); | 2980 | reiserfs_truncate_failed_write(inode); |
@@ -2996,7 +2996,7 @@ int reiserfs_commit_write(struct file *f, struct page *page, | |||
2996 | unsigned from, unsigned to) | 2996 | unsigned from, unsigned to) |
2997 | { | 2997 | { |
2998 | struct inode *inode = page->mapping->host; | 2998 | struct inode *inode = page->mapping->host; |
2999 | loff_t pos = ((loff_t) page->index << PAGE_CACHE_SHIFT) + to; | 2999 | loff_t pos = ((loff_t) page->index << PAGE_SHIFT) + to; |
3000 | int ret = 0; | 3000 | int ret = 0; |
3001 | int update_sd = 0; | 3001 | int update_sd = 0; |
3002 | struct reiserfs_transaction_handle *th = NULL; | 3002 | struct reiserfs_transaction_handle *th = NULL; |
@@ -3181,7 +3181,7 @@ static void reiserfs_invalidatepage(struct page *page, unsigned int offset, | |||
3181 | struct inode *inode = page->mapping->host; | 3181 | struct inode *inode = page->mapping->host; |
3182 | unsigned int curr_off = 0; | 3182 | unsigned int curr_off = 0; |
3183 | unsigned int stop = offset + length; | 3183 | unsigned int stop = offset + length; |
3184 | int partial_page = (offset || length < PAGE_CACHE_SIZE); | 3184 | int partial_page = (offset || length < PAGE_SIZE); |
3185 | int ret = 1; | 3185 | int ret = 1; |
3186 | 3186 | ||
3187 | BUG_ON(!PageLocked(page)); | 3187 | BUG_ON(!PageLocked(page)); |