+/**
+ * Return the open fd for a given device/path provided
+ *
+ * \param device[in] buffer holding device or path string
+ * \param rootfd[out] file descriptor after successful opening of
+ * of above path or device
+ *
+ * \retval 0 on success
+ * \retval -ve on failure
+ */
+int llapi_root_path_open(const char *device, int *rootfd)
+{
+ int tmp_fd, rc;
+
+ if (*device == '/')
+ rc = get_root_path(WANT_FD, NULL, &tmp_fd,
+ (char *)device, -1, NULL, NULL);
+ else
+ rc = get_root_path(WANT_FD, (char *)device, &tmp_fd,
+ NULL, -1, NULL, NULL);
+
+ if (!rc)
+ *rootfd = dup(tmp_fd);
+
+ return rc;
+}
+
+/**
+ * Call IOCTL to remove file by fid. The fd must be valid and fa
+ * (fid_array) struct must allready be populated.
+ *
+ * \param fd[in] valid descriptor of device/path
+ * \param fa[in] fid_array struct holding fids
+ *
+ * \retval 0 on success
+ * \retval -ve/errno on failure
+ */
+int llapi_rmfid_at(int fd, struct fid_array *fa)
+{
+ return ioctl(fd, LL_IOC_RMFID, fa) ? -errno : 0;
+}
+