]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - fs/nilfs2/segment.c
Merge branch 'idle-release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb...
[net-next-2.6.git] / fs / nilfs2 / segment.c
index b0c5e08d06c882a88acc86a35a4c1105d2d6f92b..687d090cea341fea2f0cf88ac9b4b41e36dcf957 100644 (file)
@@ -191,6 +191,8 @@ int nilfs_transaction_begin(struct super_block *sb,
        if (ret > 0)
                return 0;
 
+       vfs_check_frozen(sb, SB_FREEZE_WRITE);
+
        sbi = NILFS_SB(sb);
        nilfs = sbi->s_nilfs;
        down_read(&nilfs->ns_segctor_sem);
@@ -1607,7 +1609,7 @@ nilfs_copy_replace_page_buffers(struct page *page, struct list_head *out)
        kunmap_atomic(kaddr, KM_USER0);
 
        if (!TestSetPageWriteback(clone_page))
-               inc_zone_page_state(clone_page, NR_WRITEBACK);
+               account_page_writeback(clone_page);
        unlock_page(clone_page);
 
        return 0;
@@ -2672,6 +2674,8 @@ static int nilfs_segctor_start_thread(struct nilfs_sc_info *sci)
 }
 
 static void nilfs_segctor_kill_thread(struct nilfs_sc_info *sci)
+       __acquires(&sci->sc_state_lock)
+       __releases(&sci->sc_state_lock)
 {
        sci->sc_state |= NILFS_SEGCTOR_QUIT;
 
@@ -2799,7 +2803,6 @@ static void nilfs_segctor_destroy(struct nilfs_sc_info *sci)
 int nilfs_attach_segment_constructor(struct nilfs_sb_info *sbi,
                                     struct nilfs_root *root)
 {
-       struct the_nilfs *nilfs = sbi->s_nilfs;
        int err;
 
        if (NILFS_SC(sbi)) {
@@ -2815,10 +2818,8 @@ int nilfs_attach_segment_constructor(struct nilfs_sb_info *sbi,
        if (!sbi->s_sc_info)
                return -ENOMEM;
 
-       nilfs_attach_writer(nilfs, sbi);
        err = nilfs_segctor_start_thread(NILFS_SC(sbi));
        if (err) {
-               nilfs_detach_writer(nilfs, sbi);
                kfree(sbi->s_sc_info);
                sbi->s_sc_info = NULL;
        }
@@ -2855,5 +2856,4 @@ void nilfs_detach_segment_constructor(struct nilfs_sb_info *sbi)
        up_write(&nilfs->ns_segctor_sem);
 
        nilfs_dispose_list(sbi, &garbage_list, 1);
-       nilfs_detach_writer(nilfs, sbi);
 }