} 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;
                }
                } 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;
        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);
 
 
 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);
 
 #include <linux/blkdev.h>
 #include <linux/backing-dev.h>
 #include <linux/slab.h>
+#include <linux/refcount.h>
 
 struct nilfs_sc_info;
 struct nilfs_sysfs_dev_subgroups;
        __u64 cno;
        struct rb_node rb_node;
 
-       atomic_t count;
+       refcount_t count;
        struct the_nilfs *nilfs;
        struct inode *ifile;
 
 
 static inline void nilfs_get_root(struct nilfs_root *root)
 {
-       atomic_inc(&root->count);
+       refcount_inc(&root->count);
 }
 
 static inline int nilfs_valid_fs(struct the_nilfs *nilfs)