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 | f7545144c2e3d280139260df934043e0a6ccce6f (patch) | |
tree | 4e0930f2d4c45a71e300c7ac45c6e55a6d1c6675 /fs/nilfs2/super.c | |
parent | d96bbfa28aa7a1d5a5bf549026a594d7a273c5d7 (diff) |
nilfs2: use sb instance instead of nilfs_sb_info struct
This replaces sbi uses with direct reference to sb instance.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Diffstat (limited to 'fs/nilfs2/super.c')
-rw-r--r-- | fs/nilfs2/super.c | 105 |
1 files changed, 51 insertions, 54 deletions
diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c index 1368c4293c7f..a8cbd695441e 100644 --- a/fs/nilfs2/super.c +++ b/fs/nilfs2/super.c | |||
@@ -71,23 +71,23 @@ struct kmem_cache *nilfs_transaction_cachep; | |||
71 | struct kmem_cache *nilfs_segbuf_cachep; | 71 | struct kmem_cache *nilfs_segbuf_cachep; |
72 | struct kmem_cache *nilfs_btree_path_cache; | 72 | struct kmem_cache *nilfs_btree_path_cache; |
73 | 73 | ||
74 | static int nilfs_setup_super(struct nilfs_sb_info *sbi, int is_mount); | 74 | static int nilfs_setup_super(struct super_block *sb, int is_mount); |
75 | static int nilfs_remount(struct super_block *sb, int *flags, char *data); | 75 | static int nilfs_remount(struct super_block *sb, int *flags, char *data); |
76 | 76 | ||
77 | static void nilfs_set_error(struct nilfs_sb_info *sbi) | 77 | static void nilfs_set_error(struct super_block *sb) |
78 | { | 78 | { |
79 | struct the_nilfs *nilfs = sbi->s_nilfs; | 79 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
80 | struct nilfs_super_block **sbp; | 80 | struct nilfs_super_block **sbp; |
81 | 81 | ||
82 | down_write(&nilfs->ns_sem); | 82 | down_write(&nilfs->ns_sem); |
83 | if (!(nilfs->ns_mount_state & NILFS_ERROR_FS)) { | 83 | if (!(nilfs->ns_mount_state & NILFS_ERROR_FS)) { |
84 | nilfs->ns_mount_state |= NILFS_ERROR_FS; | 84 | nilfs->ns_mount_state |= NILFS_ERROR_FS; |
85 | sbp = nilfs_prepare_super(sbi, 0); | 85 | sbp = nilfs_prepare_super(sb, 0); |
86 | if (likely(sbp)) { | 86 | if (likely(sbp)) { |
87 | sbp[0]->s_state |= cpu_to_le16(NILFS_ERROR_FS); | 87 | sbp[0]->s_state |= cpu_to_le16(NILFS_ERROR_FS); |
88 | if (sbp[1]) | 88 | if (sbp[1]) |
89 | sbp[1]->s_state |= cpu_to_le16(NILFS_ERROR_FS); | 89 | sbp[1]->s_state |= cpu_to_le16(NILFS_ERROR_FS); |
90 | nilfs_commit_super(sbi, NILFS_SB_COMMIT_ALL); | 90 | nilfs_commit_super(sb, NILFS_SB_COMMIT_ALL); |
91 | } | 91 | } |
92 | } | 92 | } |
93 | up_write(&nilfs->ns_sem); | 93 | up_write(&nilfs->ns_sem); |
@@ -108,7 +108,7 @@ static void nilfs_set_error(struct nilfs_sb_info *sbi) | |||
108 | void nilfs_error(struct super_block *sb, const char *function, | 108 | void nilfs_error(struct super_block *sb, const char *function, |
109 | const char *fmt, ...) | 109 | const char *fmt, ...) |
110 | { | 110 | { |
111 | struct the_nilfs *nilfs = sbi->s_nilfs; | 111 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
112 | struct va_format vaf; | 112 | struct va_format vaf; |
113 | va_list args; | 113 | va_list args; |
114 | 114 | ||
@@ -123,7 +123,7 @@ void nilfs_error(struct super_block *sb, const char *function, | |||
123 | va_end(args); | 123 | va_end(args); |
124 | 124 | ||
125 | if (!(sb->s_flags & MS_RDONLY)) { | 125 | if (!(sb->s_flags & MS_RDONLY)) { |
126 | nilfs_set_error(sbi); | 126 | nilfs_set_error(sb); |
127 | 127 | ||
128 | if (nilfs_test_opt(nilfs, ERRORS_RO)) { | 128 | if (nilfs_test_opt(nilfs, ERRORS_RO)) { |
129 | printk(KERN_CRIT "Remounting filesystem read-only\n"); | 129 | printk(KERN_CRIT "Remounting filesystem read-only\n"); |
@@ -188,9 +188,9 @@ void nilfs_destroy_inode(struct inode *inode) | |||
188 | call_rcu(&inode->i_rcu, nilfs_i_callback); | 188 | call_rcu(&inode->i_rcu, nilfs_i_callback); |
189 | } | 189 | } |
190 | 190 | ||
191 | static int nilfs_sync_super(struct nilfs_sb_info *sbi, int flag) | 191 | static int nilfs_sync_super(struct super_block *sb, int flag) |
192 | { | 192 | { |
193 | struct the_nilfs *nilfs = sbi->s_nilfs; | 193 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
194 | int err; | 194 | int err; |
195 | 195 | ||
196 | retry: | 196 | retry: |
@@ -262,10 +262,10 @@ void nilfs_set_log_cursor(struct nilfs_super_block *sbp, | |||
262 | spin_unlock(&nilfs->ns_last_segment_lock); | 262 | spin_unlock(&nilfs->ns_last_segment_lock); |
263 | } | 263 | } |
264 | 264 | ||
265 | struct nilfs_super_block **nilfs_prepare_super(struct nilfs_sb_info *sbi, | 265 | struct nilfs_super_block **nilfs_prepare_super(struct super_block *sb, |
266 | int flip) | 266 | int flip) |
267 | { | 267 | { |
268 | struct the_nilfs *nilfs = sbi->s_nilfs; | 268 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
269 | struct nilfs_super_block **sbp = nilfs->ns_sbp; | 269 | struct nilfs_super_block **sbp = nilfs->ns_sbp; |
270 | 270 | ||
271 | /* nilfs->ns_sem must be locked by the caller. */ | 271 | /* nilfs->ns_sem must be locked by the caller. */ |
@@ -275,7 +275,7 @@ struct nilfs_super_block **nilfs_prepare_super(struct nilfs_sb_info *sbi, | |||
275 | memcpy(sbp[0], sbp[1], nilfs->ns_sbsize); | 275 | memcpy(sbp[0], sbp[1], nilfs->ns_sbsize); |
276 | } else { | 276 | } else { |
277 | printk(KERN_CRIT "NILFS: superblock broke on dev %s\n", | 277 | printk(KERN_CRIT "NILFS: superblock broke on dev %s\n", |
278 | sbi->s_super->s_id); | 278 | sb->s_id); |
279 | return NULL; | 279 | return NULL; |
280 | } | 280 | } |
281 | } else if (sbp[1] && | 281 | } else if (sbp[1] && |
@@ -289,9 +289,9 @@ struct nilfs_super_block **nilfs_prepare_super(struct nilfs_sb_info *sbi, | |||
289 | return sbp; | 289 | return sbp; |
290 | } | 290 | } |
291 | 291 | ||
292 | int nilfs_commit_super(struct nilfs_sb_info *sbi, int flag) | 292 | int nilfs_commit_super(struct super_block *sb, int flag) |
293 | { | 293 | { |
294 | struct the_nilfs *nilfs = sbi->s_nilfs; | 294 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
295 | struct nilfs_super_block **sbp = nilfs->ns_sbp; | 295 | struct nilfs_super_block **sbp = nilfs->ns_sbp; |
296 | time_t t; | 296 | time_t t; |
297 | 297 | ||
@@ -311,27 +311,28 @@ int nilfs_commit_super(struct nilfs_sb_info *sbi, int flag) | |||
311 | nilfs->ns_sbsize)); | 311 | nilfs->ns_sbsize)); |
312 | } | 312 | } |
313 | clear_nilfs_sb_dirty(nilfs); | 313 | clear_nilfs_sb_dirty(nilfs); |
314 | return nilfs_sync_super(sbi, flag); | 314 | return nilfs_sync_super(sb, flag); |
315 | } | 315 | } |
316 | 316 | ||
317 | /** | 317 | /** |
318 | * nilfs_cleanup_super() - write filesystem state for cleanup | 318 | * nilfs_cleanup_super() - write filesystem state for cleanup |
319 | * @sbi: nilfs_sb_info to be unmounted or degraded to read-only | 319 | * @sb: super block instance to be unmounted or degraded to read-only |
320 | * | 320 | * |
321 | * This function restores state flags in the on-disk super block. | 321 | * This function restores state flags in the on-disk super block. |
322 | * This will set "clean" flag (i.e. NILFS_VALID_FS) unless the | 322 | * This will set "clean" flag (i.e. NILFS_VALID_FS) unless the |
323 | * filesystem was not clean previously. | 323 | * filesystem was not clean previously. |
324 | */ | 324 | */ |
325 | int nilfs_cleanup_super(struct nilfs_sb_info *sbi) | 325 | int nilfs_cleanup_super(struct super_block *sb) |
326 | { | 326 | { |
327 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; | ||
327 | struct nilfs_super_block **sbp; | 328 | struct nilfs_super_block **sbp; |
328 | int flag = NILFS_SB_COMMIT; | 329 | int flag = NILFS_SB_COMMIT; |
329 | int ret = -EIO; | 330 | int ret = -EIO; |
330 | 331 | ||
331 | sbp = nilfs_prepare_super(sbi, 0); | 332 | sbp = nilfs_prepare_super(sb, 0); |
332 | if (sbp) { | 333 | if (sbp) { |
333 | sbp[0]->s_state = cpu_to_le16(sbi->s_nilfs->ns_mount_state); | 334 | sbp[0]->s_state = cpu_to_le16(nilfs->ns_mount_state); |
334 | nilfs_set_log_cursor(sbp[0], sbi->s_nilfs); | 335 | nilfs_set_log_cursor(sbp[0], nilfs); |
335 | if (sbp[1] && sbp[0]->s_last_cno == sbp[1]->s_last_cno) { | 336 | if (sbp[1] && sbp[0]->s_last_cno == sbp[1]->s_last_cno) { |
336 | /* | 337 | /* |
337 | * make the "clean" flag also to the opposite | 338 | * make the "clean" flag also to the opposite |
@@ -341,7 +342,7 @@ int nilfs_cleanup_super(struct nilfs_sb_info *sbi) | |||
341 | sbp[1]->s_state = sbp[0]->s_state; | 342 | sbp[1]->s_state = sbp[0]->s_state; |
342 | flag = NILFS_SB_COMMIT_ALL; | 343 | flag = NILFS_SB_COMMIT_ALL; |
343 | } | 344 | } |
344 | ret = nilfs_commit_super(sbi, flag); | 345 | ret = nilfs_commit_super(sb, flag); |
345 | } | 346 | } |
346 | return ret; | 347 | return ret; |
347 | } | 348 | } |
@@ -351,11 +352,11 @@ static void nilfs_put_super(struct super_block *sb) | |||
351 | struct nilfs_sb_info *sbi = NILFS_SB(sb); | 352 | struct nilfs_sb_info *sbi = NILFS_SB(sb); |
352 | struct the_nilfs *nilfs = sbi->s_nilfs; | 353 | struct the_nilfs *nilfs = sbi->s_nilfs; |
353 | 354 | ||
354 | nilfs_detach_segment_constructor(sbi); | 355 | nilfs_detach_log_writer(sb); |
355 | 356 | ||
356 | if (!(sb->s_flags & MS_RDONLY)) { | 357 | if (!(sb->s_flags & MS_RDONLY)) { |
357 | down_write(&nilfs->ns_sem); | 358 | down_write(&nilfs->ns_sem); |
358 | nilfs_cleanup_super(sbi); | 359 | nilfs_cleanup_super(sb); |
359 | up_write(&nilfs->ns_sem); | 360 | up_write(&nilfs->ns_sem); |
360 | } | 361 | } |
361 | 362 | ||
@@ -371,8 +372,7 @@ static void nilfs_put_super(struct super_block *sb) | |||
371 | 372 | ||
372 | static int nilfs_sync_fs(struct super_block *sb, int wait) | 373 | static int nilfs_sync_fs(struct super_block *sb, int wait) |
373 | { | 374 | { |
374 | struct nilfs_sb_info *sbi = NILFS_SB(sb); | 375 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
375 | struct the_nilfs *nilfs = sbi->s_nilfs; | ||
376 | struct nilfs_super_block **sbp; | 376 | struct nilfs_super_block **sbp; |
377 | int err = 0; | 377 | int err = 0; |
378 | 378 | ||
@@ -382,10 +382,10 @@ static int nilfs_sync_fs(struct super_block *sb, int wait) | |||
382 | 382 | ||
383 | down_write(&nilfs->ns_sem); | 383 | down_write(&nilfs->ns_sem); |
384 | if (nilfs_sb_dirty(nilfs)) { | 384 | if (nilfs_sb_dirty(nilfs)) { |
385 | sbp = nilfs_prepare_super(sbi, nilfs_sb_will_flip(nilfs)); | 385 | sbp = nilfs_prepare_super(sb, nilfs_sb_will_flip(nilfs)); |
386 | if (likely(sbp)) { | 386 | if (likely(sbp)) { |
387 | nilfs_set_log_cursor(sbp[0], nilfs); | 387 | nilfs_set_log_cursor(sbp[0], nilfs); |
388 | nilfs_commit_super(sbi, NILFS_SB_COMMIT); | 388 | nilfs_commit_super(sb, NILFS_SB_COMMIT); |
389 | } | 389 | } |
390 | } | 390 | } |
391 | up_write(&nilfs->ns_sem); | 391 | up_write(&nilfs->ns_sem); |
@@ -393,10 +393,10 @@ static int nilfs_sync_fs(struct super_block *sb, int wait) | |||
393 | return err; | 393 | return err; |
394 | } | 394 | } |
395 | 395 | ||
396 | int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno, int curr_mnt, | 396 | int nilfs_attach_checkpoint(struct super_block *sb, __u64 cno, int curr_mnt, |
397 | struct nilfs_root **rootp) | 397 | struct nilfs_root **rootp) |
398 | { | 398 | { |
399 | struct the_nilfs *nilfs = sbi->s_nilfs; | 399 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
400 | struct nilfs_root *root; | 400 | struct nilfs_root *root; |
401 | struct nilfs_checkpoint *raw_cp; | 401 | struct nilfs_checkpoint *raw_cp; |
402 | struct buffer_head *bh_cp; | 402 | struct buffer_head *bh_cp; |
@@ -425,7 +425,7 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno, int curr_mnt, | |||
425 | goto failed; | 425 | goto failed; |
426 | } | 426 | } |
427 | 427 | ||
428 | err = nilfs_ifile_read(sbi->s_super, root, nilfs->ns_inode_size, | 428 | err = nilfs_ifile_read(sb, root, nilfs->ns_inode_size, |
429 | &raw_cp->cp_ifile_inode, &root->ifile); | 429 | &raw_cp->cp_ifile_inode, &root->ifile); |
430 | if (err) | 430 | if (err) |
431 | goto failed_bh; | 431 | goto failed_bh; |
@@ -449,8 +449,7 @@ int nilfs_attach_checkpoint(struct nilfs_sb_info *sbi, __u64 cno, int curr_mnt, | |||
449 | 449 | ||
450 | static int nilfs_freeze(struct super_block *sb) | 450 | static int nilfs_freeze(struct super_block *sb) |
451 | { | 451 | { |
452 | struct nilfs_sb_info *sbi = NILFS_SB(sb); | 452 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
453 | struct the_nilfs *nilfs = sbi->s_nilfs; | ||
454 | int err; | 453 | int err; |
455 | 454 | ||
456 | if (sb->s_flags & MS_RDONLY) | 455 | if (sb->s_flags & MS_RDONLY) |
@@ -458,21 +457,20 @@ static int nilfs_freeze(struct super_block *sb) | |||
458 | 457 | ||
459 | /* Mark super block clean */ | 458 | /* Mark super block clean */ |
460 | down_write(&nilfs->ns_sem); | 459 | down_write(&nilfs->ns_sem); |
461 | err = nilfs_cleanup_super(sbi); | 460 | err = nilfs_cleanup_super(sb); |
462 | up_write(&nilfs->ns_sem); | 461 | up_write(&nilfs->ns_sem); |
463 | return err; | 462 | return err; |
464 | } | 463 | } |
465 | 464 | ||
466 | static int nilfs_unfreeze(struct super_block *sb) | 465 | static int nilfs_unfreeze(struct super_block *sb) |
467 | { | 466 | { |
468 | struct nilfs_sb_info *sbi = NILFS_SB(sb); | 467 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
469 | struct the_nilfs *nilfs = sbi->s_nilfs; | ||
470 | 468 | ||
471 | if (sb->s_flags & MS_RDONLY) | 469 | if (sb->s_flags & MS_RDONLY) |
472 | return 0; | 470 | return 0; |
473 | 471 | ||
474 | down_write(&nilfs->ns_sem); | 472 | down_write(&nilfs->ns_sem); |
475 | nilfs_setup_super(sbi, false); | 473 | nilfs_setup_super(sb, false); |
476 | up_write(&nilfs->ns_sem); | 474 | up_write(&nilfs->ns_sem); |
477 | return 0; | 475 | return 0; |
478 | } | 476 | } |
@@ -668,15 +666,15 @@ nilfs_set_default_options(struct super_block *sb, | |||
668 | NILFS_MOUNT_ERRORS_RO | NILFS_MOUNT_BARRIER; | 666 | NILFS_MOUNT_ERRORS_RO | NILFS_MOUNT_BARRIER; |
669 | } | 667 | } |
670 | 668 | ||
671 | static int nilfs_setup_super(struct nilfs_sb_info *sbi, int is_mount) | 669 | static int nilfs_setup_super(struct super_block *sb, int is_mount) |
672 | { | 670 | { |
673 | struct the_nilfs *nilfs = sbi->s_nilfs; | 671 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
674 | struct nilfs_super_block **sbp; | 672 | struct nilfs_super_block **sbp; |
675 | int max_mnt_count; | 673 | int max_mnt_count; |
676 | int mnt_count; | 674 | int mnt_count; |
677 | 675 | ||
678 | /* nilfs->ns_sem must be locked by the caller. */ | 676 | /* nilfs->ns_sem must be locked by the caller. */ |
679 | sbp = nilfs_prepare_super(sbi, 0); | 677 | sbp = nilfs_prepare_super(sb, 0); |
680 | if (!sbp) | 678 | if (!sbp) |
681 | return -EIO; | 679 | return -EIO; |
682 | 680 | ||
@@ -707,7 +705,7 @@ skip_mount_setup: | |||
707 | /* synchronize sbp[1] with sbp[0] */ | 705 | /* synchronize sbp[1] with sbp[0] */ |
708 | if (sbp[1]) | 706 | if (sbp[1]) |
709 | memcpy(sbp[1], sbp[0], nilfs->ns_sbsize); | 707 | memcpy(sbp[1], sbp[0], nilfs->ns_sbsize); |
710 | return nilfs_commit_super(sbi, NILFS_SB_COMMIT_ALL); | 708 | return nilfs_commit_super(sb, NILFS_SB_COMMIT_ALL); |
711 | } | 709 | } |
712 | 710 | ||
713 | struct nilfs_super_block *nilfs_read_super_block(struct super_block *sb, | 711 | struct nilfs_super_block *nilfs_read_super_block(struct super_block *sb, |
@@ -841,7 +839,7 @@ static int nilfs_attach_snapshot(struct super_block *s, __u64 cno, | |||
841 | goto out; | 839 | goto out; |
842 | } | 840 | } |
843 | 841 | ||
844 | ret = nilfs_attach_checkpoint(NILFS_SB(s), cno, false, &root); | 842 | ret = nilfs_attach_checkpoint(s, cno, false, &root); |
845 | if (ret) { | 843 | if (ret) { |
846 | printk(KERN_ERR "NILFS: error loading snapshot " | 844 | printk(KERN_ERR "NILFS: error loading snapshot " |
847 | "(checkpoint number=%llu).\n", | 845 | "(checkpoint number=%llu).\n", |
@@ -938,7 +936,7 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent) | |||
938 | } | 936 | } |
939 | sbi->s_nilfs = nilfs; | 937 | sbi->s_nilfs = nilfs; |
940 | 938 | ||
941 | err = init_nilfs(nilfs, sbi, (char *)data); | 939 | err = init_nilfs(nilfs, sb, (char *)data); |
942 | if (err) | 940 | if (err) |
943 | goto failed_nilfs; | 941 | goto failed_nilfs; |
944 | 942 | ||
@@ -950,12 +948,12 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent) | |||
950 | bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info; | 948 | bdi = sb->s_bdev->bd_inode->i_mapping->backing_dev_info; |
951 | sb->s_bdi = bdi ? : &default_backing_dev_info; | 949 | sb->s_bdi = bdi ? : &default_backing_dev_info; |
952 | 950 | ||
953 | err = load_nilfs(nilfs, sbi); | 951 | err = load_nilfs(nilfs, sb); |
954 | if (err) | 952 | if (err) |
955 | goto failed_nilfs; | 953 | goto failed_nilfs; |
956 | 954 | ||
957 | cno = nilfs_last_cno(nilfs); | 955 | cno = nilfs_last_cno(nilfs); |
958 | err = nilfs_attach_checkpoint(sbi, cno, true, &fsroot); | 956 | err = nilfs_attach_checkpoint(sb, cno, true, &fsroot); |
959 | if (err) { | 957 | if (err) { |
960 | printk(KERN_ERR "NILFS: error loading last checkpoint " | 958 | printk(KERN_ERR "NILFS: error loading last checkpoint " |
961 | "(checkpoint number=%llu).\n", (unsigned long long)cno); | 959 | "(checkpoint number=%llu).\n", (unsigned long long)cno); |
@@ -963,7 +961,7 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent) | |||
963 | } | 961 | } |
964 | 962 | ||
965 | if (!(sb->s_flags & MS_RDONLY)) { | 963 | if (!(sb->s_flags & MS_RDONLY)) { |
966 | err = nilfs_attach_segment_constructor(sbi, fsroot); | 964 | err = nilfs_attach_log_writer(sb, fsroot); |
967 | if (err) | 965 | if (err) |
968 | goto failed_checkpoint; | 966 | goto failed_checkpoint; |
969 | } | 967 | } |
@@ -976,14 +974,14 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent) | |||
976 | 974 | ||
977 | if (!(sb->s_flags & MS_RDONLY)) { | 975 | if (!(sb->s_flags & MS_RDONLY)) { |
978 | down_write(&nilfs->ns_sem); | 976 | down_write(&nilfs->ns_sem); |
979 | nilfs_setup_super(sbi, true); | 977 | nilfs_setup_super(sb, true); |
980 | up_write(&nilfs->ns_sem); | 978 | up_write(&nilfs->ns_sem); |
981 | } | 979 | } |
982 | 980 | ||
983 | return 0; | 981 | return 0; |
984 | 982 | ||
985 | failed_segctor: | 983 | failed_segctor: |
986 | nilfs_detach_segment_constructor(sbi); | 984 | nilfs_detach_log_writer(sb); |
987 | 985 | ||
988 | failed_checkpoint: | 986 | failed_checkpoint: |
989 | nilfs_put_root(fsroot); | 987 | nilfs_put_root(fsroot); |
@@ -1004,8 +1002,7 @@ nilfs_fill_super(struct super_block *sb, void *data, int silent) | |||
1004 | 1002 | ||
1005 | static int nilfs_remount(struct super_block *sb, int *flags, char *data) | 1003 | static int nilfs_remount(struct super_block *sb, int *flags, char *data) |
1006 | { | 1004 | { |
1007 | struct nilfs_sb_info *sbi = NILFS_SB(sb); | 1005 | struct the_nilfs *nilfs = NILFS_SB(sb)->s_nilfs; |
1008 | struct the_nilfs *nilfs = sbi->s_nilfs; | ||
1009 | unsigned long old_sb_flags; | 1006 | unsigned long old_sb_flags; |
1010 | unsigned long old_mount_opt; | 1007 | unsigned long old_mount_opt; |
1011 | int err; | 1008 | int err; |
@@ -1031,8 +1028,8 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data) | |||
1031 | if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) | 1028 | if ((*flags & MS_RDONLY) == (sb->s_flags & MS_RDONLY)) |
1032 | goto out; | 1029 | goto out; |
1033 | if (*flags & MS_RDONLY) { | 1030 | if (*flags & MS_RDONLY) { |
1034 | /* Shutting down the segment constructor */ | 1031 | /* Shutting down log writer */ |
1035 | nilfs_detach_segment_constructor(sbi); | 1032 | nilfs_detach_log_writer(sb); |
1036 | sb->s_flags |= MS_RDONLY; | 1033 | sb->s_flags |= MS_RDONLY; |
1037 | 1034 | ||
1038 | /* | 1035 | /* |
@@ -1040,7 +1037,7 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data) | |||
1040 | * the RDONLY flag and then mark the partition as valid again. | 1037 | * the RDONLY flag and then mark the partition as valid again. |
1041 | */ | 1038 | */ |
1042 | down_write(&nilfs->ns_sem); | 1039 | down_write(&nilfs->ns_sem); |
1043 | nilfs_cleanup_super(sbi); | 1040 | nilfs_cleanup_super(sb); |
1044 | up_write(&nilfs->ns_sem); | 1041 | up_write(&nilfs->ns_sem); |
1045 | } else { | 1042 | } else { |
1046 | __u64 features; | 1043 | __u64 features; |
@@ -1067,12 +1064,12 @@ static int nilfs_remount(struct super_block *sb, int *flags, char *data) | |||
1067 | sb->s_flags &= ~MS_RDONLY; | 1064 | sb->s_flags &= ~MS_RDONLY; |
1068 | 1065 | ||
1069 | root = NILFS_I(sb->s_root->d_inode)->i_root; | 1066 | root = NILFS_I(sb->s_root->d_inode)->i_root; |
1070 | err = nilfs_attach_segment_constructor(sbi, root); | 1067 | err = nilfs_attach_log_writer(sb, root); |
1071 | if (err) | 1068 | if (err) |
1072 | goto restore_opts; | 1069 | goto restore_opts; |
1073 | 1070 | ||
1074 | down_write(&nilfs->ns_sem); | 1071 | down_write(&nilfs->ns_sem); |
1075 | nilfs_setup_super(sbi, true); | 1072 | nilfs_setup_super(sb, true); |
1076 | up_write(&nilfs->ns_sem); | 1073 | up_write(&nilfs->ns_sem); |
1077 | } | 1074 | } |
1078 | out: | 1075 | out: |