Lines Matching refs:fd_info
408 struct uv__fd_info_s fd_info; in fs__open() local
413 fd_info.flags = flags; in fs__open()
414 fd_info.current_pos.QuadPart = 0; in fs__open()
614 fd_info.is_directory = file_info.Directory; in fs__open()
616 if (fd_info.is_directory) { in fs__open()
617 fd_info.size.QuadPart = 0; in fs__open()
618 fd_info.mapping = INVALID_HANDLE_VALUE; in fs__open()
620 if (!GetFileSizeEx(file, &fd_info.size)) { in fs__open()
626 if (fd_info.size.QuadPart == 0) { in fs__open()
627 fd_info.mapping = INVALID_HANDLE_VALUE; in fs__open()
629 DWORD flProtect = (fd_info.flags & (UV_FS_O_RDONLY | UV_FS_O_WRONLY | in fs__open()
631 fd_info.mapping = CreateFileMapping(file, in fs__open()
634 fd_info.size.HighPart, in fs__open()
635 fd_info.size.LowPart, in fs__open()
637 if (fd_info.mapping == NULL) { in fs__open()
645 uv__fd_hash_add(fd, &fd_info); in fs__open()
658 struct uv__fd_info_s fd_info; in fs__close() local
662 if (uv__fd_hash_remove(fd, &fd_info)) { in fs__close()
663 if (fd_info.mapping != INVALID_HANDLE_VALUE) { in fs__close()
664 CloseHandle(fd_info.mapping); in fs__close()
705 void fs__read_filemap(uv_fs_t* req, struct uv__fd_info_s* fd_info) { in fs__read_filemap() argument
707 int rw_flags = fd_info->flags & in fs__read_filemap()
720 if (fd_info->is_directory) { in fs__read_filemap()
726 pos = fd_info->current_pos; in fs__read_filemap()
732 if (pos.QuadPart >= fd_info->size.QuadPart) { in fs__read_filemap()
742 fd_info->size.QuadPart - pos.QuadPart); in fs__read_filemap()
752 view = MapViewOfFile(fd_info->mapping, in fs__read_filemap()
794 fd_info->current_pos = end_pos; in fs__read_filemap()
795 uv__fd_hash_add(fd, fd_info); in fs__read_filemap()
815 struct uv__fd_info_s fd_info; in fs__read() local
819 if (uv__fd_hash_get(fd, &fd_info)) { in fs__read()
820 fs__read_filemap(req, &fd_info); in fs__read()
885 struct uv__fd_info_s* fd_info) { in fs__write_filemap() argument
887 int force_append = fd_info->flags & UV_FS_O_APPEND; in fs__write_filemap()
888 int rw_flags = fd_info->flags & in fs__write_filemap()
902 if (fd_info->is_directory) { in fs__write_filemap()
918 pos = fd_info->size; in fs__write_filemap()
920 pos = fd_info->current_pos; in fs__write_filemap()
928 if (end_pos.QuadPart > fd_info->size.QuadPart) { in fs__write_filemap()
929 if (fd_info->mapping != INVALID_HANDLE_VALUE) { in fs__write_filemap()
930 CloseHandle(fd_info->mapping); in fs__write_filemap()
933 fd_info->mapping = CreateFileMapping(file, in fs__write_filemap()
939 if (fd_info->mapping == NULL) { in fs__write_filemap()
942 fd_info->mapping = INVALID_HANDLE_VALUE; in fs__write_filemap()
943 fd_info->size.QuadPart = 0; in fs__write_filemap()
944 fd_info->current_pos.QuadPart = 0; in fs__write_filemap()
945 uv__fd_hash_add(fd, fd_info); in fs__write_filemap()
949 fd_info->size = end_pos; in fs__write_filemap()
950 uv__fd_hash_add(fd, fd_info); in fs__write_filemap()
955 view = MapViewOfFile(fd_info->mapping, in fs__write_filemap()
998 fd_info->current_pos = end_pos; in fs__write_filemap()
999 uv__fd_hash_add(fd, fd_info); in fs__write_filemap()
1021 struct uv__fd_info_s fd_info; in fs__write() local
1033 if (uv__fd_hash_get(fd, &fd_info)) { in fs__write()
1034 fs__write_filemap(req, handle, &fd_info); in fs__write()
2115 struct uv__fd_info_s fd_info = { 0 }; in fs__ftruncate() local
2124 if (uv__fd_hash_get(fd, &fd_info)) { in fs__ftruncate()
2125 if (fd_info.is_directory) { in fs__ftruncate()
2130 if (fd_info.mapping != INVALID_HANDLE_VALUE) { in fs__ftruncate()
2131 CloseHandle(fd_info.mapping); in fs__ftruncate()
2148 if (fd_info.flags) { in fs__ftruncate()
2150 fd_info.mapping = INVALID_HANDLE_VALUE; in fs__ftruncate()
2151 fd_info.size.QuadPart = 0; in fs__ftruncate()
2152 fd_info.current_pos.QuadPart = 0; in fs__ftruncate()
2153 uv__fd_hash_add(fd, &fd_info); in fs__ftruncate()
2158 if (fd_info.flags) { in fs__ftruncate()
2159 fd_info.size = eof_info.EndOfFile; in fs__ftruncate()
2161 if (fd_info.size.QuadPart == 0) { in fs__ftruncate()
2162 fd_info.mapping = INVALID_HANDLE_VALUE; in fs__ftruncate()
2164 DWORD flProtect = (fd_info.flags & (UV_FS_O_RDONLY | UV_FS_O_WRONLY | in fs__ftruncate()
2166 fd_info.mapping = CreateFileMapping(handle, in fs__ftruncate()
2169 fd_info.size.HighPart, in fs__ftruncate()
2170 fd_info.size.LowPart, in fs__ftruncate()
2172 if (fd_info.mapping == NULL) { in fs__ftruncate()
2175 fd_info.mapping = INVALID_HANDLE_VALUE; in fs__ftruncate()
2176 fd_info.size.QuadPart = 0; in fs__ftruncate()
2177 fd_info.current_pos.QuadPart = 0; in fs__ftruncate()
2178 uv__fd_hash_add(fd, &fd_info); in fs__ftruncate()
2183 uv__fd_hash_add(fd, &fd_info); in fs__ftruncate()