diff options
| author | Kirill A. Shutemov <kirill.shutemov@linux.intel.com> | 2016-04-01 08:29:47 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-04-04 13:41:08 -0400 |
| commit | 09cbfeaf1a5a67bfb3201e0c83c810cecb2efa5a (patch) | |
| tree | 6cdf210c9c0f981cd22544feeba701892ec19464 /fs/jffs2 | |
| parent | c05c2ec96bb8b7310da1055c7b9d786a3ec6dc0c (diff) | |
mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros
PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} macros were introduced *long* time
ago with promise that one day it will be possible to implement page
cache with bigger chunks than PAGE_SIZE.
This promise never materialized. And unlikely will.
We have many places where PAGE_CACHE_SIZE assumed to be equal to
PAGE_SIZE. And it's constant source of confusion on whether
PAGE_CACHE_* or PAGE_* constant should be used in a particular case,
especially on the border between fs and mm.
Global switching to PAGE_CACHE_SIZE != PAGE_SIZE would cause to much
breakage to be doable.
Let's stop pretending that pages in page cache are special. They are
not.
The changes are pretty straight-forward:
- <foo> << (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
- <foo> >> (PAGE_CACHE_SHIFT - PAGE_SHIFT) -> <foo>;
- PAGE_CACHE_{SIZE,SHIFT,MASK,ALIGN} -> PAGE_{SIZE,SHIFT,MASK,ALIGN};
- page_cache_get() -> get_page();
- page_cache_release() -> put_page();
This patch contains automated changes generated with coccinelle using
script below. For some reason, coccinelle doesn't patch header files.
I've called spatch for them manually.
The only adjustment after coccinelle is revert of changes to
PAGE_CAHCE_ALIGN definition: we are going to drop it later.
There are few places in the code where coccinelle didn't reach. I'll
fix them manually in a separate patch. Comments and documentation also
will be addressed with the separate patch.
virtual patch
@@
expression E;
@@
- E << (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E
@@
expression E;
@@
- E >> (PAGE_CACHE_SHIFT - PAGE_SHIFT)
+ E
@@
@@
- PAGE_CACHE_SHIFT
+ PAGE_SHIFT
@@
@@
- PAGE_CACHE_SIZE
+ PAGE_SIZE
@@
@@
- PAGE_CACHE_MASK
+ PAGE_MASK
@@
expression E;
@@
- PAGE_CACHE_ALIGN(E)
+ PAGE_ALIGN(E)
@@
expression E;
@@
- page_cache_get(E)
+ get_page(E)
@@
expression E;
@@
- page_cache_release(E)
+ put_page(E)
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/jffs2')
| -rw-r--r-- | fs/jffs2/debug.c | 8 | ||||
| -rw-r--r-- | fs/jffs2/file.c | 23 | ||||
| -rw-r--r-- | fs/jffs2/fs.c | 8 | ||||
| -rw-r--r-- | fs/jffs2/gc.c | 8 | ||||
| -rw-r--r-- | fs/jffs2/nodelist.c | 8 | ||||
| -rw-r--r-- | fs/jffs2/write.c | 7 |
6 files changed, 32 insertions, 30 deletions
diff --git a/fs/jffs2/debug.c b/fs/jffs2/debug.c index 1090eb64b90d..9d26b1b9fc01 100644 --- a/fs/jffs2/debug.c +++ b/fs/jffs2/debug.c | |||
| @@ -95,15 +95,15 @@ __jffs2_dbg_fragtree_paranoia_check_nolock(struct jffs2_inode_info *f) | |||
| 95 | rather than mucking around with actually reading the node | 95 | rather than mucking around with actually reading the node |
| 96 | and checking the compression type, which is the real way | 96 | and checking the compression type, which is the real way |
| 97 | to tell a hole node. */ | 97 | to tell a hole node. */ |
| 98 | if (frag->ofs & (PAGE_CACHE_SIZE-1) && frag_prev(frag) | 98 | if (frag->ofs & (PAGE_SIZE-1) && frag_prev(frag) |
| 99 | && frag_prev(frag)->size < PAGE_CACHE_SIZE && frag_prev(frag)->node) { | 99 | && frag_prev(frag)->size < PAGE_SIZE && frag_prev(frag)->node) { |
| 100 | JFFS2_ERROR("REF_PRISTINE node at 0x%08x had a previous non-hole frag in the same page. Tell dwmw2.\n", | 100 | JFFS2_ERROR("REF_PRISTINE node at 0x%08x had a previous non-hole frag in the same page. Tell dwmw2.\n", |
| 101 | ref_offset(fn->raw)); | 101 | ref_offset(fn->raw)); |
| 102 | bitched = 1; | 102 | bitched = 1; |
| 103 | } | 103 | } |
| 104 | 104 | ||
| 105 | if ((frag->ofs+frag->size) & (PAGE_CACHE_SIZE-1) && frag_next(frag) | 105 | if ((frag->ofs+frag->size) & (PAGE_SIZE-1) && frag_next(frag) |
| 106 | && frag_next(frag)->size < PAGE_CACHE_SIZE && frag_next(frag)->node) { | 106 | && frag_next(frag)->size < PAGE_SIZE && frag_next(frag)->node) { |
| 107 | JFFS2_ERROR("REF_PRISTINE node at 0x%08x (%08x-%08x) had a following non-hole frag in the same page. Tell dwmw2.\n", | 107 | JFFS2_ERROR("REF_PRISTINE node at 0x%08x (%08x-%08x) had a following non-hole frag in the same page. Tell dwmw2.\n", |
| 108 | ref_offset(fn->raw), frag->ofs, frag->ofs+frag->size); | 108 | ref_offset(fn->raw), frag->ofs, frag->ofs+frag->size); |
| 109 | bitched = 1; | 109 | bitched = 1; |
diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c index cad86bac3453..0e62dec3effc 100644 --- a/fs/jffs2/file.c +++ b/fs/jffs2/file.c | |||
| @@ -87,14 +87,15 @@ static int jffs2_do_readpage_nolock (struct inode *inode, struct page *pg) | |||
| 87 | int ret; | 87 | int ret; |
| 88 | 88 | ||
| 89 | jffs2_dbg(2, "%s(): ino #%lu, page at offset 0x%lx\n", | 89 | jffs2_dbg(2, "%s(): ino #%lu, page at offset 0x%lx\n", |
| 90 | __func__, inode->i_ino, pg->index << PAGE_CACHE_SHIFT); | 90 | __func__, inode->i_ino, pg->index << PAGE_SHIFT); |
| 91 | 91 | ||
| 92 | BUG_ON(!PageLocked(pg)); | 92 | BUG_ON(!PageLocked(pg)); |
| 93 | 93 | ||
| 94 | pg_buf = kmap(pg); | 94 | pg_buf = kmap(pg); |
| 95 | /* FIXME: Can kmap fail? */ | 95 | /* FIXME: Can kmap fail? */ |
| 96 | 96 | ||
| 97 | ret = jffs2_read_inode_range(c, f, pg_buf, pg->index << PAGE_CACHE_SHIFT, PAGE_CACHE_SIZE); | 97 | ret = jffs2_read_inode_range(c, f, pg_buf, pg->index << PAGE_SHIFT, |
| 98 | PAGE_SIZE); | ||
| 98 | 99 | ||
| 99 | if (ret) { | 100 | if (ret) { |
| 100 | ClearPageUptodate(pg); | 101 | ClearPageUptodate(pg); |
| @@ -137,8 +138,8 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping, | |||
| 137 | struct page *pg; | 138 | struct page *pg; |
| 138 | struct inode *inode = mapping->host; | 139 | struct inode *inode = mapping->host; |
| 139 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); | 140 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); |
| 140 | pgoff_t index = pos >> PAGE_CACHE_SHIFT; | 141 | pgoff_t index = pos >> PAGE_SHIFT; |
| 141 | uint32_t pageofs = index << PAGE_CACHE_SHIFT; | 142 | uint32_t pageofs = index << PAGE_SHIFT; |
| 142 | int ret = 0; | 143 | int ret = 0; |
| 143 | 144 | ||
| 144 | pg = grab_cache_page_write_begin(mapping, index, flags); | 145 | pg = grab_cache_page_write_begin(mapping, index, flags); |
| @@ -230,7 +231,7 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping, | |||
| 230 | 231 | ||
| 231 | out_page: | 232 | out_page: |
| 232 | unlock_page(pg); | 233 | unlock_page(pg); |
| 233 | page_cache_release(pg); | 234 | put_page(pg); |
| 234 | return ret; | 235 | return ret; |
| 235 | } | 236 | } |
| 236 | 237 | ||
| @@ -245,14 +246,14 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, | |||
| 245 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); | 246 | struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); |
| 246 | struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); | 247 | struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); |
| 247 | struct jffs2_raw_inode *ri; | 248 | struct jffs2_raw_inode *ri; |
| 248 | unsigned start = pos & (PAGE_CACHE_SIZE - 1); | 249 | unsigned start = pos & (PAGE_SIZE - 1); |
| 249 | unsigned end = start + copied; | 250 | unsigned end = start + copied; |
| 250 | unsigned aligned_start = start & ~3; | 251 | unsigned aligned_start = start & ~3; |
| 251 | int ret = 0; | 252 | int ret = 0; |
| 252 | uint32_t writtenlen = 0; | 253 | uint32_t writtenlen = 0; |
| 253 | 254 | ||
| 254 | jffs2_dbg(1, "%s(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n", | 255 | jffs2_dbg(1, "%s(): ino #%lu, page at 0x%lx, range %d-%d, flags %lx\n", |
| 255 | __func__, inode->i_ino, pg->index << PAGE_CACHE_SHIFT, | 256 | __func__, inode->i_ino, pg->index << PAGE_SHIFT, |
| 256 | start, end, pg->flags); | 257 | start, end, pg->flags); |
| 257 | 258 | ||
| 258 | /* We need to avoid deadlock with page_cache_read() in | 259 | /* We need to avoid deadlock with page_cache_read() in |
| @@ -261,7 +262,7 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, | |||
| 261 | to re-lock it. */ | 262 | to re-lock it. */ |
| 262 | BUG_ON(!PageUptodate(pg)); | 263 | BUG_ON(!PageUptodate(pg)); |
| 263 | 264 | ||
| 264 | if (end == PAGE_CACHE_SIZE) { | 265 | if (end == PAGE_SIZE) { |
| 265 | /* When writing out the end of a page, write out the | 266 | /* When writing out the end of a page, write out the |
| 266 | _whole_ page. This helps to reduce the number of | 267 | _whole_ page. This helps to reduce the number of |
| 267 | nodes in files which have many short writes, like | 268 | nodes in files which have many short writes, like |
| @@ -275,7 +276,7 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, | |||
| 275 | jffs2_dbg(1, "%s(): Allocation of raw inode failed\n", | 276 | jffs2_dbg(1, "%s(): Allocation of raw inode failed\n", |
| 276 | __func__); | 277 | __func__); |
| 277 | unlock_page(pg); | 278 | unlock_page(pg); |
| 278 | page_cache_release(pg); | 279 | put_page(pg); |
| 279 | return -ENOMEM; | 280 | return -ENOMEM; |
| 280 | } | 281 | } |
| 281 | 282 | ||
| @@ -292,7 +293,7 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, | |||
| 292 | kmap(pg); | 293 | kmap(pg); |
| 293 | 294 | ||
| 294 | ret = jffs2_write_inode_range(c, f, ri, page_address(pg) + aligned_start, | 295 | ret = jffs2_write_inode_range(c, f, ri, page_address(pg) + aligned_start, |
| 295 | (pg->index << PAGE_CACHE_SHIFT) + aligned_start, | 296 | (pg->index << PAGE_SHIFT) + aligned_start, |
| 296 | end - aligned_start, &writtenlen); | 297 | end - aligned_start, &writtenlen); |
| 297 | 298 | ||
| 298 | kunmap(pg); | 299 | kunmap(pg); |
| @@ -329,6 +330,6 @@ static int jffs2_write_end(struct file *filp, struct address_space *mapping, | |||
| 329 | jffs2_dbg(1, "%s() returning %d\n", | 330 | jffs2_dbg(1, "%s() returning %d\n", |
| 330 | __func__, writtenlen > 0 ? writtenlen : ret); | 331 | __func__, writtenlen > 0 ? writtenlen : ret); |
| 331 | unlock_page(pg); | 332 | unlock_page(pg); |
| 332 | page_cache_release(pg); | 333 | put_page(pg); |
| 333 | return writtenlen > 0 ? writtenlen : ret; | 334 | return writtenlen > 0 ? writtenlen : ret; |
| 334 | } | 335 | } |
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index bead25ae8fe4..ae2ebb26b446 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
| @@ -586,8 +586,8 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent) | |||
| 586 | goto out_root; | 586 | goto out_root; |
| 587 | 587 | ||
| 588 | sb->s_maxbytes = 0xFFFFFFFF; | 588 | sb->s_maxbytes = 0xFFFFFFFF; |
| 589 | sb->s_blocksize = PAGE_CACHE_SIZE; | 589 | sb->s_blocksize = PAGE_SIZE; |
| 590 | sb->s_blocksize_bits = PAGE_CACHE_SHIFT; | 590 | sb->s_blocksize_bits = PAGE_SHIFT; |
| 591 | sb->s_magic = JFFS2_SUPER_MAGIC; | 591 | sb->s_magic = JFFS2_SUPER_MAGIC; |
| 592 | if (!(sb->s_flags & MS_RDONLY)) | 592 | if (!(sb->s_flags & MS_RDONLY)) |
| 593 | jffs2_start_garbage_collect_thread(c); | 593 | jffs2_start_garbage_collect_thread(c); |
| @@ -685,7 +685,7 @@ unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, | |||
| 685 | struct inode *inode = OFNI_EDONI_2SFFJ(f); | 685 | struct inode *inode = OFNI_EDONI_2SFFJ(f); |
| 686 | struct page *pg; | 686 | struct page *pg; |
| 687 | 687 | ||
| 688 | pg = read_cache_page(inode->i_mapping, offset >> PAGE_CACHE_SHIFT, | 688 | pg = read_cache_page(inode->i_mapping, offset >> PAGE_SHIFT, |
| 689 | (void *)jffs2_do_readpage_unlock, inode); | 689 | (void *)jffs2_do_readpage_unlock, inode); |
| 690 | if (IS_ERR(pg)) | 690 | if (IS_ERR(pg)) |
| 691 | return (void *)pg; | 691 | return (void *)pg; |
| @@ -701,7 +701,7 @@ void jffs2_gc_release_page(struct jffs2_sb_info *c, | |||
| 701 | struct page *pg = (void *)*priv; | 701 | struct page *pg = (void *)*priv; |
| 702 | 702 | ||
| 703 | kunmap(pg); | 703 | kunmap(pg); |
| 704 | page_cache_release(pg); | 704 | put_page(pg); |
| 705 | } | 705 | } |
| 706 | 706 | ||
| 707 | static int jffs2_flash_setup(struct jffs2_sb_info *c) { | 707 | static int jffs2_flash_setup(struct jffs2_sb_info *c) { |
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index 7e553f286775..9ed0f26cf023 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c | |||
| @@ -552,7 +552,7 @@ static int jffs2_garbage_collect_live(struct jffs2_sb_info *c, struct jffs2_era | |||
| 552 | goto upnout; | 552 | goto upnout; |
| 553 | } | 553 | } |
| 554 | /* We found a datanode. Do the GC */ | 554 | /* We found a datanode. Do the GC */ |
| 555 | if((start >> PAGE_CACHE_SHIFT) < ((end-1) >> PAGE_CACHE_SHIFT)) { | 555 | if((start >> PAGE_SHIFT) < ((end-1) >> PAGE_SHIFT)) { |
| 556 | /* It crosses a page boundary. Therefore, it must be a hole. */ | 556 | /* It crosses a page boundary. Therefore, it must be a hole. */ |
| 557 | ret = jffs2_garbage_collect_hole(c, jeb, f, fn, start, end); | 557 | ret = jffs2_garbage_collect_hole(c, jeb, f, fn, start, end); |
| 558 | } else { | 558 | } else { |
| @@ -1192,8 +1192,8 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era | |||
| 1192 | struct jffs2_node_frag *frag; | 1192 | struct jffs2_node_frag *frag; |
| 1193 | uint32_t min, max; | 1193 | uint32_t min, max; |
| 1194 | 1194 | ||
| 1195 | min = start & ~(PAGE_CACHE_SIZE-1); | 1195 | min = start & ~(PAGE_SIZE-1); |
| 1196 | max = min + PAGE_CACHE_SIZE; | 1196 | max = min + PAGE_SIZE; |
| 1197 | 1197 | ||
| 1198 | frag = jffs2_lookup_node_frag(&f->fragtree, start); | 1198 | frag = jffs2_lookup_node_frag(&f->fragtree, start); |
| 1199 | 1199 | ||
| @@ -1351,7 +1351,7 @@ static int jffs2_garbage_collect_dnode(struct jffs2_sb_info *c, struct jffs2_era | |||
| 1351 | cdatalen = min_t(uint32_t, alloclen - sizeof(ri), end - offset); | 1351 | cdatalen = min_t(uint32_t, alloclen - sizeof(ri), end - offset); |
| 1352 | datalen = end - offset; | 1352 | datalen = end - offset; |
| 1353 | 1353 | ||
| 1354 | writebuf = pg_ptr + (offset & (PAGE_CACHE_SIZE -1)); | 1354 | writebuf = pg_ptr + (offset & (PAGE_SIZE -1)); |
| 1355 | 1355 | ||
| 1356 | comprtype = jffs2_compress(c, f, writebuf, &comprbuf, &datalen, &cdatalen); | 1356 | comprtype = jffs2_compress(c, f, writebuf, &comprbuf, &datalen, &cdatalen); |
| 1357 | 1357 | ||
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c index 9a5449bc3afb..b86c78d178c6 100644 --- a/fs/jffs2/nodelist.c +++ b/fs/jffs2/nodelist.c | |||
| @@ -90,7 +90,7 @@ uint32_t jffs2_truncate_fragtree(struct jffs2_sb_info *c, struct rb_root *list, | |||
| 90 | 90 | ||
| 91 | /* If the last fragment starts at the RAM page boundary, it is | 91 | /* If the last fragment starts at the RAM page boundary, it is |
| 92 | * REF_PRISTINE irrespective of its size. */ | 92 | * REF_PRISTINE irrespective of its size. */ |
| 93 | if (frag->node && (frag->ofs & (PAGE_CACHE_SIZE - 1)) == 0) { | 93 | if (frag->node && (frag->ofs & (PAGE_SIZE - 1)) == 0) { |
| 94 | dbg_fragtree2("marking the last fragment 0x%08x-0x%08x REF_PRISTINE.\n", | 94 | dbg_fragtree2("marking the last fragment 0x%08x-0x%08x REF_PRISTINE.\n", |
| 95 | frag->ofs, frag->ofs + frag->size); | 95 | frag->ofs, frag->ofs + frag->size); |
| 96 | frag->node->raw->flash_offset = ref_offset(frag->node->raw) | REF_PRISTINE; | 96 | frag->node->raw->flash_offset = ref_offset(frag->node->raw) | REF_PRISTINE; |
| @@ -237,7 +237,7 @@ static int jffs2_add_frag_to_fragtree(struct jffs2_sb_info *c, struct rb_root *r | |||
| 237 | If so, both 'this' and the new node get marked REF_NORMAL so | 237 | If so, both 'this' and the new node get marked REF_NORMAL so |
| 238 | the GC can take a look. | 238 | the GC can take a look. |
| 239 | */ | 239 | */ |
| 240 | if (lastend && (lastend-1) >> PAGE_CACHE_SHIFT == newfrag->ofs >> PAGE_CACHE_SHIFT) { | 240 | if (lastend && (lastend-1) >> PAGE_SHIFT == newfrag->ofs >> PAGE_SHIFT) { |
| 241 | if (this->node) | 241 | if (this->node) |
| 242 | mark_ref_normal(this->node->raw); | 242 | mark_ref_normal(this->node->raw); |
| 243 | mark_ref_normal(newfrag->node->raw); | 243 | mark_ref_normal(newfrag->node->raw); |
| @@ -382,7 +382,7 @@ int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_in | |||
| 382 | 382 | ||
| 383 | /* If we now share a page with other nodes, mark either previous | 383 | /* If we now share a page with other nodes, mark either previous |
| 384 | or next node REF_NORMAL, as appropriate. */ | 384 | or next node REF_NORMAL, as appropriate. */ |
| 385 | if (newfrag->ofs & (PAGE_CACHE_SIZE-1)) { | 385 | if (newfrag->ofs & (PAGE_SIZE-1)) { |
| 386 | struct jffs2_node_frag *prev = frag_prev(newfrag); | 386 | struct jffs2_node_frag *prev = frag_prev(newfrag); |
| 387 | 387 | ||
| 388 | mark_ref_normal(fn->raw); | 388 | mark_ref_normal(fn->raw); |
| @@ -391,7 +391,7 @@ int jffs2_add_full_dnode_to_inode(struct jffs2_sb_info *c, struct jffs2_inode_in | |||
| 391 | mark_ref_normal(prev->node->raw); | 391 | mark_ref_normal(prev->node->raw); |
| 392 | } | 392 | } |
| 393 | 393 | ||
| 394 | if ((newfrag->ofs+newfrag->size) & (PAGE_CACHE_SIZE-1)) { | 394 | if ((newfrag->ofs+newfrag->size) & (PAGE_SIZE-1)) { |
| 395 | struct jffs2_node_frag *next = frag_next(newfrag); | 395 | struct jffs2_node_frag *next = frag_next(newfrag); |
| 396 | 396 | ||
| 397 | if (next) { | 397 | if (next) { |
diff --git a/fs/jffs2/write.c b/fs/jffs2/write.c index b634de4c8101..7fb187ab2682 100644 --- a/fs/jffs2/write.c +++ b/fs/jffs2/write.c | |||
| @@ -172,8 +172,8 @@ struct jffs2_full_dnode *jffs2_write_dnode(struct jffs2_sb_info *c, struct jffs2 | |||
| 172 | beginning of a page and runs to the end of the file, or if | 172 | beginning of a page and runs to the end of the file, or if |
| 173 | it's a hole node, mark it REF_PRISTINE, else REF_NORMAL. | 173 | it's a hole node, mark it REF_PRISTINE, else REF_NORMAL. |
| 174 | */ | 174 | */ |
| 175 | if ((je32_to_cpu(ri->dsize) >= PAGE_CACHE_SIZE) || | 175 | if ((je32_to_cpu(ri->dsize) >= PAGE_SIZE) || |
| 176 | ( ((je32_to_cpu(ri->offset)&(PAGE_CACHE_SIZE-1))==0) && | 176 | ( ((je32_to_cpu(ri->offset)&(PAGE_SIZE-1))==0) && |
| 177 | (je32_to_cpu(ri->dsize)+je32_to_cpu(ri->offset) == je32_to_cpu(ri->isize)))) { | 177 | (je32_to_cpu(ri->dsize)+je32_to_cpu(ri->offset) == je32_to_cpu(ri->isize)))) { |
| 178 | flash_ofs |= REF_PRISTINE; | 178 | flash_ofs |= REF_PRISTINE; |
| 179 | } else { | 179 | } else { |
| @@ -366,7 +366,8 @@ int jffs2_write_inode_range(struct jffs2_sb_info *c, struct jffs2_inode_info *f, | |||
| 366 | break; | 366 | break; |
| 367 | } | 367 | } |
| 368 | mutex_lock(&f->sem); | 368 | mutex_lock(&f->sem); |
| 369 | datalen = min_t(uint32_t, writelen, PAGE_CACHE_SIZE - (offset & (PAGE_CACHE_SIZE-1))); | 369 | datalen = min_t(uint32_t, writelen, |
| 370 | PAGE_SIZE - (offset & (PAGE_SIZE-1))); | ||
| 370 | cdatalen = min_t(uint32_t, alloclen - sizeof(*ri), datalen); | 371 | cdatalen = min_t(uint32_t, alloclen - sizeof(*ri), datalen); |
| 371 | 372 | ||
| 372 | comprtype = jffs2_compress(c, f, buf, &comprbuf, &datalen, &cdatalen); | 373 | comprtype = jffs2_compress(c, f, buf, &comprbuf, &datalen, &cdatalen); |
