Commit 778746b5 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Chris Mason

Btrfs: PAGE_CACHE_SIZE is already unsigned long

PAGE_CACHE_SIZE == PAGE_SIZE is "unsigned long" everywhere, so there's no
need to cast it to "unsigned long".
Signed-off-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent b308bc2f
...@@ -1236,8 +1236,7 @@ static void btrfsic_read_from_block_data( ...@@ -1236,8 +1236,7 @@ static void btrfsic_read_from_block_data(
unsigned long i = (start_offset + offset) >> PAGE_CACHE_SHIFT; unsigned long i = (start_offset + offset) >> PAGE_CACHE_SHIFT;
WARN_ON(offset + len > block_ctx->len); WARN_ON(offset + len > block_ctx->len);
offset_in_page = (start_offset + offset) & offset_in_page = (start_offset + offset) & (PAGE_CACHE_SIZE - 1);
((unsigned long)PAGE_CACHE_SIZE - 1);
while (len > 0) { while (len > 0) {
cur = min(len, ((size_t)PAGE_CACHE_SIZE - offset_in_page)); cur = min(len, ((size_t)PAGE_CACHE_SIZE - offset_in_page));
...@@ -3122,19 +3121,19 @@ int btrfsic_mount(struct btrfs_root *root, ...@@ -3122,19 +3121,19 @@ int btrfsic_mount(struct btrfs_root *root,
if (root->nodesize & ((u64)PAGE_CACHE_SIZE - 1)) { if (root->nodesize & ((u64)PAGE_CACHE_SIZE - 1)) {
printk(KERN_INFO printk(KERN_INFO
"btrfsic: cannot handle nodesize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n", "btrfsic: cannot handle nodesize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n",
root->nodesize, (unsigned long)PAGE_CACHE_SIZE); root->nodesize, PAGE_CACHE_SIZE);
return -1; return -1;
} }
if (root->leafsize & ((u64)PAGE_CACHE_SIZE - 1)) { if (root->leafsize & ((u64)PAGE_CACHE_SIZE - 1)) {
printk(KERN_INFO printk(KERN_INFO
"btrfsic: cannot handle leafsize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n", "btrfsic: cannot handle leafsize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n",
root->leafsize, (unsigned long)PAGE_CACHE_SIZE); root->leafsize, PAGE_CACHE_SIZE);
return -1; return -1;
} }
if (root->sectorsize & ((u64)PAGE_CACHE_SIZE - 1)) { if (root->sectorsize & ((u64)PAGE_CACHE_SIZE - 1)) {
printk(KERN_INFO printk(KERN_INFO
"btrfsic: cannot handle sectorsize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n", "btrfsic: cannot handle sectorsize %d not being a multiple of PAGE_CACHE_SIZE %ld!\n",
root->sectorsize, (unsigned long)PAGE_CACHE_SIZE); root->sectorsize, PAGE_CACHE_SIZE);
return -1; return -1;
} }
state = kzalloc(sizeof(*state), GFP_NOFS); state = kzalloc(sizeof(*state), GFP_NOFS);
......
...@@ -4873,7 +4873,7 @@ void read_extent_buffer(struct extent_buffer *eb, void *dstv, ...@@ -4873,7 +4873,7 @@ void read_extent_buffer(struct extent_buffer *eb, void *dstv,
WARN_ON(start > eb->len); WARN_ON(start > eb->len);
WARN_ON(start + len > eb->start + eb->len); WARN_ON(start + len > eb->start + eb->len);
offset = (start_offset + start) & ((unsigned long)PAGE_CACHE_SIZE - 1); offset = (start_offset + start) & (PAGE_CACHE_SIZE - 1);
while (len > 0) { while (len > 0) {
page = extent_buffer_page(eb, i); page = extent_buffer_page(eb, i);
...@@ -4943,7 +4943,7 @@ int memcmp_extent_buffer(struct extent_buffer *eb, const void *ptrv, ...@@ -4943,7 +4943,7 @@ int memcmp_extent_buffer(struct extent_buffer *eb, const void *ptrv,
WARN_ON(start > eb->len); WARN_ON(start > eb->len);
WARN_ON(start + len > eb->start + eb->len); WARN_ON(start + len > eb->start + eb->len);
offset = (start_offset + start) & ((unsigned long)PAGE_CACHE_SIZE - 1); offset = (start_offset + start) & (PAGE_CACHE_SIZE - 1);
while (len > 0) { while (len > 0) {
page = extent_buffer_page(eb, i); page = extent_buffer_page(eb, i);
...@@ -4977,7 +4977,7 @@ void write_extent_buffer(struct extent_buffer *eb, const void *srcv, ...@@ -4977,7 +4977,7 @@ void write_extent_buffer(struct extent_buffer *eb, const void *srcv,
WARN_ON(start > eb->len); WARN_ON(start > eb->len);
WARN_ON(start + len > eb->start + eb->len); WARN_ON(start + len > eb->start + eb->len);
offset = (start_offset + start) & ((unsigned long)PAGE_CACHE_SIZE - 1); offset = (start_offset + start) & (PAGE_CACHE_SIZE - 1);
while (len > 0) { while (len > 0) {
page = extent_buffer_page(eb, i); page = extent_buffer_page(eb, i);
...@@ -5007,7 +5007,7 @@ void memset_extent_buffer(struct extent_buffer *eb, char c, ...@@ -5007,7 +5007,7 @@ void memset_extent_buffer(struct extent_buffer *eb, char c,
WARN_ON(start > eb->len); WARN_ON(start > eb->len);
WARN_ON(start + len > eb->start + eb->len); WARN_ON(start + len > eb->start + eb->len);
offset = (start_offset + start) & ((unsigned long)PAGE_CACHE_SIZE - 1); offset = (start_offset + start) & (PAGE_CACHE_SIZE - 1);
while (len > 0) { while (len > 0) {
page = extent_buffer_page(eb, i); page = extent_buffer_page(eb, i);
...@@ -5038,7 +5038,7 @@ void copy_extent_buffer(struct extent_buffer *dst, struct extent_buffer *src, ...@@ -5038,7 +5038,7 @@ void copy_extent_buffer(struct extent_buffer *dst, struct extent_buffer *src,
WARN_ON(src->len != dst_len); WARN_ON(src->len != dst_len);
offset = (start_offset + dst_offset) & offset = (start_offset + dst_offset) &
((unsigned long)PAGE_CACHE_SIZE - 1); (PAGE_CACHE_SIZE - 1);
while (len > 0) { while (len > 0) {
page = extent_buffer_page(dst, i); page = extent_buffer_page(dst, i);
...@@ -5124,9 +5124,9 @@ void memcpy_extent_buffer(struct extent_buffer *dst, unsigned long dst_offset, ...@@ -5124,9 +5124,9 @@ void memcpy_extent_buffer(struct extent_buffer *dst, unsigned long dst_offset,
while (len > 0) { while (len > 0) {
dst_off_in_page = (start_offset + dst_offset) & dst_off_in_page = (start_offset + dst_offset) &
((unsigned long)PAGE_CACHE_SIZE - 1); (PAGE_CACHE_SIZE - 1);
src_off_in_page = (start_offset + src_offset) & src_off_in_page = (start_offset + src_offset) &
((unsigned long)PAGE_CACHE_SIZE - 1); (PAGE_CACHE_SIZE - 1);
dst_i = (start_offset + dst_offset) >> PAGE_CACHE_SHIFT; dst_i = (start_offset + dst_offset) >> PAGE_CACHE_SHIFT;
src_i = (start_offset + src_offset) >> PAGE_CACHE_SHIFT; src_i = (start_offset + src_offset) >> PAGE_CACHE_SHIFT;
...@@ -5177,9 +5177,9 @@ void memmove_extent_buffer(struct extent_buffer *dst, unsigned long dst_offset, ...@@ -5177,9 +5177,9 @@ void memmove_extent_buffer(struct extent_buffer *dst, unsigned long dst_offset,
src_i = (start_offset + src_end) >> PAGE_CACHE_SHIFT; src_i = (start_offset + src_end) >> PAGE_CACHE_SHIFT;
dst_off_in_page = (start_offset + dst_end) & dst_off_in_page = (start_offset + dst_end) &
((unsigned long)PAGE_CACHE_SIZE - 1); (PAGE_CACHE_SIZE - 1);
src_off_in_page = (start_offset + src_end) & src_off_in_page = (start_offset + src_end) &
((unsigned long)PAGE_CACHE_SIZE - 1); (PAGE_CACHE_SIZE - 1);
cur = min_t(unsigned long, len, src_off_in_page + 1); cur = min_t(unsigned long, len, src_off_in_page + 1);
cur = min(cur, dst_off_in_page + 1); cur = min(cur, dst_off_in_page + 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment