diff options
Diffstat (limited to 'fs/ocfs2/file.c')
-rw-r--r-- | fs/ocfs2/file.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index c18ab45f8d21..5308841756be 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c | |||
@@ -770,14 +770,14 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, | |||
770 | { | 770 | { |
771 | struct address_space *mapping = inode->i_mapping; | 771 | struct address_space *mapping = inode->i_mapping; |
772 | struct page *page; | 772 | struct page *page; |
773 | unsigned long index = abs_from >> PAGE_CACHE_SHIFT; | 773 | unsigned long index = abs_from >> PAGE_SHIFT; |
774 | handle_t *handle; | 774 | handle_t *handle; |
775 | int ret = 0; | 775 | int ret = 0; |
776 | unsigned zero_from, zero_to, block_start, block_end; | 776 | unsigned zero_from, zero_to, block_start, block_end; |
777 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; | 777 | struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data; |
778 | 778 | ||
779 | BUG_ON(abs_from >= abs_to); | 779 | BUG_ON(abs_from >= abs_to); |
780 | BUG_ON(abs_to > (((u64)index + 1) << PAGE_CACHE_SHIFT)); | 780 | BUG_ON(abs_to > (((u64)index + 1) << PAGE_SHIFT)); |
781 | BUG_ON(abs_from & (inode->i_blkbits - 1)); | 781 | BUG_ON(abs_from & (inode->i_blkbits - 1)); |
782 | 782 | ||
783 | handle = ocfs2_zero_start_ordered_transaction(inode, di_bh); | 783 | handle = ocfs2_zero_start_ordered_transaction(inode, di_bh); |
@@ -794,10 +794,10 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, | |||
794 | } | 794 | } |
795 | 795 | ||
796 | /* Get the offsets within the page that we want to zero */ | 796 | /* Get the offsets within the page that we want to zero */ |
797 | zero_from = abs_from & (PAGE_CACHE_SIZE - 1); | 797 | zero_from = abs_from & (PAGE_SIZE - 1); |
798 | zero_to = abs_to & (PAGE_CACHE_SIZE - 1); | 798 | zero_to = abs_to & (PAGE_SIZE - 1); |
799 | if (!zero_to) | 799 | if (!zero_to) |
800 | zero_to = PAGE_CACHE_SIZE; | 800 | zero_to = PAGE_SIZE; |
801 | 801 | ||
802 | trace_ocfs2_write_zero_page( | 802 | trace_ocfs2_write_zero_page( |
803 | (unsigned long long)OCFS2_I(inode)->ip_blkno, | 803 | (unsigned long long)OCFS2_I(inode)->ip_blkno, |
@@ -851,7 +851,7 @@ static int ocfs2_write_zero_page(struct inode *inode, u64 abs_from, | |||
851 | 851 | ||
852 | out_unlock: | 852 | out_unlock: |
853 | unlock_page(page); | 853 | unlock_page(page); |
854 | page_cache_release(page); | 854 | put_page(page); |
855 | out_commit_trans: | 855 | out_commit_trans: |
856 | if (handle) | 856 | if (handle) |
857 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); | 857 | ocfs2_commit_trans(OCFS2_SB(inode->i_sb), handle); |
@@ -959,7 +959,7 @@ static int ocfs2_zero_extend_range(struct inode *inode, u64 range_start, | |||
959 | BUG_ON(range_start >= range_end); | 959 | BUG_ON(range_start >= range_end); |
960 | 960 | ||
961 | while (zero_pos < range_end) { | 961 | while (zero_pos < range_end) { |
962 | next_pos = (zero_pos & PAGE_CACHE_MASK) + PAGE_CACHE_SIZE; | 962 | next_pos = (zero_pos & PAGE_MASK) + PAGE_SIZE; |
963 | if (next_pos > range_end) | 963 | if (next_pos > range_end) |
964 | next_pos = range_end; | 964 | next_pos = range_end; |
965 | rc = ocfs2_write_zero_page(inode, zero_pos, next_pos, di_bh); | 965 | rc = ocfs2_write_zero_page(inode, zero_pos, next_pos, di_bh); |