]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - fs/nilfs2/cpfile.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ryusuke...
[linux-2.6.git] / fs / nilfs2 / cpfile.c
index 4184c1c2992c9e3b48f664e727cf1db6671c6052..7d49813f66d6c157d95c9ec8f6568379fa71565c 100644 (file)
@@ -863,11 +863,11 @@ int nilfs_cpfile_change_cpmode(struct inode *cpfile, __u64 cno, int mode)
        case NILFS_CHECKPOINT:
                /*
                 * Check for protecting existing snapshot mounts:
-                * bd_mount_sem is used to make this operation atomic and
+                * ns_mount_mutex is used to make this operation atomic and
                 * exclusive with a new mount job.  Though it doesn't cover
                 * umount, it's enough for the purpose.
                 */
-               down(&nilfs->ns_bdev->bd_mount_sem);
+               mutex_lock(&nilfs->ns_mount_mutex);
                if (nilfs_checkpoint_is_mounted(nilfs, cno, 1)) {
                        /* Current implementation does not have to protect
                           plain read-only mounts since they are exclusive
@@ -876,7 +876,7 @@ int nilfs_cpfile_change_cpmode(struct inode *cpfile, __u64 cno, int mode)
                        ret = -EBUSY;
                } else
                        ret = nilfs_cpfile_clear_snapshot(cpfile, cno);
-               up(&nilfs->ns_bdev->bd_mount_sem);
+               mutex_unlock(&nilfs->ns_mount_mutex);
                return ret;
        case NILFS_SNAPSHOT:
                return nilfs_cpfile_set_snapshot(cpfile, cno);