super.c (1beba1b3a953107c3ff5448ab4e4297db4619c76) super.c (41382ec43255b502321c3c27f1347efeb3279290)
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

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

612}
613
614static void destroy_percpu_info(struct f2fs_sb_info *sbi)
615{
616 int i;
617
618 for (i = 0; i < NR_COUNT_TYPE; i++)
619 percpu_counter_destroy(&sbi->nr_pages[i]);
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

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

612}
613
614static void destroy_percpu_info(struct f2fs_sb_info *sbi)
615{
616 int i;
617
618 for (i = 0; i < NR_COUNT_TYPE; i++)
619 percpu_counter_destroy(&sbi->nr_pages[i]);
620 percpu_counter_destroy(&sbi->alloc_valid_block_count);
620}
621
622static void f2fs_put_super(struct super_block *sb)
623{
624 struct f2fs_sb_info *sbi = F2FS_SB(sb);
625
626 if (sbi->s_proc) {
627 remove_proc_entry("segment_info", sbi->s_proc);

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

1377{
1378 int i, err;
1379
1380 for (i = 0; i < NR_COUNT_TYPE; i++) {
1381 err = percpu_counter_init(&sbi->nr_pages[i], 0, GFP_KERNEL);
1382 if (err)
1383 return err;
1384 }
621}
622
623static void f2fs_put_super(struct super_block *sb)
624{
625 struct f2fs_sb_info *sbi = F2FS_SB(sb);
626
627 if (sbi->s_proc) {
628 remove_proc_entry("segment_info", sbi->s_proc);

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

1378{
1379 int i, err;
1380
1381 for (i = 0; i < NR_COUNT_TYPE; i++) {
1382 err = percpu_counter_init(&sbi->nr_pages[i], 0, GFP_KERNEL);
1383 if (err)
1384 return err;
1385 }
1385 return 0;
1386
1387 return percpu_counter_init(&sbi->alloc_valid_block_count, 0,
1388 GFP_KERNEL);
1386}
1387
1388/*
1389 * Read f2fs raw super block.
1390 * Because we have two copies of super block, so read both of them
1391 * to get the first valid one. If any one of them is broken, we pass
1392 * them recovery flag back to the caller.
1393 */

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

1596 sbi->total_valid_node_count =
1597 le32_to_cpu(sbi->ckpt->valid_node_count);
1598 sbi->total_valid_inode_count =
1599 le32_to_cpu(sbi->ckpt->valid_inode_count);
1600 sbi->user_block_count = le64_to_cpu(sbi->ckpt->user_block_count);
1601 sbi->total_valid_block_count =
1602 le64_to_cpu(sbi->ckpt->valid_block_count);
1603 sbi->last_valid_block_count = sbi->total_valid_block_count;
1389}
1390
1391/*
1392 * Read f2fs raw super block.
1393 * Because we have two copies of super block, so read both of them
1394 * to get the first valid one. If any one of them is broken, we pass
1395 * them recovery flag back to the caller.
1396 */

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

1599 sbi->total_valid_node_count =
1600 le32_to_cpu(sbi->ckpt->valid_node_count);
1601 sbi->total_valid_inode_count =
1602 le32_to_cpu(sbi->ckpt->valid_inode_count);
1603 sbi->user_block_count = le64_to_cpu(sbi->ckpt->user_block_count);
1604 sbi->total_valid_block_count =
1605 le64_to_cpu(sbi->ckpt->valid_block_count);
1606 sbi->last_valid_block_count = sbi->total_valid_block_count;
1604 sbi->alloc_valid_block_count = 0;
1607
1605 for (i = 0; i < NR_INODE_TYPE; i++) {
1606 INIT_LIST_HEAD(&sbi->inode_list[i]);
1607 spin_lock_init(&sbi->inode_lock[i]);
1608 }
1609
1610 init_extent_cache_info(sbi);
1611
1612 init_ino_entry_info(sbi);

--- 328 unchanged lines hidden ---
1608 for (i = 0; i < NR_INODE_TYPE; i++) {
1609 INIT_LIST_HEAD(&sbi->inode_list[i]);
1610 spin_lock_init(&sbi->inode_lock[i]);
1611 }
1612
1613 init_extent_cache_info(sbi);
1614
1615 init_ino_entry_info(sbi);

--- 328 unchanged lines hidden ---