super.c (a468f0ef516fda9c7d91bb550d458e853d76955e) super.c (aaec2b1d18792a5f27b69ff37f34f43f89f5aa3b)
1/*
2 * fs/f2fs/super.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 722 unchanged lines hidden (view full) ---

731 mutex_lock(&sbi->umount_mutex);
732
733 /*
734 * We don't need to do checkpoint when superblock is clean.
735 * But, the previous checkpoint was not done by umount, it needs to do
736 * clean checkpoint again.
737 */
738 if (is_sbi_flag_set(sbi, SBI_IS_DIRTY) ||
1/*
2 * fs/f2fs/super.c
3 *
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 * http://www.samsung.com/
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as

--- 722 unchanged lines hidden (view full) ---

731 mutex_lock(&sbi->umount_mutex);
732
733 /*
734 * We don't need to do checkpoint when superblock is clean.
735 * But, the previous checkpoint was not done by umount, it needs to do
736 * clean checkpoint again.
737 */
738 if (is_sbi_flag_set(sbi, SBI_IS_DIRTY) ||
739 !is_set_ckpt_flags(F2FS_CKPT(sbi), CP_UMOUNT_FLAG)) {
739 !is_set_ckpt_flags(sbi, CP_UMOUNT_FLAG)) {
740 struct cp_control cpc = {
741 .reason = CP_UMOUNT,
742 };
743 write_checkpoint(sbi, &cpc);
744 }
745
746 /* write_checkpoint can update stat informaion */
747 f2fs_destroy_stats(sbi);

--- 725 unchanged lines hidden (view full) ---

1473 sbi->interval_time[CP_TIME] = DEF_CP_INTERVAL;
1474 sbi->interval_time[REQ_TIME] = DEF_IDLE_INTERVAL;
1475 clear_sbi_flag(sbi, SBI_NEED_FSCK);
1476
1477 INIT_LIST_HEAD(&sbi->s_list);
1478 mutex_init(&sbi->umount_mutex);
1479 mutex_init(&sbi->wio_mutex[NODE]);
1480 mutex_init(&sbi->wio_mutex[DATA]);
740 struct cp_control cpc = {
741 .reason = CP_UMOUNT,
742 };
743 write_checkpoint(sbi, &cpc);
744 }
745
746 /* write_checkpoint can update stat informaion */
747 f2fs_destroy_stats(sbi);

--- 725 unchanged lines hidden (view full) ---

1473 sbi->interval_time[CP_TIME] = DEF_CP_INTERVAL;
1474 sbi->interval_time[REQ_TIME] = DEF_IDLE_INTERVAL;
1475 clear_sbi_flag(sbi, SBI_NEED_FSCK);
1476
1477 INIT_LIST_HEAD(&sbi->s_list);
1478 mutex_init(&sbi->umount_mutex);
1479 mutex_init(&sbi->wio_mutex[NODE]);
1480 mutex_init(&sbi->wio_mutex[DATA]);
1481 spin_lock_init(&sbi->cp_lock);
1481
1482#ifdef CONFIG_F2FS_FS_ENCRYPTION
1483 memcpy(sbi->key_prefix, F2FS_KEY_DESC_PREFIX,
1484 F2FS_KEY_DESC_PREFIX_SIZE);
1485 sbi->key_prefix_size = F2FS_KEY_DESC_PREFIX_SIZE;
1486#endif
1487}
1488

--- 325 unchanged lines hidden (view full) ---

1814
1815 /* recover fsynced data */
1816 if (!test_opt(sbi, DISABLE_ROLL_FORWARD)) {
1817 /*
1818 * mount should be failed, when device has readonly mode, and
1819 * previous checkpoint was not done by clean system shutdown.
1820 */
1821 if (bdev_read_only(sb->s_bdev) &&
1482
1483#ifdef CONFIG_F2FS_FS_ENCRYPTION
1484 memcpy(sbi->key_prefix, F2FS_KEY_DESC_PREFIX,
1485 F2FS_KEY_DESC_PREFIX_SIZE);
1486 sbi->key_prefix_size = F2FS_KEY_DESC_PREFIX_SIZE;
1487#endif
1488}
1489

--- 325 unchanged lines hidden (view full) ---

1815
1816 /* recover fsynced data */
1817 if (!test_opt(sbi, DISABLE_ROLL_FORWARD)) {
1818 /*
1819 * mount should be failed, when device has readonly mode, and
1820 * previous checkpoint was not done by clean system shutdown.
1821 */
1822 if (bdev_read_only(sb->s_bdev) &&
1822 !is_set_ckpt_flags(sbi->ckpt, CP_UMOUNT_FLAG)) {
1823 !is_set_ckpt_flags(sbi, CP_UMOUNT_FLAG)) {
1823 err = -EROFS;
1824 goto free_kobj;
1825 }
1826
1827 if (need_fsck)
1828 set_sbi_flag(sbi, SBI_NEED_FSCK);
1829
1830 if (!retry)

--- 233 unchanged lines hidden ---
1824 err = -EROFS;
1825 goto free_kobj;
1826 }
1827
1828 if (need_fsck)
1829 set_sbi_flag(sbi, SBI_NEED_FSCK);
1830
1831 if (!retry)

--- 233 unchanged lines hidden ---