Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149573
b: refs/heads/master
c: 30c25be
h: refs/heads/master
i:
  149571: f08f0bf
v: v3
  • Loading branch information
Ryusuke Konishi committed Jun 10, 2009
1 parent bacdc7e commit a4d1ed2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 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: fb6e7113ae3ba6c7d0de77c6ccbcfa659899ff0f
refs/heads/master: 30c25be71fcbd87fd33518045cc014e69bff3d6f
14 changes: 2 additions & 12 deletions trunk/fs/nilfs2/cpfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,10 +295,6 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
return -EINVAL;
}

/* cannot delete the latest checkpoint */
if (start == nilfs_mdt_cno(cpfile) - 1)
return -EPERM;

down_write(&NILFS_MDT(cpfile)->mi_sem);

ret = nilfs_cpfile_get_header_block(cpfile, &header_bh);
Expand Down Expand Up @@ -542,20 +538,14 @@ int nilfs_cpfile_delete_checkpoint(struct inode *cpfile, __u64 cno)
struct nilfs_cpinfo ci;
__u64 tcno = cno;
ssize_t nci;
int ret;

nci = nilfs_cpfile_do_get_cpinfo(cpfile, &tcno, &ci, sizeof(ci), 1);
if (nci < 0)
return nci;
else if (nci == 0 || ci.ci_cno != cno)
return -ENOENT;

/* cannot delete the latest checkpoint nor snapshots */
ret = nilfs_cpinfo_snapshot(&ci);
if (ret < 0)
return ret;
else if (ret > 0 || cno == nilfs_mdt_cno(cpfile) - 1)
return -EPERM;
else if (nilfs_cpinfo_snapshot(&ci))
return -EBUSY;

return nilfs_cpfile_delete_checkpoints(cpfile, cno, cno + 1);
}
Expand Down

0 comments on commit a4d1ed2

Please sign in to comment.