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/the_nilfs.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/the_nilfs.c')
-rw-r--r-- | fs/nilfs2/the_nilfs.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c index 1bf695e887a7..d2acd1a651f3 100644 --- a/fs/nilfs2/the_nilfs.c +++ b/fs/nilfs2/the_nilfs.c | |||
@@ -201,16 +201,16 @@ static int nilfs_store_log_cursor(struct the_nilfs *nilfs, | |||
201 | /** | 201 | /** |
202 | * load_nilfs - load and recover the nilfs | 202 | * load_nilfs - load and recover the nilfs |
203 | * @nilfs: the_nilfs structure to be released | 203 | * @nilfs: the_nilfs structure to be released |
204 | * @sbi: nilfs_sb_info used to recover past segment | 204 | * @sb: super block isntance used to recover past segment |
205 | * | 205 | * |
206 | * load_nilfs() searches and load the latest super root, | 206 | * load_nilfs() searches and load the latest super root, |
207 | * attaches the last segment, and does recovery if needed. | 207 | * attaches the last segment, and does recovery if needed. |
208 | * The caller must call this exclusively for simultaneous mounts. | 208 | * The caller must call this exclusively for simultaneous mounts. |
209 | */ | 209 | */ |
210 | int load_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi) | 210 | int load_nilfs(struct the_nilfs *nilfs, struct super_block *sb) |
211 | { | 211 | { |
212 | struct nilfs_recovery_info ri; | 212 | struct nilfs_recovery_info ri; |
213 | unsigned int s_flags = sbi->s_super->s_flags; | 213 | unsigned int s_flags = sb->s_flags; |
214 | int really_read_only = bdev_read_only(nilfs->ns_bdev); | 214 | int really_read_only = bdev_read_only(nilfs->ns_bdev); |
215 | int valid_fs = nilfs_valid_fs(nilfs); | 215 | int valid_fs = nilfs_valid_fs(nilfs); |
216 | int err; | 216 | int err; |
@@ -275,7 +275,7 @@ int load_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi) | |||
275 | goto scan_error; | 275 | goto scan_error; |
276 | } | 276 | } |
277 | 277 | ||
278 | err = nilfs_load_super_root(nilfs, sbi->s_super, ri.ri_super_root); | 278 | err = nilfs_load_super_root(nilfs, sb, ri.ri_super_root); |
279 | if (unlikely(err)) { | 279 | if (unlikely(err)) { |
280 | printk(KERN_ERR "NILFS: error loading super root.\n"); | 280 | printk(KERN_ERR "NILFS: error loading super root.\n"); |
281 | goto failed; | 281 | goto failed; |
@@ -308,7 +308,7 @@ int load_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi) | |||
308 | err = -EROFS; | 308 | err = -EROFS; |
309 | goto failed_unload; | 309 | goto failed_unload; |
310 | } | 310 | } |
311 | sbi->s_super->s_flags &= ~MS_RDONLY; | 311 | sb->s_flags &= ~MS_RDONLY; |
312 | } else if (nilfs_test_opt(nilfs, NORECOVERY)) { | 312 | } else if (nilfs_test_opt(nilfs, NORECOVERY)) { |
313 | printk(KERN_ERR "NILFS: recovery cancelled because norecovery " | 313 | printk(KERN_ERR "NILFS: recovery cancelled because norecovery " |
314 | "option was specified for a read/write mount\n"); | 314 | "option was specified for a read/write mount\n"); |
@@ -316,13 +316,13 @@ int load_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi) | |||
316 | goto failed_unload; | 316 | goto failed_unload; |
317 | } | 317 | } |
318 | 318 | ||
319 | err = nilfs_salvage_orphan_logs(nilfs, sbi, &ri); | 319 | err = nilfs_salvage_orphan_logs(nilfs, sb, &ri); |
320 | if (err) | 320 | if (err) |
321 | goto failed_unload; | 321 | goto failed_unload; |
322 | 322 | ||
323 | down_write(&nilfs->ns_sem); | 323 | down_write(&nilfs->ns_sem); |
324 | nilfs->ns_mount_state |= NILFS_VALID_FS; /* set "clean" flag */ | 324 | nilfs->ns_mount_state |= NILFS_VALID_FS; /* set "clean" flag */ |
325 | err = nilfs_cleanup_super(sbi); | 325 | err = nilfs_cleanup_super(sb); |
326 | up_write(&nilfs->ns_sem); | 326 | up_write(&nilfs->ns_sem); |
327 | 327 | ||
328 | if (err) { | 328 | if (err) { |
@@ -334,7 +334,7 @@ int load_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi) | |||
334 | 334 | ||
335 | skip_recovery: | 335 | skip_recovery: |
336 | nilfs_clear_recovery_info(&ri); | 336 | nilfs_clear_recovery_info(&ri); |
337 | sbi->s_super->s_flags = s_flags; | 337 | sb->s_flags = s_flags; |
338 | return 0; | 338 | return 0; |
339 | 339 | ||
340 | scan_error: | 340 | scan_error: |
@@ -348,7 +348,7 @@ int load_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi) | |||
348 | 348 | ||
349 | failed: | 349 | failed: |
350 | nilfs_clear_recovery_info(&ri); | 350 | nilfs_clear_recovery_info(&ri); |
351 | sbi->s_super->s_flags = s_flags; | 351 | sb->s_flags = s_flags; |
352 | return err; | 352 | return err; |
353 | } | 353 | } |
354 | 354 | ||
@@ -526,7 +526,6 @@ static int nilfs_load_super_block(struct the_nilfs *nilfs, | |||
526 | /** | 526 | /** |
527 | * init_nilfs - initialize a NILFS instance. | 527 | * init_nilfs - initialize a NILFS instance. |
528 | * @nilfs: the_nilfs structure | 528 | * @nilfs: the_nilfs structure |
529 | * @sbi: nilfs_sb_info | ||
530 | * @sb: super block | 529 | * @sb: super block |
531 | * @data: mount options | 530 | * @data: mount options |
532 | * | 531 | * |
@@ -537,9 +536,8 @@ static int nilfs_load_super_block(struct the_nilfs *nilfs, | |||
537 | * Return Value: On success, 0 is returned. On error, a negative error | 536 | * Return Value: On success, 0 is returned. On error, a negative error |
538 | * code is returned. | 537 | * code is returned. |
539 | */ | 538 | */ |
540 | int init_nilfs(struct the_nilfs *nilfs, struct nilfs_sb_info *sbi, char *data) | 539 | int init_nilfs(struct the_nilfs *nilfs, struct super_block *sb, char *data) |
541 | { | 540 | { |
542 | struct super_block *sb = sbi->s_super; | ||
543 | struct nilfs_super_block *sbp; | 541 | struct nilfs_super_block *sbp; |
544 | int blocksize; | 542 | int blocksize; |
545 | int err; | 543 | int err; |