]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - fs/nilfs2/the_nilfs.c
fs, nilfs: convert nilfs_root.count from atomic_t to refcount_t
[mirror_ubuntu-bionic-kernel.git] / fs / nilfs2 / the_nilfs.c
index 2dd75bf619ad0e1167a62e90ef59258d2ee88e26..afebb5067cec8344a3aac02070b369be0a152b51 100644 (file)
@@ -737,7 +737,7 @@ struct nilfs_root *nilfs_lookup_root(struct the_nilfs *nilfs, __u64 cno)
                } else if (cno > root->cno) {
                        n = n->rb_right;
                } else {
-                       atomic_inc(&root->count);
+                       refcount_inc(&root->count);
                        spin_unlock(&nilfs->ns_cptree_lock);
                        return root;
                }
@@ -776,7 +776,7 @@ nilfs_find_or_create_root(struct the_nilfs *nilfs, __u64 cno)
                } else if (cno > root->cno) {
                        p = &(*p)->rb_right;
                } else {
-                       atomic_inc(&root->count);
+                       refcount_inc(&root->count);
                        spin_unlock(&nilfs->ns_cptree_lock);
                        kfree(new);
                        return root;
@@ -786,7 +786,7 @@ nilfs_find_or_create_root(struct the_nilfs *nilfs, __u64 cno)
        new->cno = cno;
        new->ifile = NULL;
        new->nilfs = nilfs;
-       atomic_set(&new->count, 1);
+       refcount_set(&new->count, 1);
        atomic64_set(&new->inodes_count, 0);
        atomic64_set(&new->blocks_count, 0);
 
@@ -806,7 +806,7 @@ nilfs_find_or_create_root(struct the_nilfs *nilfs, __u64 cno)
 
 void nilfs_put_root(struct nilfs_root *root)
 {
-       if (atomic_dec_and_test(&root->count)) {
+       if (refcount_dec_and_test(&root->count)) {
                struct the_nilfs *nilfs = root->nilfs;
 
                nilfs_sysfs_delete_snapshot_group(root);