diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2011-03-08 21:05:08 -0500 |
---|---|---|
committer | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2011-03-08 21:05:08 -0500 |
commit | d96bbfa28aa7a1d5a5bf549026a594d7a273c5d7 (patch) | |
tree | da846510626ba9d2182790201db49aaba35dbdf3 /fs/nilfs2 | |
parent | 3fd3fe5aeaa171a5638d2bb54a1a170eab7b7cdc (diff) |
nilfs2: get rid of sc_sbi back pointer
Removes sci->sc_sbi which is a back pointer to nilfs_sb_info struct
from log writer object (nilfs_sc_info).
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r-- | fs/nilfs2/segment.c | 29 | ||||
-rw-r--r-- | fs/nilfs2/segment.h | 2 |
2 files changed, 12 insertions, 19 deletions
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index e3d1785faf1b..b14788ec0d15 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -772,7 +772,7 @@ static int nilfs_segctor_clean(struct nilfs_sc_info *sci) | |||
772 | 772 | ||
773 | static int nilfs_segctor_confirm(struct nilfs_sc_info *sci) | 773 | static int nilfs_segctor_confirm(struct nilfs_sc_info *sci) |
774 | { | 774 | { |
775 | struct the_nilfs *nilfs = sci->sc_sbi->s_nilfs; | 775 | struct the_nilfs *nilfs = NILFS_SB(sci->sc_super)->s_nilfs; |
776 | int ret = 0; | 776 | int ret = 0; |
777 | 777 | ||
778 | if (nilfs_test_metadata_dirty(nilfs, sci->sc_root)) | 778 | if (nilfs_test_metadata_dirty(nilfs, sci->sc_root)) |
@@ -788,8 +788,7 @@ static int nilfs_segctor_confirm(struct nilfs_sc_info *sci) | |||
788 | 788 | ||
789 | static void nilfs_segctor_clear_metadata_dirty(struct nilfs_sc_info *sci) | 789 | static void nilfs_segctor_clear_metadata_dirty(struct nilfs_sc_info *sci) |
790 | { | 790 | { |
791 | struct nilfs_sb_info *sbi = sci->sc_sbi; | 791 | struct the_nilfs *nilfs = NILFS_SB(sci->sc_super)->s_nilfs; |
792 | struct the_nilfs *nilfs = sbi->s_nilfs; | ||
793 | 792 | ||
794 | nilfs_mdt_clear_dirty(sci->sc_root->ifile); | 793 | nilfs_mdt_clear_dirty(sci->sc_root->ifile); |
795 | nilfs_mdt_clear_dirty(nilfs->ns_cpfile); | 794 | nilfs_mdt_clear_dirty(nilfs->ns_cpfile); |
@@ -799,7 +798,7 @@ static void nilfs_segctor_clear_metadata_dirty(struct nilfs_sc_info *sci) | |||
799 | 798 | ||
800 | static int nilfs_segctor_create_checkpoint(struct nilfs_sc_info *sci) | 799 | static int nilfs_segctor_create_checkpoint(struct nilfs_sc_info *sci) |
801 | { | 800 | { |
802 | struct the_nilfs *nilfs = sci->sc_sbi->s_nilfs; | 801 | struct the_nilfs *nilfs = NILFS_SB(sci->sc_super)->s_nilfs; |
803 | struct buffer_head *bh_cp; | 802 | struct buffer_head *bh_cp; |
804 | struct nilfs_checkpoint *raw_cp; | 803 | struct nilfs_checkpoint *raw_cp; |
805 | int err; | 804 | int err; |
@@ -823,8 +822,7 @@ static int nilfs_segctor_create_checkpoint(struct nilfs_sc_info *sci) | |||
823 | 822 | ||
824 | static int nilfs_segctor_fill_in_checkpoint(struct nilfs_sc_info *sci) | 823 | static int nilfs_segctor_fill_in_checkpoint(struct nilfs_sc_info *sci) |
825 | { | 824 | { |
826 | struct nilfs_sb_info *sbi = sci->sc_sbi; | 825 | struct the_nilfs *nilfs = NILFS_SB(sci->sc_super)->s_nilfs; |
827 | struct the_nilfs *nilfs = sbi->s_nilfs; | ||
828 | struct buffer_head *bh_cp; | 826 | struct buffer_head *bh_cp; |
829 | struct nilfs_checkpoint *raw_cp; | 827 | struct nilfs_checkpoint *raw_cp; |
830 | int err; | 828 | int err; |
@@ -1048,8 +1046,7 @@ static int nilfs_segctor_scan_file_dsync(struct nilfs_sc_info *sci, | |||
1048 | 1046 | ||
1049 | static int nilfs_segctor_collect_blocks(struct nilfs_sc_info *sci, int mode) | 1047 | static int nilfs_segctor_collect_blocks(struct nilfs_sc_info *sci, int mode) |
1050 | { | 1048 | { |
1051 | struct nilfs_sb_info *sbi = sci->sc_sbi; | 1049 | struct the_nilfs *nilfs = NILFS_SB(sci->sc_super)->s_nilfs; |
1052 | struct the_nilfs *nilfs = sbi->s_nilfs; | ||
1053 | struct list_head *head; | 1050 | struct list_head *head; |
1054 | struct nilfs_inode_info *ii; | 1051 | struct nilfs_inode_info *ii; |
1055 | size_t ndone; | 1052 | size_t ndone; |
@@ -1858,7 +1855,7 @@ static void nilfs_segctor_complete_write(struct nilfs_sc_info *sci) | |||
1858 | { | 1855 | { |
1859 | struct nilfs_segment_buffer *segbuf; | 1856 | struct nilfs_segment_buffer *segbuf; |
1860 | struct page *bd_page = NULL, *fs_page = NULL; | 1857 | struct page *bd_page = NULL, *fs_page = NULL; |
1861 | struct the_nilfs *nilfs = sci->sc_sbi->s_nilfs; | 1858 | struct the_nilfs *nilfs = NILFS_SB(sci->sc_super)->s_nilfs; |
1862 | int update_sr = false; | 1859 | int update_sr = false; |
1863 | 1860 | ||
1864 | list_for_each_entry(segbuf, &sci->sc_write_logs, sb_list) { | 1861 | list_for_each_entry(segbuf, &sci->sc_write_logs, sb_list) { |
@@ -2029,8 +2026,7 @@ static void nilfs_segctor_drop_written_files(struct nilfs_sc_info *sci, | |||
2029 | */ | 2026 | */ |
2030 | static int nilfs_segctor_do_construct(struct nilfs_sc_info *sci, int mode) | 2027 | static int nilfs_segctor_do_construct(struct nilfs_sc_info *sci, int mode) |
2031 | { | 2028 | { |
2032 | struct nilfs_sb_info *sbi = sci->sc_sbi; | 2029 | struct the_nilfs *nilfs = NILFS_SB(sci->sc_super)->s_nilfs; |
2033 | struct the_nilfs *nilfs = sbi->s_nilfs; | ||
2034 | struct page *failed_page; | 2030 | struct page *failed_page; |
2035 | int err; | 2031 | int err; |
2036 | 2032 | ||
@@ -2388,7 +2384,7 @@ static void nilfs_segctor_notify(struct nilfs_sc_info *sci, int mode, int err) | |||
2388 | */ | 2384 | */ |
2389 | static int nilfs_segctor_construct(struct nilfs_sc_info *sci, int mode) | 2385 | static int nilfs_segctor_construct(struct nilfs_sc_info *sci, int mode) |
2390 | { | 2386 | { |
2391 | struct nilfs_sb_info *sbi = sci->sc_sbi; | 2387 | struct nilfs_sb_info *sbi = NILFS_SB(sci->sc_super); |
2392 | struct the_nilfs *nilfs = sbi->s_nilfs; | 2388 | struct the_nilfs *nilfs = sbi->s_nilfs; |
2393 | struct nilfs_super_block **sbp; | 2389 | struct nilfs_super_block **sbp; |
2394 | int err = 0; | 2390 | int err = 0; |
@@ -2501,7 +2497,7 @@ int nilfs_clean_segments(struct super_block *sb, struct nilfs_argv *argv, | |||
2501 | 2497 | ||
2502 | static void nilfs_segctor_thread_construct(struct nilfs_sc_info *sci, int mode) | 2498 | static void nilfs_segctor_thread_construct(struct nilfs_sc_info *sci, int mode) |
2503 | { | 2499 | { |
2504 | struct nilfs_sb_info *sbi = sci->sc_sbi; | 2500 | struct nilfs_sb_info *sbi = NILFS_SB(sci->sc_super); |
2505 | struct nilfs_transaction_info ti; | 2501 | struct nilfs_transaction_info ti; |
2506 | 2502 | ||
2507 | nilfs_transaction_lock(sbi, &ti, 0); | 2503 | nilfs_transaction_lock(sbi, &ti, 0); |
@@ -2561,7 +2557,7 @@ static int nilfs_segctor_flush_mode(struct nilfs_sc_info *sci) | |||
2561 | static int nilfs_segctor_thread(void *arg) | 2557 | static int nilfs_segctor_thread(void *arg) |
2562 | { | 2558 | { |
2563 | struct nilfs_sc_info *sci = (struct nilfs_sc_info *)arg; | 2559 | struct nilfs_sc_info *sci = (struct nilfs_sc_info *)arg; |
2564 | struct the_nilfs *nilfs = sci->sc_sbi->s_nilfs; | 2560 | struct the_nilfs *nilfs = NILFS_SB(sci->sc_super)->s_nilfs; |
2565 | int timeout = 0; | 2561 | int timeout = 0; |
2566 | 2562 | ||
2567 | sci->sc_timer.data = (unsigned long)current; | 2563 | sci->sc_timer.data = (unsigned long)current; |
@@ -2682,7 +2678,6 @@ static struct nilfs_sc_info *nilfs_segctor_new(struct nilfs_sb_info *sbi, | |||
2682 | if (!sci) | 2678 | if (!sci) |
2683 | return NULL; | 2679 | return NULL; |
2684 | 2680 | ||
2685 | sci->sc_sbi = sbi; | ||
2686 | sci->sc_super = sbi->s_super; | 2681 | sci->sc_super = sbi->s_super; |
2687 | 2682 | ||
2688 | nilfs_get_root(root); | 2683 | nilfs_get_root(root); |
@@ -2717,7 +2712,7 @@ static void nilfs_segctor_write_out(struct nilfs_sc_info *sci) | |||
2717 | /* The segctord thread was stopped and its timer was removed. | 2712 | /* The segctord thread was stopped and its timer was removed. |
2718 | But some tasks remain. */ | 2713 | But some tasks remain. */ |
2719 | do { | 2714 | do { |
2720 | struct nilfs_sb_info *sbi = sci->sc_sbi; | 2715 | struct nilfs_sb_info *sbi = NILFS_SB(sci->sc_super); |
2721 | struct nilfs_transaction_info ti; | 2716 | struct nilfs_transaction_info ti; |
2722 | 2717 | ||
2723 | nilfs_transaction_lock(sbi, &ti, 0); | 2718 | nilfs_transaction_lock(sbi, &ti, 0); |
@@ -2737,7 +2732,7 @@ static void nilfs_segctor_write_out(struct nilfs_sc_info *sci) | |||
2737 | */ | 2732 | */ |
2738 | static void nilfs_segctor_destroy(struct nilfs_sc_info *sci) | 2733 | static void nilfs_segctor_destroy(struct nilfs_sc_info *sci) |
2739 | { | 2734 | { |
2740 | struct the_nilfs *nilfs = sci->sc_sbi->s_nilfs; | 2735 | struct the_nilfs *nilfs = NILFS_SB(sci->sc_super)->s_nilfs; |
2741 | int flag; | 2736 | int flag; |
2742 | 2737 | ||
2743 | up_write(&nilfs->ns_segctor_sem); | 2738 | up_write(&nilfs->ns_segctor_sem); |
diff --git a/fs/nilfs2/segment.h b/fs/nilfs2/segment.h index cd8056e7cbed..9544aa97dd49 100644 --- a/fs/nilfs2/segment.h +++ b/fs/nilfs2/segment.h | |||
@@ -88,7 +88,6 @@ struct nilfs_segsum_pointer { | |||
88 | /** | 88 | /** |
89 | * struct nilfs_sc_info - Segment constructor information | 89 | * struct nilfs_sc_info - Segment constructor information |
90 | * @sc_super: Back pointer to super_block struct | 90 | * @sc_super: Back pointer to super_block struct |
91 | * @sc_sbi: Back pointer to nilfs_sb_info struct | ||
92 | * @sc_root: root object of the current filesystem tree | 91 | * @sc_root: root object of the current filesystem tree |
93 | * @sc_nblk_inc: Block count of current generation | 92 | * @sc_nblk_inc: Block count of current generation |
94 | * @sc_dirty_files: List of files to be written | 93 | * @sc_dirty_files: List of files to be written |
@@ -131,7 +130,6 @@ struct nilfs_segsum_pointer { | |||
131 | */ | 130 | */ |
132 | struct nilfs_sc_info { | 131 | struct nilfs_sc_info { |
133 | struct super_block *sc_super; | 132 | struct super_block *sc_super; |
134 | struct nilfs_sb_info *sc_sbi; | ||
135 | struct nilfs_root *sc_root; | 133 | struct nilfs_root *sc_root; |
136 | 134 | ||
137 | unsigned long sc_nblk_inc; | 135 | unsigned long sc_nblk_inc; |