diff options
Diffstat (limited to 'fs/ocfs2/aops.c')
-rw-r--r-- | fs/ocfs2/aops.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 1581240a7ca0..ad1577348a92 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -234,7 +234,7 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page, | |||
234 | 234 | ||
235 | size = i_size_read(inode); | 235 | size = i_size_read(inode); |
236 | 236 | ||
237 | if (size > PAGE_CACHE_SIZE || | 237 | if (size > PAGE_SIZE || |
238 | size > ocfs2_max_inline_data_with_xattr(inode->i_sb, di)) { | 238 | size > ocfs2_max_inline_data_with_xattr(inode->i_sb, di)) { |
239 | ocfs2_error(inode->i_sb, | 239 | ocfs2_error(inode->i_sb, |
240 | "Inode %llu has with inline data has bad size: %Lu\n", | 240 | "Inode %llu has with inline data has bad size: %Lu\n", |
@@ -247,7 +247,7 @@ int ocfs2_read_inline_data(struct inode *inode, struct page *page, | |||
247 | if (size) | 247 | if (size) |
248 | memcpy(kaddr, di->id2.i_data.id_data, size); | 248 | memcpy(kaddr, di->id2.i_data.id_data, size); |
249 | /* Clear the remaining part of the page */ | 249 | /* Clear the remaining part of the page */ |
250 | memset(kaddr + size, 0, PAGE_CACHE_SIZE - size); | 250 | memset(kaddr + size, 0, PAGE_SIZE - size); |
251 | flush_dcache_page(page); | 251 | flush_dcache_page(page); |
252 | kunmap_atomic(kaddr); | 252 | kunmap_atomic(kaddr); |
253 | 253 | ||
@@ -282,7 +282,7 @@ static int ocfs2_readpage(struct file *file, struct page *page) | |||
282 | { | 282 | { |
283 | struct inode *inode = page->mapping->host; | 283 | struct inode *inode = page->mapping->host; |
284 | struct ocfs2_inode_info *oi = OCFS2_I(inode); | 284 | struct ocfs2_inode_info *oi = OCFS2_I(inode); |
285 | loff_t start = (loff_t)page->index << PAGE_CACHE_SHIFT; | 285 | loff_t start = (loff_t)page->index << PAGE_SHIFT; |
286 | int ret, unlock = 1; | 286 | int ret, unlock = 1; |
287 | 287 | ||
288 | trace_ocfs2_readpage((unsigned long long)oi->ip_blkno, | 288 | trace_ocfs2_readpage((unsigned long long)oi->ip_blkno, |
@@ -385,7 +385,7 @@ static int ocfs2_readpages(struct file *filp, struct address_space *mapping, | |||
385 | * drop out in that case as it's not worth handling here. | 385 | * drop out in that case as it's not worth handling here. |
386 | */ | 386 | */ |
387 | last = list_entry(pages->prev, struct page, lru); | 387 | last = list_entry(pages->prev, struct page, lru); |
388 | start = (loff_t)last->index << PAGE_CACHE_SHIFT; | 388 | start = (loff_t)last->index << PAGE_SHIFT; |
389 | if (start >= i_size_read(inode)) | 389 | if (start >= i_size_read(inode)) |
390 | goto out_unlock; | 390 | goto out_unlock; |
391 | 391 | ||
@@ -511,12 +511,12 @@ static void ocfs2_figure_cluster_boundaries(struct ocfs2_super *osb, | |||
511 | unsigned int *start, | 511 | unsigned int *start, |
512 | unsigned int *end) | 512 | unsigned int *end) |
513 | { | 513 | { |
514 | unsigned int cluster_start = 0, cluster_end = PAGE_CACHE_SIZE; | 514 | unsigned int cluster_start = 0, cluster_end = PAGE_SIZE; |
515 | 515 | ||
516 | if (unlikely(PAGE_CACHE_SHIFT > osb->s_clustersize_bits)) { | 516 | if (unlikely(PAGE_SHIFT > osb->s_clustersize_bits)) { |
517 | unsigned int cpp; | 517 | unsigned int cpp; |
518 | 518 | ||
519 | cpp = 1 << (PAGE_CACHE_SHIFT - osb->s_clustersize_bits); | 519 | cpp = 1 << (PAGE_SHIFT - osb->s_clustersize_bits); |
520 | 520 | ||
521 | cluster_start = cpos % cpp; | 521 | cluster_start = cpos % cpp; |
522 | cluster_start = cluster_start << osb->s_clustersize_bits; | 522 | cluster_start = cluster_start << osb->s_clustersize_bits; |
@@ -684,13 +684,13 @@ next_bh: | |||
684 | return ret; | 684 | return ret; |
685 | } | 685 | } |
686 | 686 | ||
687 | #if (PAGE_CACHE_SIZE >= OCFS2_MAX_CLUSTERSIZE) | 687 | #if (PAGE_SIZE >= OCFS2_MAX_CLUSTERSIZE) |
688 | #define OCFS2_MAX_CTXT_PAGES 1 | 688 | #define OCFS2_MAX_CTXT_PAGES 1 |
689 | #else | 689 | #else |
690 | #define OCFS2_MAX_CTXT_PAGES (OCFS2_MAX_CLUSTERSIZE / PAGE_CACHE_SIZE) | 690 | #define OCFS2_MAX_CTXT_PAGES (OCFS2_MAX_CLUSTERSIZE / PAGE_SIZE) |
691 | #endif | 691 | #endif |
692 | 692 | ||
693 | #define OCFS2_MAX_CLUSTERS_PER_PAGE (PAGE_CACHE_SIZE / OCFS2_MIN_CLUSTERSIZE) | 693 | #define OCFS2_MAX_CLUSTERS_PER_PAGE (PAGE_SIZE / OCFS2_MIN_CLUSTERSIZE) |
694 | 694 | ||
695 | struct ocfs2_unwritten_extent { | 695 | struct ocfs2_unwritten_extent { |
696 | struct list_head ue_node; | 696 | struct list_head ue_node; |
@@ -785,7 +785,7 @@ void ocfs2_unlock_and_free_pages(struct page **pages, int num_pages) | |||
785 | if (pages[i]) { | 785 | if (pages[i]) { |
786 | unlock_page(pages[i]); | 786 | unlock_page(pages[i]); |
787 | mark_page_accessed(pages[i]); | 787 | mark_page_accessed(pages[i]); |
788 | page_cache_release(pages[i]); | 788 | put_page(pages[i]); |
789 | } | 789 | } |
790 | } | 790 | } |
791 | } | 791 | } |
@@ -808,7 +808,7 @@ static void ocfs2_unlock_pages(struct ocfs2_write_ctxt *wc) | |||
808 | } | 808 | } |
809 | } | 809 | } |
810 | mark_page_accessed(wc->w_target_page); | 810 | mark_page_accessed(wc->w_target_page); |
811 | page_cache_release(wc->w_target_page); | 811 | put_page(wc->w_target_page); |
812 | } | 812 | } |
813 | ocfs2_unlock_and_free_pages(wc->w_pages, wc->w_num_pages); | 813 | ocfs2_unlock_and_free_pages(wc->w_pages, wc->w_num_pages); |
814 | } | 814 | } |
@@ -857,7 +857,7 @@ static int ocfs2_alloc_write_ctxt(struct ocfs2_write_ctxt **wcp, | |||
857 | wc->w_di_bh = di_bh; | 857 | wc->w_di_bh = di_bh; |
858 | wc->w_type = type; | 858 | wc->w_type = type; |
859 | 859 | ||
860 | if (unlikely(PAGE_CACHE_SHIFT > osb->s_clustersize_bits)) | 860 | if (unlikely(PAGE_SHIFT > osb->s_clustersize_bits)) |
861 | wc->w_large_pages = 1; | 861 | wc->w_large_pages = 1; |
862 | else | 862 | else |
863 | wc->w_large_pages = 0; | 863 | wc->w_large_pages = 0; |
@@ -920,7 +920,7 @@ static void ocfs2_write_failure(struct inode *inode, | |||
920 | loff_t user_pos, unsigned user_len) | 920 | loff_t user_pos, unsigned user_len) |
921 | { | 921 | { |
922 | int i; | 922 | int i; |
923 | unsigned from = user_pos & (PAGE_CACHE_SIZE - 1), | 923 | unsigned from = user_pos & (PAGE_SIZE - 1), |
924 | to = user_pos + user_len; | 924 | to = user_pos + user_len; |
925 | struct page *tmppage; | 925 | struct page *tmppage; |
926 | 926 | ||
@@ -960,7 +960,7 @@ static int ocfs2_prepare_page_for_write(struct inode *inode, u64 *p_blkno, | |||
960 | (page_offset(page) <= user_pos)); | 960 | (page_offset(page) <= user_pos)); |
961 | 961 | ||
962 | if (page == wc->w_target_page) { | 962 | if (page == wc->w_target_page) { |
963 | map_from = user_pos & (PAGE_CACHE_SIZE - 1); | 963 | map_from = user_pos & (PAGE_SIZE - 1); |
964 | map_to = map_from + user_len; | 964 | map_to = map_from + user_len; |
965 | 965 | ||
966 | if (new) | 966 | if (new) |
@@ -1034,7 +1034,7 @@ static int ocfs2_grab_pages_for_write(struct address_space *mapping, | |||
1034 | struct inode *inode = mapping->host; | 1034 | struct inode *inode = mapping->host; |
1035 | loff_t last_byte; | 1035 | loff_t last_byte; |
1036 | 1036 | ||
1037 | target_index = user_pos >> PAGE_CACHE_SHIFT; | 1037 | target_index = user_pos >> PAGE_SHIFT; |
1038 | 1038 | ||
1039 | /* | 1039 | /* |
1040 | * Figure out how many pages we'll be manipulating here. For | 1040 | * Figure out how many pages we'll be manipulating here. For |
@@ -1053,14 +1053,14 @@ static int ocfs2_grab_pages_for_write(struct address_space *mapping, | |||
1053 | */ | 1053 | */ |
1054 | last_byte = max(user_pos + user_len, i_size_read(inode)); | 1054 | last_byte = max(user_pos + user_len, i_size_read(inode)); |
1055 | BUG_ON(last_byte < 1); | 1055 | BUG_ON(last_byte < 1); |
1056 | end_index = ((last_byte - 1) >> PAGE_CACHE_SHIFT) + 1; | 1056 | end_index = ((last_byte - 1) >> PAGE_SHIFT) + 1; |
1057 | if ((start + wc->w_num_pages) > end_index) | 1057 | if ((start + wc->w_num_pages) > end_index) |
1058 | wc->w_num_pages = end_index - start; | 1058 | wc->w_num_pages = end_index - start; |
1059 | } else { | 1059 | } else { |
1060 | wc->w_num_pages = 1; | 1060 | wc->w_num_pages = 1; |
1061 | start = target_index; | 1061 | start = target_index; |
1062 | } | 1062 | } |
1063 | end_index = (user_pos + user_len - 1) >> PAGE_CACHE_SHIFT; | 1063 | end_index = (user_pos + user_len - 1) >> PAGE_SHIFT; |
1064 | 1064 | ||
1065 | for(i = 0; i < wc->w_num_pages; i++) { | 1065 | for(i = 0; i < wc->w_num_pages; i++) { |
1066 | index = start + i; | 1066 | index = start + i; |
@@ -1082,7 +1082,7 @@ static int ocfs2_grab_pages_for_write(struct address_space *mapping, | |||
1082 | goto out; | 1082 | goto out; |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | page_cache_get(mmap_page); | 1085 | get_page(mmap_page); |
1086 | wc->w_pages[i] = mmap_page; | 1086 | wc->w_pages[i] = mmap_page; |
1087 | wc->w_target_locked = true; | 1087 | wc->w_target_locked = true; |
1088 | } else if (index >= target_index && index <= end_index && | 1088 | } else if (index >= target_index && index <= end_index && |
@@ -1272,7 +1272,7 @@ static void ocfs2_set_target_boundaries(struct ocfs2_super *osb, | |||
1272 | { | 1272 | { |
1273 | struct ocfs2_write_cluster_desc *desc; | 1273 | struct ocfs2_write_cluster_desc *desc; |
1274 | 1274 | ||
1275 | wc->w_target_from = pos & (PAGE_CACHE_SIZE - 1); | 1275 | wc->w_target_from = pos & (PAGE_SIZE - 1); |
1276 | wc->w_target_to = wc->w_target_from + len; | 1276 | wc->w_target_to = wc->w_target_from + len; |
1277 | 1277 | ||
1278 | if (alloc == 0) | 1278 | if (alloc == 0) |
@@ -1309,7 +1309,7 @@ static void ocfs2_set_target_boundaries(struct ocfs2_super *osb, | |||
1309 | &wc->w_target_to); | 1309 | &wc->w_target_to); |
1310 | } else { | 1310 | } else { |
1311 | wc->w_target_from = 0; | 1311 | wc->w_target_from = 0; |
1312 | wc->w_target_to = PAGE_CACHE_SIZE; | 1312 | wc->w_target_to = PAGE_SIZE; |
1313 | } | 1313 | } |
1314 | } | 1314 | } |
1315 | 1315 | ||
@@ -1981,7 +1981,7 @@ int ocfs2_write_end_nolock(struct address_space *mapping, | |||
1981 | struct page *page, void *fsdata) | 1981 | struct page *page, void *fsdata) |
1982 | { | 1982 | { |
1983 | int i, ret; | 1983 | int i, ret; |
1984 | unsigned from, to, start = pos & (PAGE_CACHE_SIZE - 1); | 1984 | unsigned from, to, start = pos & (PAGE_SIZE - 1); |
1985 | struct inode *inode = mapping->host; | 1985 | struct inode *inode = mapping->host; |
1986 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); | 1986 | struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); |
1987 | struct ocfs2_write_ctxt *wc = fsdata; | 1987 | struct ocfs2_write_ctxt *wc = fsdata; |
@@ -2027,8 +2027,8 @@ int ocfs2_write_end_nolock(struct address_space *mapping, | |||
2027 | from = wc->w_target_from; | 2027 | from = wc->w_target_from; |
2028 | to = wc->w_target_to; | 2028 | to = wc->w_target_to; |
2029 | 2029 | ||
2030 | BUG_ON(from > PAGE_CACHE_SIZE || | 2030 | BUG_ON(from > PAGE_SIZE || |
2031 | to > PAGE_CACHE_SIZE || | 2031 | to > PAGE_SIZE || |
2032 | to < from); | 2032 | to < from); |
2033 | } else { | 2033 | } else { |
2034 | /* | 2034 | /* |
@@ -2037,7 +2037,7 @@ int ocfs2_write_end_nolock(struct address_space *mapping, | |||
2037 | * to flush their entire range. | 2037 | * to flush their entire range. |
2038 | */ | 2038 | */ |
2039 | from = 0; | 2039 | from = 0; |
2040 | to = PAGE_CACHE_SIZE; | 2040 | to = PAGE_SIZE; |
2041 | } | 2041 | } |
2042 | 2042 | ||
2043 | if (page_has_buffers(tmppage)) { | 2043 | if (page_has_buffers(tmppage)) { |