+ rc = exfat_unlink(&ef, node);
+ exfat_put_node(&ef, node);
+ if (rc != 0)
+ return rc;
+ return exfat_cleanup_node(&ef, node);
+}
+
+static int fuse_exfat_rmdir(const char* path)
+{
+ struct exfat_node* node;
+ int rc;
+
+ exfat_debug("[%s] %s", __func__, path);
+
+ rc = exfat_lookup(&ef, &node, path);
+ if (rc != 0)
+ return rc;
+
+ rc = exfat_rmdir(&ef, node);
+ exfat_put_node(&ef, node);
+ if (rc != 0)
+ return rc;
+ return exfat_cleanup_node(&ef, node);
+}
+
+static int fuse_exfat_mknod(const char* path, mode_t mode, dev_t dev)
+{
+ exfat_debug("[%s] %s 0%ho", __func__, path, mode);
+ return exfat_mknod(&ef, path);
+}
+
+static int fuse_exfat_mkdir(const char* path, mode_t mode)
+{
+ exfat_debug("[%s] %s 0%ho", __func__, path, mode);
+ return exfat_mkdir(&ef, path);
+}
+
+static int fuse_exfat_rename(const char* old_path, const char* new_path)
+{
+ exfat_debug("[%s] %s => %s", __func__, old_path, new_path);
+ return exfat_rename(&ef, old_path, new_path);
+}
+
+static int fuse_exfat_utimens(const char* path, const struct timespec tv[2])
+{
+ struct exfat_node* node;
+ int rc;
+
+ exfat_debug("[%s] %s", __func__, path);
+
+ rc = exfat_lookup(&ef, &node, path);
+ if (rc != 0)
+ return rc;
+
+ exfat_utimes(node, tv);
+ rc = exfat_flush_node(&ef, node);
+ exfat_put_node(&ef, node);
+ return rc;
+}
+
+static int fuse_exfat_chmod(const char* path, mode_t mode)
+{
+ const mode_t VALID_MODE_MASK = S_IFREG | S_IFDIR |
+ S_IRWXU | S_IRWXG | S_IRWXO;
+
+ exfat_debug("[%s] %s 0%ho", __func__, path, mode);
+ if (mode & ~VALID_MODE_MASK)
+ return -EPERM;
+ return 0;
+}
+
+static int fuse_exfat_chown(const char* path, uid_t uid, gid_t gid)
+{
+ exfat_debug("[%s] %s %u:%u", __func__, path, uid, gid);
+ if (uid != ef.uid || gid != ef.gid)
+ return -EPERM;
+ return 0;
+}
+
+static int fuse_exfat_statfs(const char* path, struct statvfs* sfs)
+{
+ exfat_debug("[%s]", __func__);
+
+ sfs->f_bsize = CLUSTER_SIZE(*ef.sb);