diff options
Diffstat (limited to 'fs/nilfs2/cpfile.c')
-rw-r--r-- | fs/nilfs2/cpfile.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/fs/nilfs2/cpfile.c b/fs/nilfs2/cpfile.c index 1c6cfb59128d..d5ad54e204a5 100644 --- a/fs/nilfs2/cpfile.c +++ b/fs/nilfs2/cpfile.c | |||
@@ -871,7 +871,6 @@ int nilfs_cpfile_change_cpmode(struct inode *cpfile, __u64 cno, int mode) | |||
871 | * exclusive with a new mount job. Though it doesn't cover | 871 | * exclusive with a new mount job. Though it doesn't cover |
872 | * umount, it's enough for the purpose. | 872 | * umount, it's enough for the purpose. |
873 | */ | 873 | */ |
874 | mutex_lock(&nilfs->ns_mount_mutex); | ||
875 | if (nilfs_checkpoint_is_mounted(nilfs, cno, 1)) { | 874 | if (nilfs_checkpoint_is_mounted(nilfs, cno, 1)) { |
876 | /* Current implementation does not have to protect | 875 | /* Current implementation does not have to protect |
877 | plain read-only mounts since they are exclusive | 876 | plain read-only mounts since they are exclusive |
@@ -880,7 +879,6 @@ int nilfs_cpfile_change_cpmode(struct inode *cpfile, __u64 cno, int mode) | |||
880 | ret = -EBUSY; | 879 | ret = -EBUSY; |
881 | } else | 880 | } else |
882 | ret = nilfs_cpfile_clear_snapshot(cpfile, cno); | 881 | ret = nilfs_cpfile_clear_snapshot(cpfile, cno); |
883 | mutex_unlock(&nilfs->ns_mount_mutex); | ||
884 | return ret; | 882 | return ret; |
885 | case NILFS_SNAPSHOT: | 883 | case NILFS_SNAPSHOT: |
886 | return nilfs_cpfile_set_snapshot(cpfile, cno); | 884 | return nilfs_cpfile_set_snapshot(cpfile, cno); |
@@ -928,3 +926,29 @@ int nilfs_cpfile_get_stat(struct inode *cpfile, struct nilfs_cpstat *cpstat) | |||
928 | up_read(&NILFS_MDT(cpfile)->mi_sem); | 926 | up_read(&NILFS_MDT(cpfile)->mi_sem); |
929 | return ret; | 927 | return ret; |
930 | } | 928 | } |
929 | |||
930 | /** | ||
931 | * nilfs_cpfile_read - read cpfile inode | ||
932 | * @cpfile: cpfile inode | ||
933 | * @raw_inode: on-disk cpfile inode | ||
934 | */ | ||
935 | int nilfs_cpfile_read(struct inode *cpfile, struct nilfs_inode *raw_inode) | ||
936 | { | ||
937 | return nilfs_read_inode_common(cpfile, raw_inode); | ||
938 | } | ||
939 | |||
940 | /** | ||
941 | * nilfs_cpfile_new - create cpfile | ||
942 | * @nilfs: nilfs object | ||
943 | * @cpsize: size of a checkpoint entry | ||
944 | */ | ||
945 | struct inode *nilfs_cpfile_new(struct the_nilfs *nilfs, size_t cpsize) | ||
946 | { | ||
947 | struct inode *cpfile; | ||
948 | |||
949 | cpfile = nilfs_mdt_new(nilfs, NULL, NILFS_CPFILE_INO, 0); | ||
950 | if (cpfile) | ||
951 | nilfs_mdt_set_entry_size(cpfile, cpsize, | ||
952 | sizeof(struct nilfs_cpfile_header)); | ||
953 | return cpfile; | ||
954 | } | ||