Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 213747
b: refs/heads/master
c: fd52202
h: refs/heads/master
i:
  213745: 4251782
  213743: c75e1e0
v: v3
  • Loading branch information
Ryusuke Konishi committed Oct 23, 2010
1 parent 70cb038 commit f8a001a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7c0634204993d7c6678c852e4bd118426599111
refs/heads/master: fd52202930b7e8db48bee5a6fc6b1f438e822a23
28 changes: 11 additions & 17 deletions trunk/fs/nilfs2/the_nilfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -954,26 +954,20 @@ struct nilfs_sb_info *nilfs_find_sbinfo(struct the_nilfs *nilfs,
int nilfs_checkpoint_is_mounted(struct the_nilfs *nilfs, __u64 cno,
int snapshot_mount)
{
struct nilfs_sb_info *sbi;
int ret = 0;
struct nilfs_root *root;
int ret;

down_read(&nilfs->ns_super_sem);
if (cno == 0 || cno > nilfs->ns_cno)
goto out_unlock;
if (cno < 0 || cno > nilfs->ns_cno)
return false;

list_for_each_entry(sbi, &nilfs->ns_supers, s_list) {
if (sbi->s_snapshot_cno == cno &&
(!snapshot_mount || nilfs_test_opt(sbi, SNAPSHOT))) {
/* exclude read-only mounts */
ret++;
break;
}
}
/* for protecting recent checkpoints */
if (cno >= nilfs_last_cno(nilfs))
ret++;
return true; /* protect recent checkpoints */

out_unlock:
up_read(&nilfs->ns_super_sem);
ret = false;
root = nilfs_lookup_root(nilfs, cno);
if (root) {
ret = true;
nilfs_put_root(root);
}
return ret;
}

0 comments on commit f8a001a

Please sign in to comment.