Lines Matching refs:control
397 auto control = in makeControl() local
399 if (control) { in makeControl()
407 return control; in makeControl()
556 auto control = makeControl(targetDir); in IncFs_Mount() local
557 if (control == nullptr) { in IncFs_Mount()
561 return control; in IncFs_Mount()
573 IncFsFd IncFs_GetControlFd(const IncFsControl* control, IncFsFdType type) { in IncFs_GetControlFd() argument
574 if (!control) { in IncFs_GetControlFd()
579 return control->cmd; in IncFs_GetControlFd()
581 return control->pendingReads; in IncFs_GetControlFd()
583 return control->logs; in IncFs_GetControlFd()
585 return control->blocksWritten; in IncFs_GetControlFd()
591 IncFsSize IncFs_ReleaseControlFds(IncFsControl* control, IncFsFd out[], IncFsSize outSize) { in IncFs_ReleaseControlFds() argument
592 if (!control || !out) { in IncFs_ReleaseControlFds()
598 out[CMD] = std::exchange(control->cmd, -1); in IncFs_ReleaseControlFds()
599 out[PENDING_READS] = std::exchange(control->pendingReads, -1); in IncFs_ReleaseControlFds()
600 out[LOGS] = std::exchange(control->logs, -1); in IncFs_ReleaseControlFds()
601 out[BLOCKS_WRITTEN] = std::exchange(control->blocksWritten, -1); in IncFs_ReleaseControlFds()
610 void IncFs_DeleteControl(IncFsControl* control) { in IncFs_DeleteControl() argument
611 if (control) { in IncFs_DeleteControl()
612 if (control->cmd >= 0) { in IncFs_DeleteControl()
613 close(control->cmd); in IncFs_DeleteControl()
615 if (control->pendingReads >= 0) { in IncFs_DeleteControl()
616 close(control->pendingReads); in IncFs_DeleteControl()
618 if (control->logs >= 0) { in IncFs_DeleteControl()
619 close(control->logs); in IncFs_DeleteControl()
621 if (control->blocksWritten >= 0) { in IncFs_DeleteControl()
622 close(control->blocksWritten); in IncFs_DeleteControl()
624 delete control; in IncFs_DeleteControl()
628 IncFsErrorCode IncFs_SetOptions(const IncFsControl* control, IncFsMountOptions options) { in IncFs_SetOptions() argument
629 if (!control) { in IncFs_SetOptions()
632 auto root = rootForCmd(control->cmd); in IncFs_SetOptions()
646 IncFsErrorCode IncFs_Root(const IncFsControl* control, char buffer[], size_t* bufferSize) { in IncFs_Root() argument
647 if (!control) { in IncFs_Root()
650 std::string result = rootForCmd(control->cmd); in IncFs_Root()
751 IncFsErrorCode IncFs_MakeFile(const IncFsControl* control, const char* path, int32_t mode, in IncFs_MakeFile() argument
753 if (!control) { in IncFs_MakeFile()
786 if (::ioctl(control->cmd, INCFS_IOC_CREATE_FILE, &args)) { in IncFs_MakeFile()
798 IncFsErrorCode IncFs_MakeMappedFile(const IncFsControl* control, const char* path, int32_t mode, in IncFs_MakeMappedFile() argument
800 if (!control) { in IncFs_MakeMappedFile()
826 if (::ioctl(control->cmd, INCFS_IOC_CREATE_MAPPED_FILE, &args)) { in IncFs_MakeMappedFile()
875 IncFsErrorCode IncFs_MakeDir(const IncFsControl* control, const char* path, int32_t mode) { in IncFs_MakeDir() argument
876 if (!control) { in IncFs_MakeDir()
879 const auto root = rootForCmd(control->cmd); in IncFs_MakeDir()
896 IncFsErrorCode IncFs_MakeDirs(const IncFsControl* control, const char* path, int32_t mode) { in IncFs_MakeDirs() argument
897 if (!control) { in IncFs_MakeDirs()
900 const auto root = rootForCmd(control->cmd); in IncFs_MakeDirs()
929 IncFsErrorCode IncFs_GetMetadataById(const IncFsControl* control, IncFsFileId fileId, char buffer[], in IncFs_GetMetadataById() argument
931 if (!control) { in IncFs_GetMetadataById()
935 const auto root = rootForCmd(control->cmd); in IncFs_GetMetadataById()
943 IncFsErrorCode IncFs_GetMetadataByPath(const IncFsControl* control, const char* path, char buffer[], in IncFs_GetMetadataByPath() argument
945 if (!control) { in IncFs_GetMetadataByPath()
949 const auto root = rootForCmd(control->cmd); in IncFs_GetMetadataByPath()
967 IncFsFileId IncFs_GetId(const IncFsControl* control, const char* path) { in IncFs_GetId() argument
968 if (!control) { in IncFs_GetId()
972 const auto root = rootForCmd(control->cmd); in IncFs_GetId()
997 IncFsErrorCode IncFs_GetSignatureById(const IncFsControl* control, IncFsFileId fileId, in IncFs_GetSignatureById() argument
999 if (!control) { in IncFs_GetSignatureById()
1003 const auto root = rootForCmd(control->cmd); in IncFs_GetSignatureById()
1015 IncFsErrorCode IncFs_GetSignatureByPath(const IncFsControl* control, const char* path, in IncFs_GetSignatureByPath() argument
1017 if (!control) { in IncFs_GetSignatureByPath()
1022 const auto root = rootForCmd(control->cmd); in IncFs_GetSignatureByPath()
1040 IncFsErrorCode IncFs_Link(const IncFsControl* control, const char* fromPath, in IncFs_Link() argument
1042 if (!control) { in IncFs_Link()
1046 auto root = rootForCmd(control->cmd); in IncFs_Link()
1064 IncFsErrorCode IncFs_Unlink(const IncFsControl* control, const char* path) { in IncFs_Unlink() argument
1065 if (!control) { in IncFs_Unlink()
1069 auto root = rootForCmd(control->cmd); in IncFs_Unlink()
1179 IncFsErrorCode IncFs_WaitForPendingReads(const IncFsControl* control, int32_t timeoutMs, in IncFs_WaitForPendingReads() argument
1181 if (!control || control->pendingReads < 0) { in IncFs_WaitForPendingReads()
1185 return waitForReads(control->pendingReads, timeoutMs, buffer, bufferSize); in IncFs_WaitForPendingReads()
1188 IncFsErrorCode IncFs_WaitForPendingReadsWithUid(const IncFsControl* control, int32_t timeoutMs, in IncFs_WaitForPendingReadsWithUid() argument
1190 if (!control || control->pendingReads < 0) { in IncFs_WaitForPendingReadsWithUid()
1194 return waitForReads(control->pendingReads, timeoutMs, buffer, bufferSize); in IncFs_WaitForPendingReadsWithUid()
1197 IncFsErrorCode IncFs_WaitForPageReads(const IncFsControl* control, int32_t timeoutMs, in IncFs_WaitForPageReads() argument
1199 if (!control || control->logs < 0) { in IncFs_WaitForPageReads()
1203 return waitForReads(control->logs, timeoutMs, buffer, bufferSize); in IncFs_WaitForPageReads()
1206 IncFsErrorCode IncFs_WaitForPageReadsWithUid(const IncFsControl* control, int32_t timeoutMs, in IncFs_WaitForPageReadsWithUid() argument
1208 if (!control || control->logs < 0) { in IncFs_WaitForPageReadsWithUid()
1212 return waitForReads(control->logs, timeoutMs, buffer, bufferSize); in IncFs_WaitForPageReadsWithUid()
1228 IncFsFd IncFs_OpenForSpecialOpsByPath(const IncFsControl* control, const char* path) { in IncFs_OpenForSpecialOpsByPath() argument
1229 if (!control) { in IncFs_OpenForSpecialOpsByPath()
1234 const auto cmd = control->cmd; in IncFs_OpenForSpecialOpsByPath()
1242 IncFsFd IncFs_OpenForSpecialOpsById(const IncFsControl* control, IncFsFileId id) { in IncFs_OpenForSpecialOpsById() argument
1243 if (!control) { in IncFs_OpenForSpecialOpsById()
1247 const auto cmd = control->cmd; in IncFs_OpenForSpecialOpsById()
1543 IncFsErrorCode IncFs_IsFullyLoadedByPath(const IncFsControl* control, const char* path) { in IncFs_IsFullyLoadedByPath() argument
1544 if (!control || !path) { in IncFs_IsFullyLoadedByPath()
1547 const auto root = rootForCmd(control->cmd); in IncFs_IsFullyLoadedByPath()
1562 return isFullyLoadedSlow(openForSpecialOps(control->cmd, makeCommandPath(root, path).c_str())); in IncFs_IsFullyLoadedByPath()
1564 IncFsErrorCode IncFs_IsFullyLoadedById(const IncFsControl* control, IncFsFileId fileId) { in IncFs_IsFullyLoadedById() argument
1565 if (!control) { in IncFs_IsFullyLoadedById()
1568 const auto root = rootForCmd(control->cmd); in IncFs_IsFullyLoadedById()
1576 openForSpecialOps(control->cmd, in IncFs_IsFullyLoadedById()
1580 static IncFsErrorCode isEverythingLoadedV2(const IncFsControl* control) { in isEverythingLoadedV2() argument
1581 const auto root = rootForCmd(control->cmd); in isEverythingLoadedV2()
1589 static IncFsErrorCode isEverythingLoadedSlow(const IncFsControl* control) { in isEverythingLoadedSlow() argument
1590 const auto root = rootForCmd(control->cmd); in isEverythingLoadedSlow()
1608 ab::unique_fd(openForSpecialOps(control->cmd, makeCommandPath(root, name).c_str())); in isEverythingLoadedSlow()
1626 IncFsErrorCode IncFs_IsEverythingFullyLoaded(const IncFsControl* control) { in IncFs_IsEverythingFullyLoaded() argument
1627 if (!control) { in IncFs_IsEverythingFullyLoaded()
1631 return isEverythingLoadedV2(control); in IncFs_IsEverythingFullyLoaded()
1633 return isEverythingLoadedSlow(control); in IncFs_IsEverythingFullyLoaded()
1636 IncFsErrorCode IncFs_SetUidReadTimeouts(const IncFsControl* control, in IncFs_SetUidReadTimeouts() argument
1638 if (!control) { in IncFs_SetUidReadTimeouts()
1657 if (::ioctl(control->cmd, INCFS_IOC_SET_READ_TIMEOUTS, &args)) { in IncFs_SetUidReadTimeouts()
1664 IncFsErrorCode IncFs_GetUidReadTimeouts(const IncFsControl* control, in IncFs_GetUidReadTimeouts() argument
1666 if (!control || !bufferSize) { in IncFs_GetUidReadTimeouts()
1678 if (::ioctl(control->cmd, INCFS_IOC_GET_READ_TIMEOUTS, &args)) { in IncFs_GetUidReadTimeouts()
1710 IncFsErrorCode IncFs_GetFileBlockCountById(const IncFsControl* control, IncFsFileId id, in IncFs_GetFileBlockCountById() argument
1712 if (!control) { in IncFs_GetFileBlockCountById()
1718 const auto root = rootForCmd(control->cmd); in IncFs_GetFileBlockCountById()
1730 IncFsErrorCode IncFs_GetFileBlockCountByPath(const IncFsControl* control, const char* path, in IncFs_GetFileBlockCountByPath() argument
1732 if (!control) { in IncFs_GetFileBlockCountByPath()
1739 const auto root = rootForCmd(control->cmd); in IncFs_GetFileBlockCountByPath()
1750 IncFsErrorCode IncFs_ListIncompleteFiles(const IncFsControl* control, IncFsFileId ids[], in IncFs_ListIncompleteFiles() argument
1752 if (!control || !bufferSize) { in IncFs_ListIncompleteFiles()
1758 const auto root = rootForCmd(control->cmd); in IncFs_ListIncompleteFiles()
1780 IncFsErrorCode IncFs_ForEachFile(const IncFsControl* control, void* context, FileCallback cb) { in IncFs_ForEachFile() argument
1781 if (!control || !cb) { in IncFs_ForEachFile()
1784 const auto root = rootForCmd(control->cmd); in IncFs_ForEachFile()
1789 return cb(context, control, IncFs_FileIdFromString(name)); in IncFs_ForEachFile()
1793 IncFsErrorCode IncFs_ForEachIncompleteFile(const IncFsControl* control, void* context, in IncFs_ForEachIncompleteFile() argument
1795 if (!control || !cb) { in IncFs_ForEachIncompleteFile()
1801 const auto root = rootForCmd(control->cmd); in IncFs_ForEachIncompleteFile()
1806 return cb(context, control, IncFs_FileIdFromString(name)); in IncFs_ForEachIncompleteFile()
1810 IncFsErrorCode IncFs_WaitForLoadingComplete(const IncFsControl* control, int32_t timeoutMs) { in IncFs_WaitForLoadingComplete() argument
1811 if (!control) { in IncFs_WaitForLoadingComplete()
1821 const auto root = rootForCmd(control->cmd); in IncFs_WaitForLoadingComplete()
1839 auto res = IncFs_ListIncompleteFiles(control, nullptr, &count); in IncFs_WaitForLoadingComplete()
1876 auto res = IncFs_ListIncompleteFiles(control, nullptr, &count); in IncFs_WaitForLoadingComplete()
1890 IncFsErrorCode IncFs_WaitForFsWrittenBlocksChange(const IncFsControl* control, int32_t timeoutMs, in IncFs_WaitForFsWrittenBlocksChange() argument
1892 if (!control || !count) { in IncFs_WaitForFsWrittenBlocksChange()
1905 pollfd pfd = {control->blocksWritten, POLLIN, 0}; in IncFs_WaitForFsWrittenBlocksChange()
1922 auto size = ::read(control->blocksWritten, str, sizeof(str)); in IncFs_WaitForFsWrittenBlocksChange()
1965 IncFsErrorCode IncFs_ReserveSpaceByPath(const IncFsControl* control, const char* path, in IncFs_ReserveSpaceByPath() argument
1967 if (!control || (size != kIncFsTrimReservedSpace && size < 0)) { in IncFs_ReserveSpaceByPath()
1971 const auto root = rootForCmd(control->cmd); in IncFs_ReserveSpaceByPath()
1978 IncFsErrorCode IncFs_ReserveSpaceById(const IncFsControl* control, IncFsFileId id, IncFsSize size) { in IncFs_ReserveSpaceById() argument
1979 if (!control || (size != kIncFsTrimReservedSpace && size < 0)) { in IncFs_ReserveSpaceById()
1982 const auto root = rootForCmd(control->cmd); in IncFs_ReserveSpaceById()
2052 IncFsErrorCode IncFs_GetLastReadError(const IncFsControl* control, in IncFs_GetLastReadError() argument
2054 if (!control) { in IncFs_GetLastReadError()
2061 auto res = ::ioctl(control->cmd, INCFS_IOC_GET_LAST_READ_ERROR, &args); in IncFs_GetLastReadError()