Lines Matching refs:control

418     auto control =  in makeControl()  local
420 if (control) { in makeControl()
428 return control; in makeControl()
595 auto control = makeControl(rootFd); in IncFs_Mount() local
596 if (control == nullptr) { in IncFs_Mount()
600 return control; in IncFs_Mount()
613 IncFsFd IncFs_GetControlFd(const IncFsControl* control, IncFsFdType type) { in IncFs_GetControlFd() argument
614 if (!control) { in IncFs_GetControlFd()
619 return control->cmd; in IncFs_GetControlFd()
621 return control->pendingReads; in IncFs_GetControlFd()
623 return control->logs; in IncFs_GetControlFd()
625 return control->blocksWritten; in IncFs_GetControlFd()
631 IncFsSize IncFs_ReleaseControlFds(IncFsControl* control, IncFsFd out[], IncFsSize outSize) { in IncFs_ReleaseControlFds() argument
632 if (!control || !out) { in IncFs_ReleaseControlFds()
638 out[CMD] = std::exchange(control->cmd, -1); in IncFs_ReleaseControlFds()
639 out[PENDING_READS] = std::exchange(control->pendingReads, -1); in IncFs_ReleaseControlFds()
640 out[LOGS] = std::exchange(control->logs, -1); in IncFs_ReleaseControlFds()
641 out[BLOCKS_WRITTEN] = std::exchange(control->blocksWritten, -1); in IncFs_ReleaseControlFds()
650 void IncFs_DeleteControl(IncFsControl* control) { in IncFs_DeleteControl() argument
651 if (control) { in IncFs_DeleteControl()
652 if (control->cmd >= 0) { in IncFs_DeleteControl()
653 close(control->cmd); in IncFs_DeleteControl()
655 if (control->pendingReads >= 0) { in IncFs_DeleteControl()
656 close(control->pendingReads); in IncFs_DeleteControl()
658 if (control->logs >= 0) { in IncFs_DeleteControl()
659 close(control->logs); in IncFs_DeleteControl()
661 if (control->blocksWritten >= 0) { in IncFs_DeleteControl()
662 close(control->blocksWritten); in IncFs_DeleteControl()
664 delete control; in IncFs_DeleteControl()
668 IncFsErrorCode IncFs_SetOptions(const IncFsControl* control, IncFsMountOptions options) { in IncFs_SetOptions() argument
669 if (!control) { in IncFs_SetOptions()
672 auto root = rootForCmd(control->cmd); in IncFs_SetOptions()
686 IncFsErrorCode IncFs_Root(const IncFsControl* control, char buffer[], size_t* bufferSize) { in IncFs_Root() argument
687 if (!control) { in IncFs_Root()
690 std::string result = rootForCmd(control->cmd); in IncFs_Root()
791 IncFsErrorCode IncFs_MakeFile(const IncFsControl* control, const char* path, int32_t mode, in IncFs_MakeFile() argument
793 if (!control) { in IncFs_MakeFile()
826 if (::ioctl(control->cmd, INCFS_IOC_CREATE_FILE, &args)) { in IncFs_MakeFile()
838 IncFsErrorCode IncFs_MakeMappedFile(const IncFsControl* control, const char* path, int32_t mode, in IncFs_MakeMappedFile() argument
840 if (!control) { in IncFs_MakeMappedFile()
866 if (::ioctl(control->cmd, INCFS_IOC_CREATE_MAPPED_FILE, &args)) { in IncFs_MakeMappedFile()
915 IncFsErrorCode IncFs_MakeDir(const IncFsControl* control, const char* path, int32_t mode) { in IncFs_MakeDir() argument
916 if (!control) { in IncFs_MakeDir()
919 const auto root = rootForCmd(control->cmd); in IncFs_MakeDir()
936 IncFsErrorCode IncFs_MakeDirs(const IncFsControl* control, const char* path, int32_t mode) { in IncFs_MakeDirs() argument
937 if (!control) { in IncFs_MakeDirs()
940 const auto root = rootForCmd(control->cmd); in IncFs_MakeDirs()
969 IncFsErrorCode IncFs_GetMetadataById(const IncFsControl* control, IncFsFileId fileId, char buffer[], in IncFs_GetMetadataById() argument
971 if (!control) { in IncFs_GetMetadataById()
975 const auto root = rootForCmd(control->cmd); in IncFs_GetMetadataById()
983 IncFsErrorCode IncFs_GetMetadataByPath(const IncFsControl* control, const char* path, char buffer[], in IncFs_GetMetadataByPath() argument
985 if (!control) { in IncFs_GetMetadataByPath()
989 const auto root = rootForCmd(control->cmd); in IncFs_GetMetadataByPath()
1007 IncFsFileId IncFs_GetId(const IncFsControl* control, const char* path) { in IncFs_GetId() argument
1008 if (!control) { in IncFs_GetId()
1012 const auto root = rootForCmd(control->cmd); in IncFs_GetId()
1037 IncFsErrorCode IncFs_GetSignatureById(const IncFsControl* control, IncFsFileId fileId, in IncFs_GetSignatureById() argument
1039 if (!control) { in IncFs_GetSignatureById()
1043 const auto root = rootForCmd(control->cmd); in IncFs_GetSignatureById()
1055 IncFsErrorCode IncFs_GetSignatureByPath(const IncFsControl* control, const char* path, in IncFs_GetSignatureByPath() argument
1057 if (!control) { in IncFs_GetSignatureByPath()
1062 const auto root = rootForCmd(control->cmd); in IncFs_GetSignatureByPath()
1080 IncFsErrorCode IncFs_Link(const IncFsControl* control, const char* fromPath, in IncFs_Link() argument
1082 if (!control) { in IncFs_Link()
1086 auto root = rootForCmd(control->cmd); in IncFs_Link()
1104 IncFsErrorCode IncFs_Unlink(const IncFsControl* control, const char* path) { in IncFs_Unlink() argument
1105 if (!control) { in IncFs_Unlink()
1109 auto root = rootForCmd(control->cmd); in IncFs_Unlink()
1219 IncFsErrorCode IncFs_WaitForPendingReads(const IncFsControl* control, int32_t timeoutMs, in IncFs_WaitForPendingReads() argument
1221 if (!control || control->pendingReads < 0) { in IncFs_WaitForPendingReads()
1225 return waitForReads(control->pendingReads, timeoutMs, buffer, bufferSize); in IncFs_WaitForPendingReads()
1228 IncFsErrorCode IncFs_WaitForPendingReadsWithUid(const IncFsControl* control, int32_t timeoutMs, in IncFs_WaitForPendingReadsWithUid() argument
1230 if (!control || control->pendingReads < 0) { in IncFs_WaitForPendingReadsWithUid()
1234 return waitForReads(control->pendingReads, timeoutMs, buffer, bufferSize); in IncFs_WaitForPendingReadsWithUid()
1237 IncFsErrorCode IncFs_WaitForPageReads(const IncFsControl* control, int32_t timeoutMs, in IncFs_WaitForPageReads() argument
1239 if (!control || control->logs < 0) { in IncFs_WaitForPageReads()
1243 return waitForReads(control->logs, timeoutMs, buffer, bufferSize); in IncFs_WaitForPageReads()
1246 IncFsErrorCode IncFs_WaitForPageReadsWithUid(const IncFsControl* control, int32_t timeoutMs, in IncFs_WaitForPageReadsWithUid() argument
1248 if (!control || control->logs < 0) { in IncFs_WaitForPageReadsWithUid()
1252 return waitForReads(control->logs, timeoutMs, buffer, bufferSize); in IncFs_WaitForPageReadsWithUid()
1268 IncFsFd IncFs_OpenForSpecialOpsByPath(const IncFsControl* control, const char* path) { in IncFs_OpenForSpecialOpsByPath() argument
1269 if (!control) { in IncFs_OpenForSpecialOpsByPath()
1274 const auto cmd = control->cmd; in IncFs_OpenForSpecialOpsByPath()
1282 IncFsFd IncFs_OpenForSpecialOpsById(const IncFsControl* control, IncFsFileId id) { in IncFs_OpenForSpecialOpsById() argument
1283 if (!control) { in IncFs_OpenForSpecialOpsById()
1287 const auto cmd = control->cmd; in IncFs_OpenForSpecialOpsById()
1595 IncFsErrorCode IncFs_IsFullyLoadedByPath(const IncFsControl* control, const char* path) { in IncFs_IsFullyLoadedByPath() argument
1596 if (!control || !path) { in IncFs_IsFullyLoadedByPath()
1599 const auto root = rootForCmd(control->cmd); in IncFs_IsFullyLoadedByPath()
1614 return isFullyLoadedSlow(openForSpecialOps(control->cmd, makeCommandPath(root, path).c_str())); in IncFs_IsFullyLoadedByPath()
1616 IncFsErrorCode IncFs_IsFullyLoadedById(const IncFsControl* control, IncFsFileId fileId) { in IncFs_IsFullyLoadedById() argument
1617 if (!control) { in IncFs_IsFullyLoadedById()
1620 const auto root = rootForCmd(control->cmd); in IncFs_IsFullyLoadedById()
1628 openForSpecialOps(control->cmd, in IncFs_IsFullyLoadedById()
1632 static IncFsErrorCode isEverythingLoadedV2(const IncFsControl* control) { in isEverythingLoadedV2() argument
1633 const auto root = rootForCmd(control->cmd); in isEverythingLoadedV2()
1641 static IncFsErrorCode isEverythingLoadedSlow(const IncFsControl* control) { in isEverythingLoadedSlow() argument
1642 const auto root = rootForCmd(control->cmd); in isEverythingLoadedSlow()
1660 ab::unique_fd(openForSpecialOps(control->cmd, makeCommandPath(root, name).c_str())); in isEverythingLoadedSlow()
1678 IncFsErrorCode IncFs_IsEverythingFullyLoaded(const IncFsControl* control) { in IncFs_IsEverythingFullyLoaded() argument
1679 if (!control) { in IncFs_IsEverythingFullyLoaded()
1683 return isEverythingLoadedV2(control); in IncFs_IsEverythingFullyLoaded()
1685 return isEverythingLoadedSlow(control); in IncFs_IsEverythingFullyLoaded()
1688 IncFsErrorCode IncFs_SetUidReadTimeouts(const IncFsControl* control, in IncFs_SetUidReadTimeouts() argument
1690 if (!control) { in IncFs_SetUidReadTimeouts()
1709 if (::ioctl(control->cmd, INCFS_IOC_SET_READ_TIMEOUTS, &args)) { in IncFs_SetUidReadTimeouts()
1716 IncFsErrorCode IncFs_GetUidReadTimeouts(const IncFsControl* control, in IncFs_GetUidReadTimeouts() argument
1718 if (!control || !bufferSize) { in IncFs_GetUidReadTimeouts()
1730 if (::ioctl(control->cmd, INCFS_IOC_GET_READ_TIMEOUTS, &args)) { in IncFs_GetUidReadTimeouts()
1775 IncFsErrorCode IncFs_GetFileBlockCountById(const IncFsControl* control, IncFsFileId id, in IncFs_GetFileBlockCountById() argument
1777 if (!control) { in IncFs_GetFileBlockCountById()
1783 const auto root = rootForCmd(control->cmd); in IncFs_GetFileBlockCountById()
1795 IncFsErrorCode IncFs_GetFileBlockCountByPath(const IncFsControl* control, const char* path, in IncFs_GetFileBlockCountByPath() argument
1797 if (!control) { in IncFs_GetFileBlockCountByPath()
1804 const auto root = rootForCmd(control->cmd); in IncFs_GetFileBlockCountByPath()
1815 IncFsErrorCode IncFs_ListIncompleteFiles(const IncFsControl* control, IncFsFileId ids[], in IncFs_ListIncompleteFiles() argument
1817 if (!control || !bufferSize) { in IncFs_ListIncompleteFiles()
1823 const auto root = rootForCmd(control->cmd); in IncFs_ListIncompleteFiles()
1845 IncFsErrorCode IncFs_ForEachFile(const IncFsControl* control, void* context, FileCallback cb) { in IncFs_ForEachFile() argument
1846 if (!control || !cb) { in IncFs_ForEachFile()
1849 const auto root = rootForCmd(control->cmd); in IncFs_ForEachFile()
1854 return cb(context, control, IncFs_FileIdFromString(name)); in IncFs_ForEachFile()
1858 IncFsErrorCode IncFs_ForEachIncompleteFile(const IncFsControl* control, void* context, in IncFs_ForEachIncompleteFile() argument
1860 if (!control || !cb) { in IncFs_ForEachIncompleteFile()
1866 const auto root = rootForCmd(control->cmd); in IncFs_ForEachIncompleteFile()
1871 return cb(context, control, IncFs_FileIdFromString(name)); in IncFs_ForEachIncompleteFile()
1875 IncFsErrorCode IncFs_WaitForLoadingComplete(const IncFsControl* control, int32_t timeoutMs) { in IncFs_WaitForLoadingComplete() argument
1876 if (!control) { in IncFs_WaitForLoadingComplete()
1886 const auto root = rootForCmd(control->cmd); in IncFs_WaitForLoadingComplete()
1904 auto res = IncFs_ListIncompleteFiles(control, nullptr, &count); in IncFs_WaitForLoadingComplete()
1941 auto res = IncFs_ListIncompleteFiles(control, nullptr, &count); in IncFs_WaitForLoadingComplete()
1955 IncFsErrorCode IncFs_WaitForFsWrittenBlocksChange(const IncFsControl* control, int32_t timeoutMs, in IncFs_WaitForFsWrittenBlocksChange() argument
1957 if (!control || !count) { in IncFs_WaitForFsWrittenBlocksChange()
1970 pollfd pfd = {control->blocksWritten, POLLIN, 0}; in IncFs_WaitForFsWrittenBlocksChange()
1987 auto size = ::read(control->blocksWritten, str, sizeof(str)); in IncFs_WaitForFsWrittenBlocksChange()
2030 IncFsErrorCode IncFs_ReserveSpaceByPath(const IncFsControl* control, const char* path, in IncFs_ReserveSpaceByPath() argument
2032 if (!control || (size != kIncFsTrimReservedSpace && size < 0)) { in IncFs_ReserveSpaceByPath()
2036 const auto root = rootForCmd(control->cmd); in IncFs_ReserveSpaceByPath()
2043 IncFsErrorCode IncFs_ReserveSpaceById(const IncFsControl* control, IncFsFileId id, IncFsSize size) { in IncFs_ReserveSpaceById() argument
2044 if (!control || (size != kIncFsTrimReservedSpace && size < 0)) { in IncFs_ReserveSpaceById()
2047 const auto root = rootForCmd(control->cmd); in IncFs_ReserveSpaceById()
2117 IncFsErrorCode IncFs_GetLastReadError(const IncFsControl* control, in IncFs_GetLastReadError() argument
2119 if (!control) { in IncFs_GetLastReadError()
2126 auto res = ::ioctl(control->cmd, INCFS_IOC_GET_LAST_READ_ERROR, &args); in IncFs_GetLastReadError()