| .. | .. |
|---|
| 17 | 17 | #include <linux/sched.h> |
|---|
| 18 | 18 | #include <linux/cred.h> |
|---|
| 19 | 19 | #include <linux/fs.h> |
|---|
| 20 | +#include <linux/fs_context.h> |
|---|
| 20 | 21 | #include <linux/list.h> |
|---|
| 21 | 22 | #include <linux/mtd/mtd.h> |
|---|
| 22 | 23 | #include <linux/pagemap.h> |
|---|
| .. | .. |
|---|
| 184 | 185 | if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) { |
|---|
| 185 | 186 | truncate_setsize(inode, iattr->ia_size); |
|---|
| 186 | 187 | inode->i_blocks = (inode->i_size + 511) >> 9; |
|---|
| 187 | | - } |
|---|
| 188 | + } |
|---|
| 188 | 189 | |
|---|
| 189 | 190 | return 0; |
|---|
| 190 | 191 | } |
|---|
| .. | .. |
|---|
| 340 | 341 | rdev = old_decode_dev(je16_to_cpu(jdev.old_id)); |
|---|
| 341 | 342 | else |
|---|
| 342 | 343 | rdev = new_decode_dev(je32_to_cpu(jdev.new_id)); |
|---|
| 344 | + fallthrough; |
|---|
| 343 | 345 | |
|---|
| 344 | 346 | case S_IFSOCK: |
|---|
| 345 | 347 | case S_IFIFO: |
|---|
| .. | .. |
|---|
| 390 | 392 | jffs2_do_setattr(inode, &iattr); |
|---|
| 391 | 393 | } |
|---|
| 392 | 394 | |
|---|
| 393 | | -int jffs2_do_remount_fs(struct super_block *sb, int *flags, char *data) |
|---|
| 395 | +int jffs2_do_remount_fs(struct super_block *sb, struct fs_context *fc) |
|---|
| 394 | 396 | { |
|---|
| 395 | 397 | struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); |
|---|
| 396 | 398 | |
|---|
| .. | .. |
|---|
| 408 | 410 | mutex_unlock(&c->alloc_sem); |
|---|
| 409 | 411 | } |
|---|
| 410 | 412 | |
|---|
| 411 | | - if (!(*flags & SB_RDONLY)) |
|---|
| 413 | + if (!(fc->sb_flags & SB_RDONLY)) |
|---|
| 412 | 414 | jffs2_start_garbage_collect_thread(c); |
|---|
| 413 | 415 | |
|---|
| 414 | | - *flags |= SB_NOATIME; |
|---|
| 416 | + fc->sb_flags |= SB_NOATIME; |
|---|
| 415 | 417 | return 0; |
|---|
| 416 | 418 | } |
|---|
| 417 | 419 | |
|---|
| .. | .. |
|---|
| 508 | 510 | return hashsize; |
|---|
| 509 | 511 | } |
|---|
| 510 | 512 | |
|---|
| 511 | | -int jffs2_do_fill_super(struct super_block *sb, void *data, int silent) |
|---|
| 513 | +int jffs2_do_fill_super(struct super_block *sb, struct fs_context *fc) |
|---|
| 512 | 514 | { |
|---|
| 513 | 515 | struct jffs2_sb_info *c; |
|---|
| 514 | 516 | struct inode *root_i; |
|---|
| .. | .. |
|---|
| 523 | 525 | |
|---|
| 524 | 526 | #ifndef CONFIG_JFFS2_FS_WRITEBUFFER |
|---|
| 525 | 527 | if (c->mtd->type == MTD_NANDFLASH) { |
|---|
| 526 | | - pr_err("Cannot operate on NAND flash unless jffs2 NAND support is compiled in\n"); |
|---|
| 528 | + errorf(fc, "Cannot operate on NAND flash unless jffs2 NAND support is compiled in"); |
|---|
| 527 | 529 | return -EINVAL; |
|---|
| 528 | 530 | } |
|---|
| 529 | 531 | if (c->mtd->type == MTD_DATAFLASH) { |
|---|
| 530 | | - pr_err("Cannot operate on DataFlash unless jffs2 DataFlash support is compiled in\n"); |
|---|
| 532 | + errorf(fc, "Cannot operate on DataFlash unless jffs2 DataFlash support is compiled in"); |
|---|
| 531 | 533 | return -EINVAL; |
|---|
| 532 | 534 | } |
|---|
| 533 | 535 | #endif |
|---|
| .. | .. |
|---|
| 541 | 543 | */ |
|---|
| 542 | 544 | if ((c->sector_size * blocks) != c->flash_size) { |
|---|
| 543 | 545 | c->flash_size = c->sector_size * blocks; |
|---|
| 544 | | - pr_info("Flash size not aligned to erasesize, reducing to %dKiB\n", |
|---|
| 545 | | - c->flash_size / 1024); |
|---|
| 546 | + infof(fc, "Flash size not aligned to erasesize, reducing to %dKiB", |
|---|
| 547 | + c->flash_size / 1024); |
|---|
| 546 | 548 | } |
|---|
| 547 | 549 | |
|---|
| 548 | 550 | if (c->flash_size < 5*c->sector_size) { |
|---|
| 549 | | - pr_err("Too few erase blocks (%d)\n", |
|---|
| 551 | + errorf(fc, "Too few erase blocks (%d)", |
|---|
| 550 | 552 | c->flash_size / c->sector_size); |
|---|
| 551 | 553 | return -EINVAL; |
|---|
| 552 | 554 | } |
|---|
| .. | .. |
|---|
| 589 | 591 | sb->s_blocksize = PAGE_SIZE; |
|---|
| 590 | 592 | sb->s_blocksize_bits = PAGE_SHIFT; |
|---|
| 591 | 593 | sb->s_magic = JFFS2_SUPER_MAGIC; |
|---|
| 594 | + sb->s_time_min = 0; |
|---|
| 595 | + sb->s_time_max = U32_MAX; |
|---|
| 596 | + |
|---|
| 592 | 597 | if (!sb_rdonly(sb)) |
|---|
| 593 | 598 | jffs2_start_garbage_collect_thread(c); |
|---|
| 594 | 599 | return 0; |
|---|
| .. | .. |
|---|
| 597 | 602 | jffs2_free_ino_caches(c); |
|---|
| 598 | 603 | jffs2_free_raw_node_refs(c); |
|---|
| 599 | 604 | kvfree(c->blocks); |
|---|
| 600 | | - out_inohash: |
|---|
| 601 | 605 | jffs2_clear_xattr_subsystem(c); |
|---|
| 606 | + jffs2_sum_exit(c); |
|---|
| 607 | + out_inohash: |
|---|
| 602 | 608 | kfree(c->inocache_list); |
|---|
| 603 | 609 | out_wbuf: |
|---|
| 604 | 610 | jffs2_flash_cleanup(c); |
|---|
| .. | .. |
|---|
| 675 | 681 | } |
|---|
| 676 | 682 | |
|---|
| 677 | 683 | return JFFS2_INODE_INFO(inode); |
|---|
| 678 | | -} |
|---|
| 679 | | - |
|---|
| 680 | | -unsigned char *jffs2_gc_fetch_page(struct jffs2_sb_info *c, |
|---|
| 681 | | - struct jffs2_inode_info *f, |
|---|
| 682 | | - unsigned long offset, |
|---|
| 683 | | - unsigned long *priv) |
|---|
| 684 | | -{ |
|---|
| 685 | | - struct inode *inode = OFNI_EDONI_2SFFJ(f); |
|---|
| 686 | | - struct page *pg; |
|---|
| 687 | | - |
|---|
| 688 | | - pg = read_cache_page(inode->i_mapping, offset >> PAGE_SHIFT, |
|---|
| 689 | | - jffs2_do_readpage_unlock, inode); |
|---|
| 690 | | - if (IS_ERR(pg)) |
|---|
| 691 | | - return (void *)pg; |
|---|
| 692 | | - |
|---|
| 693 | | - *priv = (unsigned long)pg; |
|---|
| 694 | | - return kmap(pg); |
|---|
| 695 | | -} |
|---|
| 696 | | - |
|---|
| 697 | | -void jffs2_gc_release_page(struct jffs2_sb_info *c, |
|---|
| 698 | | - unsigned char *ptr, |
|---|
| 699 | | - unsigned long *priv) |
|---|
| 700 | | -{ |
|---|
| 701 | | - struct page *pg = (void *)*priv; |
|---|
| 702 | | - |
|---|
| 703 | | - kunmap(pg); |
|---|
| 704 | | - put_page(pg); |
|---|
| 705 | 684 | } |
|---|
| 706 | 685 | |
|---|
| 707 | 686 | static int jffs2_flash_setup(struct jffs2_sb_info *c) { |
|---|