diff options
Diffstat (limited to 'fs/jffs2/fs.c')
-rw-r--r-- | fs/jffs2/fs.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c index d0b59d03a7a9..05fe6cf5f1ac 100644 --- a/fs/jffs2/fs.c +++ b/fs/jffs2/fs.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/sched.h> | 17 | #include <linux/sched.h> |
18 | #include <linux/cred.h> | 18 | #include <linux/cred.h> |
19 | #include <linux/fs.h> | 19 | #include <linux/fs.h> |
20 | #include <linux/fs_context.h> | ||
20 | #include <linux/list.h> | 21 | #include <linux/list.h> |
21 | #include <linux/mtd/mtd.h> | 22 | #include <linux/mtd/mtd.h> |
22 | #include <linux/pagemap.h> | 23 | #include <linux/pagemap.h> |
@@ -184,7 +185,7 @@ int jffs2_do_setattr (struct inode *inode, struct iattr *iattr) | |||
184 | if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) { | 185 | if (ivalid & ATTR_SIZE && inode->i_size > iattr->ia_size) { |
185 | truncate_setsize(inode, iattr->ia_size); | 186 | truncate_setsize(inode, iattr->ia_size); |
186 | inode->i_blocks = (inode->i_size + 511) >> 9; | 187 | inode->i_blocks = (inode->i_size + 511) >> 9; |
187 | } | 188 | } |
188 | 189 | ||
189 | return 0; | 190 | return 0; |
190 | } | 191 | } |
@@ -391,7 +392,7 @@ void jffs2_dirty_inode(struct inode *inode, int flags) | |||
391 | jffs2_do_setattr(inode, &iattr); | 392 | jffs2_do_setattr(inode, &iattr); |
392 | } | 393 | } |
393 | 394 | ||
394 | 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) |
395 | { | 396 | { |
396 | struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); | 397 | struct jffs2_sb_info *c = JFFS2_SB_INFO(sb); |
397 | 398 | ||
@@ -409,10 +410,10 @@ int jffs2_do_remount_fs(struct super_block *sb, int *flags, char *data) | |||
409 | mutex_unlock(&c->alloc_sem); | 410 | mutex_unlock(&c->alloc_sem); |
410 | } | 411 | } |
411 | 412 | ||
412 | if (!(*flags & SB_RDONLY)) | 413 | if (!(fc->sb_flags & SB_RDONLY)) |
413 | jffs2_start_garbage_collect_thread(c); | 414 | jffs2_start_garbage_collect_thread(c); |
414 | 415 | ||
415 | *flags |= SB_NOATIME; | 416 | fc->sb_flags |= SB_NOATIME; |
416 | return 0; | 417 | return 0; |
417 | } | 418 | } |
418 | 419 | ||
@@ -509,7 +510,7 @@ static int calculate_inocache_hashsize(uint32_t flash_size) | |||
509 | return hashsize; | 510 | return hashsize; |
510 | } | 511 | } |
511 | 512 | ||
512 | 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) |
513 | { | 514 | { |
514 | struct jffs2_sb_info *c; | 515 | struct jffs2_sb_info *c; |
515 | struct inode *root_i; | 516 | struct inode *root_i; |
@@ -524,11 +525,11 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent) | |||
524 | 525 | ||
525 | #ifndef CONFIG_JFFS2_FS_WRITEBUFFER | 526 | #ifndef CONFIG_JFFS2_FS_WRITEBUFFER |
526 | if (c->mtd->type == MTD_NANDFLASH) { | 527 | if (c->mtd->type == MTD_NANDFLASH) { |
527 | 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"); |
528 | return -EINVAL; | 529 | return -EINVAL; |
529 | } | 530 | } |
530 | if (c->mtd->type == MTD_DATAFLASH) { | 531 | if (c->mtd->type == MTD_DATAFLASH) { |
531 | 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"); |
532 | return -EINVAL; | 533 | return -EINVAL; |
533 | } | 534 | } |
534 | #endif | 535 | #endif |
@@ -542,12 +543,12 @@ int jffs2_do_fill_super(struct super_block *sb, void *data, int silent) | |||
542 | */ | 543 | */ |
543 | if ((c->sector_size * blocks) != c->flash_size) { | 544 | if ((c->sector_size * blocks) != c->flash_size) { |
544 | c->flash_size = c->sector_size * blocks; | 545 | c->flash_size = c->sector_size * blocks; |
545 | pr_info("Flash size not aligned to erasesize, reducing to %dKiB\n", | 546 | infof(fc, "Flash size not aligned to erasesize, reducing to %dKiB", |
546 | c->flash_size / 1024); | 547 | c->flash_size / 1024); |
547 | } | 548 | } |
548 | 549 | ||
549 | if (c->flash_size < 5*c->sector_size) { | 550 | if (c->flash_size < 5*c->sector_size) { |
550 | pr_err("Too few erase blocks (%d)\n", | 551 | errorf(fc, "Too few erase blocks (%d)", |
551 | c->flash_size / c->sector_size); | 552 | c->flash_size / c->sector_size); |
552 | return -EINVAL; | 553 | return -EINVAL; |
553 | } | 554 | } |