Lines Matching refs:req

92     if (req == NULL)                                                          \
94 UV_REQ_INIT(req, UV_FS); \
95 req->fs_type = UV_FS_ ## subtype; \
96 req->result = 0; \
97 req->ptr = NULL; \
98 req->loop = loop; \
99 req->path = NULL; \
100 req->new_path = NULL; \
101 req->bufs = NULL; \
102 req->cb = cb; \
110 req->path = path; \
112 req->path = uv__strdup(path); \
113 if (req->path == NULL) \
122 req->path = path; \
123 req->new_path = new_path; \
129 req->path = uv__malloc(path_len + new_path_len); \
130 if (req->path == NULL) \
132 req->new_path = req->path + path_len; \
133 memcpy((void*) req->path, path, path_len); \
134 memcpy((void*) req->new_path, new_path, new_path_len); \
144 &req->work_req, \
151 uv__fs_work(&req->work_req); \
152 return req->result; \
170 static ssize_t uv__fs_fsync(uv_fs_t* req) { in uv__fs_fsync() argument
182 r = fcntl(req->file, F_FULLFSYNC); in uv__fs_fsync()
184 r = fcntl(req->file, 85 /* F_BARRIERFSYNC */); /* fsync + barrier */ in uv__fs_fsync()
186 r = fsync(req->file); in uv__fs_fsync()
189 return fsync(req->file); in uv__fs_fsync()
194 static ssize_t uv__fs_fdatasync(uv_fs_t* req) { in uv__fs_fdatasync() argument
196 return fdatasync(req->file); in uv__fs_fdatasync()
199 return uv__fs_fsync(req); in uv__fs_fdatasync()
201 return fsync(req->file); in uv__fs_fdatasync()
236 static ssize_t uv__fs_futime(uv_fs_t* req) { in uv__fs_futime() argument
242 ts[0] = uv__fs_to_timespec(req->atime); in uv__fs_futime()
243 ts[1] = uv__fs_to_timespec(req->mtime); in uv__fs_futime()
244 return futimens(req->file, ts); in uv__fs_futime()
252 tv[0] = uv__fs_to_timeval(req->atime); in uv__fs_futime()
253 tv[1] = uv__fs_to_timeval(req->mtime); in uv__fs_futime()
255 return futimesat(req->file, NULL, tv); in uv__fs_futime()
257 return futimes(req->file, tv); in uv__fs_futime()
264 atr.att_mtime = req->mtime; in uv__fs_futime()
265 atr.att_atime = req->atime; in uv__fs_futime()
266 return __fchattr(req->file, &atr, sizeof(atr)); in uv__fs_futime()
274 static ssize_t uv__fs_mkdtemp(uv_fs_t* req) { in uv__fs_mkdtemp() argument
275 return mkdtemp((char*) req->path) ? 0 : -1; in uv__fs_mkdtemp()
298 static int uv__fs_mkstemp(uv_fs_t* req) { in uv__fs_mkstemp() argument
309 path = (char*) req->path; in uv__fs_mkstemp()
345 if (req->cb != NULL) in uv__fs_mkstemp()
346 uv_rwlock_rdlock(&req->loop->cloexec_lock); in uv__fs_mkstemp()
360 if (req->cb != NULL) in uv__fs_mkstemp()
361 uv_rwlock_rdunlock(&req->loop->cloexec_lock); in uv__fs_mkstemp()
370 static ssize_t uv__fs_open(uv_fs_t* req) { in uv__fs_open() argument
372 return open(req->path, req->flags | O_CLOEXEC, req->mode); in uv__fs_open()
376 if (req->cb != NULL) in uv__fs_open()
377 uv_rwlock_rdlock(&req->loop->cloexec_lock); in uv__fs_open()
379 r = open(req->path, req->flags, req->mode); in uv__fs_open()
391 if (req->cb != NULL) in uv__fs_open()
392 uv_rwlock_rdunlock(&req->loop->cloexec_lock); in uv__fs_open()
516 static ssize_t uv__fs_read(uv_fs_t* req) { in uv__fs_read() argument
524 fd = req->file; in uv__fs_read()
525 off = req->off; in uv__fs_read()
526 bufs = (const struct iovec*) req->bufs; in uv__fs_read()
527 nbufs = req->nbufs; in uv__fs_read()
559 if (req->cb != NULL) in uv__fs_read()
560 if (req->bufs != req->bufsml) in uv__fs_read()
561 uv__free(req->bufs); in uv__fs_read()
563 req->bufs = NULL; in uv__fs_read()
564 req->nbufs = 0; in uv__fs_read()
580 static ssize_t uv__fs_scandir(uv_fs_t* req) { in uv__fs_scandir() argument
585 n = scandir(req->path, &dents, uv__fs_scandir_filter, uv__fs_scandir_sort); in uv__fs_scandir()
588 req->nbufs = 0; in uv__fs_scandir()
600 req->ptr = dents; in uv__fs_scandir()
605 static int uv__fs_opendir(uv_fs_t* req) { in uv__fs_opendir() argument
612 dir->dir = opendir(req->path); in uv__fs_opendir()
616 req->ptr = dir; in uv__fs_opendir()
621 req->ptr = NULL; in uv__fs_opendir()
625 static int uv__fs_readdir(uv_fs_t* req) { in uv__fs_readdir() argument
632 dir = req->ptr; in uv__fs_readdir()
671 static int uv__fs_closedir(uv_fs_t* req) { in uv__fs_closedir() argument
674 dir = req->ptr; in uv__fs_closedir()
681 uv__free(req->ptr); in uv__fs_closedir()
682 req->ptr = NULL; in uv__fs_closedir()
686 static int uv__fs_statfs(uv_fs_t* req) { in uv__fs_statfs() argument
695 if (0 != statvfs(req->path, &buf)) in uv__fs_statfs()
699 if (0 != statfs(req->path, &buf)) in uv__fs_statfs()
725 req->ptr = stat_fs; in uv__fs_statfs()
740 static ssize_t uv__fs_readlink(uv_fs_t* req) { in uv__fs_readlink() argument
746 maxlen = uv__fs_pathmax_size(req->path); in uv__fs_readlink()
751 ret = uv__lstat(req->path, &st); in uv__fs_readlink()
764 maxlen = uv__fs_pathmax_size(req->path); in uv__fs_readlink()
775 len = os390_readlink(req->path, buf, maxlen); in uv__fs_readlink()
777 len = readlink(req->path, buf, maxlen); in uv__fs_readlink()
794 req->ptr = buf; in uv__fs_readlink()
799 static ssize_t uv__fs_realpath(uv_fs_t* req) { in uv__fs_realpath() argument
804 tmp = realpath(req->path, NULL); in uv__fs_realpath()
818 len = uv__fs_pathmax_size(req->path); in uv__fs_realpath()
826 if (realpath(req->path, buf) == NULL) { in uv__fs_realpath()
832 req->ptr = buf; in uv__fs_realpath()
837 static ssize_t uv__fs_sendfile_emul(uv_fs_t* req) { in uv__fs_sendfile_emul() argument
851 len = req->bufsml[0].len; in uv__fs_sendfile_emul()
852 in_fd = req->flags; in uv__fs_sendfile_emul()
853 out_fd = req->file; in uv__fs_sendfile_emul()
854 offset = req->off; in uv__fs_sendfile_emul()
945 req->off = offset; in uv__fs_sendfile_emul()
1035 static ssize_t uv__fs_sendfile(uv_fs_t* req) { in uv__fs_sendfile() argument
1039 in_fd = req->flags; in uv__fs_sendfile()
1040 out_fd = req->file; in uv__fs_sendfile()
1049 off = req->off; in uv__fs_sendfile()
1050 len = req->bufsml[0].len; in uv__fs_sendfile()
1065 if (r != -1 || off > req->off) { in uv__fs_sendfile()
1066 r = off - req->off; in uv__fs_sendfile()
1067 req->off = off; in uv__fs_sendfile()
1076 return uv__fs_sendfile_emul(req); in uv__fs_sendfile()
1098 off = req->off; in uv__fs_sendfile()
1099 r = uv__fs_copy_file_range(in_fd, &off, out_fd, NULL, req->bufsml[0].len, 0); in uv__fs_sendfile()
1101 r = off - req->off; in uv__fs_sendfile()
1102 req->off = off; in uv__fs_sendfile()
1107 r = sendfile(in_fd, out_fd, req->off, req->bufsml[0].len, NULL, &len, 0); in uv__fs_sendfile()
1111 len = req->bufsml[0].len; in uv__fs_sendfile()
1112 r = sendfile(in_fd, out_fd, req->off, &len, NULL, 0); in uv__fs_sendfile()
1123 req->off += len; in uv__fs_sendfile()
1132 return uv__fs_sendfile_emul(req); in uv__fs_sendfile()
1142 return uv__fs_sendfile_emul(req); in uv__fs_sendfile()
1147 static ssize_t uv__fs_utime(uv_fs_t* req) { in uv__fs_utime() argument
1153 ts[0] = uv__fs_to_timespec(req->atime); in uv__fs_utime()
1154 ts[1] = uv__fs_to_timespec(req->mtime); in uv__fs_utime()
1155 return utimensat(AT_FDCWD, req->path, ts, 0); in uv__fs_utime()
1162 tv[0] = uv__fs_to_timeval(req->atime); in uv__fs_utime()
1163 tv[1] = uv__fs_to_timeval(req->mtime); in uv__fs_utime()
1164 return utimes(req->path, tv); in uv__fs_utime()
1168 buf.actime = req->atime; in uv__fs_utime()
1169 buf.modtime = req->mtime; in uv__fs_utime()
1170 return utime(req->path, &buf); in uv__fs_utime()
1176 atr.att_mtime = req->mtime; in uv__fs_utime()
1177 atr.att_atime = req->atime; in uv__fs_utime()
1178 return __lchattr((char*) req->path, &atr, sizeof(atr)); in uv__fs_utime()
1186 static ssize_t uv__fs_lutime(uv_fs_t* req) { in uv__fs_lutime() argument
1194 ts[0] = uv__fs_to_timespec(req->atime); in uv__fs_lutime()
1195 ts[1] = uv__fs_to_timespec(req->mtime); in uv__fs_lutime()
1196 return utimensat(AT_FDCWD, req->path, ts, AT_SYMLINK_NOFOLLOW); in uv__fs_lutime()
1202 tv[0] = uv__fs_to_timeval(req->atime); in uv__fs_lutime()
1203 tv[1] = uv__fs_to_timeval(req->mtime); in uv__fs_lutime()
1204 return lutimes(req->path, tv); in uv__fs_lutime()
1212 static ssize_t uv__fs_write(uv_fs_t* req) { in uv__fs_write() argument
1219 fd = req->file; in uv__fs_write()
1220 off = req->off; in uv__fs_write()
1221 bufs = (const struct iovec*) req->bufs; in uv__fs_write()
1222 nbufs = req->nbufs; in uv__fs_write()
1241 static ssize_t uv__fs_copyfile(uv_fs_t* req) { in uv__fs_copyfile() argument
1260 srcfd = uv_fs_open(NULL, &fs_req, req->path, O_RDONLY, 0, NULL); in uv__fs_copyfile()
1274 if (req->flags & UV_FS_COPYFILE_EXCL) in uv__fs_copyfile()
1280 req->new_path, in uv__fs_copyfile()
1293 if ((req->flags & UV_FS_COPYFILE_EXCL) == 0) { in uv__fs_copyfile()
1374 if (req->flags & UV_FS_COPYFILE_FICLONE || in uv__fs_copyfile()
1375 req->flags & UV_FS_COPYFILE_FICLONE_FORCE) { in uv__fs_copyfile()
1382 if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE) { in uv__fs_copyfile()
1388 if (req->flags & UV_FS_COPYFILE_FICLONE_FORCE) { in uv__fs_copyfile()
1436 uv_fs_unlink(NULL, &fs_req, req->new_path, NULL); in uv__fs_copyfile()
1649 static ssize_t uv__fs_write_all(uv_fs_t* req) { in uv__fs_write_all() argument
1657 nbufs = req->nbufs; in uv__fs_write_all()
1658 bufs = req->bufs; in uv__fs_write_all()
1662 req->nbufs = nbufs; in uv__fs_write_all()
1663 if (req->nbufs > iovmax) in uv__fs_write_all()
1664 req->nbufs = iovmax; in uv__fs_write_all()
1667 result = uv__fs_write(req); in uv__fs_write_all()
1676 if (req->off >= 0) in uv__fs_write_all()
1677 req->off += result; in uv__fs_write_all()
1679 req->nbufs = uv__fs_buf_offset(req->bufs, result); in uv__fs_write_all()
1680 req->bufs += req->nbufs; in uv__fs_write_all()
1681 nbufs -= req->nbufs; in uv__fs_write_all()
1685 if (bufs != req->bufsml) in uv__fs_write_all()
1688 req->bufs = NULL; in uv__fs_write_all()
1689 req->nbufs = 0; in uv__fs_write_all()
1697 uv_fs_t* req; in uv__fs_work() local
1700 req = container_of(w, uv_fs_t, work_req); in uv__fs_work()
1701 retry_on_eintr = !(req->fs_type == UV_FS_CLOSE || in uv__fs_work()
1702 req->fs_type == UV_FS_READ); in uv__fs_work()
1712 switch (req->fs_type) { in uv__fs_work()
1713 X(ACCESS, access(req->path, req->flags)); in uv__fs_work()
1714 X(CHMOD, chmod(req->path, req->mode)); in uv__fs_work()
1715 X(CHOWN, chown(req->path, req->uid, req->gid)); in uv__fs_work()
1716 X(CLOSE, uv__fs_close(req->file)); in uv__fs_work()
1717 X(COPYFILE, uv__fs_copyfile(req)); in uv__fs_work()
1718 X(FCHMOD, fchmod(req->file, req->mode)); in uv__fs_work()
1719 X(FCHOWN, fchown(req->file, req->uid, req->gid)); in uv__fs_work()
1720 X(LCHOWN, lchown(req->path, req->uid, req->gid)); in uv__fs_work()
1721 X(FDATASYNC, uv__fs_fdatasync(req)); in uv__fs_work()
1722 X(FSTAT, uv__fs_fstat(req->file, &req->statbuf)); in uv__fs_work()
1723 X(FSYNC, uv__fs_fsync(req)); in uv__fs_work()
1724 X(FTRUNCATE, ftruncate(req->file, req->off)); in uv__fs_work()
1725 X(FUTIME, uv__fs_futime(req)); in uv__fs_work()
1726 X(LUTIME, uv__fs_lutime(req)); in uv__fs_work()
1727 X(LSTAT, uv__fs_lstat(req->path, &req->statbuf)); in uv__fs_work()
1728 X(LINK, link(req->path, req->new_path)); in uv__fs_work()
1729 X(MKDIR, mkdir(req->path, req->mode)); in uv__fs_work()
1730 X(MKDTEMP, uv__fs_mkdtemp(req)); in uv__fs_work()
1731 X(MKSTEMP, uv__fs_mkstemp(req)); in uv__fs_work()
1732 X(OPEN, uv__fs_open(req)); in uv__fs_work()
1733 X(READ, uv__fs_read(req)); in uv__fs_work()
1734 X(SCANDIR, uv__fs_scandir(req)); in uv__fs_work()
1735 X(OPENDIR, uv__fs_opendir(req)); in uv__fs_work()
1736 X(READDIR, uv__fs_readdir(req)); in uv__fs_work()
1737 X(CLOSEDIR, uv__fs_closedir(req)); in uv__fs_work()
1738 X(READLINK, uv__fs_readlink(req)); in uv__fs_work()
1739 X(REALPATH, uv__fs_realpath(req)); in uv__fs_work()
1740 X(RENAME, rename(req->path, req->new_path)); in uv__fs_work()
1741 X(RMDIR, rmdir(req->path)); in uv__fs_work()
1742 X(SENDFILE, uv__fs_sendfile(req)); in uv__fs_work()
1743 X(STAT, uv__fs_stat(req->path, &req->statbuf)); in uv__fs_work()
1744 X(STATFS, uv__fs_statfs(req)); in uv__fs_work()
1745 X(SYMLINK, symlink(req->path, req->new_path)); in uv__fs_work()
1746 X(UNLINK, unlink(req->path)); in uv__fs_work()
1747 X(UTIME, uv__fs_utime(req)); in uv__fs_work()
1748 X(WRITE, uv__fs_write_all(req)); in uv__fs_work()
1755 req->result = UV__ERR(errno); in uv__fs_work()
1757 req->result = r; in uv__fs_work()
1759 if (r == 0 && (req->fs_type == UV_FS_STAT || in uv__fs_work()
1760 req->fs_type == UV_FS_FSTAT || in uv__fs_work()
1761 req->fs_type == UV_FS_LSTAT)) { in uv__fs_work()
1762 req->ptr = &req->statbuf; in uv__fs_work()
1768 uv_fs_t* req; in uv__fs_done() local
1770 req = container_of(w, uv_fs_t, work_req); in uv__fs_done()
1771 uv__req_unregister(req->loop); in uv__fs_done()
1774 assert(req->result == 0); in uv__fs_done()
1775 req->result = UV_ECANCELED; in uv__fs_done()
1778 req->cb(req); in uv__fs_done()
1782 void uv__fs_post(uv_loop_t* loop, uv_fs_t* req) { in uv__fs_post() argument
1785 &req->work_req, in uv__fs_post()
1793 uv_fs_t* req, in uv_fs_access() argument
1799 req->flags = flags; in uv_fs_access()
1805 uv_fs_t* req, in uv_fs_chmod() argument
1811 req->mode = mode; in uv_fs_chmod()
1817 uv_fs_t* req, in uv_fs_chown() argument
1824 req->uid = uid; in uv_fs_chown()
1825 req->gid = gid; in uv_fs_chown()
1830 int uv_fs_close(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { in uv_fs_close() argument
1832 req->file = file; in uv_fs_close()
1834 if (uv__iou_fs_close(loop, req)) in uv_fs_close()
1841 uv_fs_t* req, in uv_fs_fchmod() argument
1846 req->file = file; in uv_fs_fchmod()
1847 req->mode = mode; in uv_fs_fchmod()
1853 uv_fs_t* req, in uv_fs_fchown() argument
1859 req->file = file; in uv_fs_fchown()
1860 req->uid = uid; in uv_fs_fchown()
1861 req->gid = gid; in uv_fs_fchown()
1867 uv_fs_t* req, in uv_fs_lchown() argument
1874 req->uid = uid; in uv_fs_lchown()
1875 req->gid = gid; in uv_fs_lchown()
1880 int uv_fs_fdatasync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { in uv_fs_fdatasync() argument
1882 req->file = file; in uv_fs_fdatasync()
1884 if (uv__iou_fs_fsync_or_fdatasync(loop, req, /* IORING_FSYNC_DATASYNC */ 1)) in uv_fs_fdatasync()
1890 int uv_fs_fstat(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { in uv_fs_fstat() argument
1892 req->file = file; in uv_fs_fstat()
1894 if (uv__iou_fs_statx(loop, req, /* is_fstat */ 1, /* is_lstat */ 0)) in uv_fs_fstat()
1900 int uv_fs_fsync(uv_loop_t* loop, uv_fs_t* req, uv_file file, uv_fs_cb cb) { in uv_fs_fsync() argument
1902 req->file = file; in uv_fs_fsync()
1904 if (uv__iou_fs_fsync_or_fdatasync(loop, req, /* no flags */ 0)) in uv_fs_fsync()
1911 uv_fs_t* req, in uv_fs_ftruncate() argument
1916 req->file = file; in uv_fs_ftruncate()
1917 req->off = off; in uv_fs_ftruncate()
1919 if (uv__iou_fs_ftruncate(loop, req)) in uv_fs_ftruncate()
1926 uv_fs_t* req, in uv_fs_futime() argument
1932 req->file = file; in uv_fs_futime()
1933 req->atime = atime; in uv_fs_futime()
1934 req->mtime = mtime; in uv_fs_futime()
1939 uv_fs_t* req, in uv_fs_lutime() argument
1946 req->atime = atime; in uv_fs_lutime()
1947 req->mtime = mtime; in uv_fs_lutime()
1952 int uv_fs_lstat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { in uv_fs_lstat() argument
1956 if (uv__iou_fs_statx(loop, req, /* is_fstat */ 0, /* is_lstat */ 1)) in uv_fs_lstat()
1963 uv_fs_t* req, in uv_fs_link() argument
1970 if (uv__iou_fs_link(loop, req)) in uv_fs_link()
1977 uv_fs_t* req, in uv_fs_mkdir() argument
1983 req->mode = mode; in uv_fs_mkdir()
1985 if (uv__iou_fs_mkdir(loop, req)) in uv_fs_mkdir()
1992 uv_fs_t* req, in uv_fs_mkdtemp() argument
1996 req->path = uv__strdup(tpl); in uv_fs_mkdtemp()
1997 if (req->path == NULL) in uv_fs_mkdtemp()
2004 uv_fs_t* req, in uv_fs_mkstemp() argument
2008 req->path = uv__strdup(tpl); in uv_fs_mkstemp()
2009 if (req->path == NULL) in uv_fs_mkstemp()
2016 uv_fs_t* req, in uv_fs_open() argument
2023 req->flags = flags; in uv_fs_open()
2024 req->mode = mode; in uv_fs_open()
2026 if (uv__iou_fs_open(loop, req)) in uv_fs_open()
2032 int uv_fs_read(uv_loop_t* loop, uv_fs_t* req, in uv_fs_read() argument
2043 req->off = off; in uv_fs_read()
2044 req->file = file; in uv_fs_read()
2045 req->bufs = (uv_buf_t*) bufs; /* Safe, doesn't mutate |bufs| */ in uv_fs_read()
2046 req->nbufs = nbufs; in uv_fs_read()
2051 req->bufs = req->bufsml; in uv_fs_read()
2052 if (nbufs > ARRAY_SIZE(req->bufsml)) in uv_fs_read()
2053 req->bufs = uv__malloc(nbufs * sizeof(*bufs)); in uv_fs_read()
2055 if (req->bufs == NULL) in uv_fs_read()
2058 memcpy(req->bufs, bufs, nbufs * sizeof(*bufs)); in uv_fs_read()
2060 if (uv__iou_fs_read_or_write(loop, req, /* is_read */ 1)) in uv_fs_read()
2069 uv_fs_t* req, in uv_fs_scandir() argument
2075 req->flags = flags; in uv_fs_scandir()
2080 uv_fs_t* req, in uv_fs_opendir() argument
2089 uv_fs_t* req, in uv_fs_readdir() argument
2097 req->ptr = dir; in uv_fs_readdir()
2102 uv_fs_t* req, in uv_fs_closedir() argument
2110 req->ptr = dir; in uv_fs_closedir()
2115 uv_fs_t* req, in uv_fs_readlink() argument
2125 uv_fs_t* req, in uv_fs_realpath() argument
2135 uv_fs_t* req, in uv_fs_rename() argument
2142 if (uv__iou_fs_rename(loop, req)) in uv_fs_rename()
2148 int uv_fs_rmdir(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { in uv_fs_rmdir() argument
2156 uv_fs_t* req, in uv_fs_sendfile() argument
2163 req->flags = in_fd; /* hack */ in uv_fs_sendfile()
2164 req->file = out_fd; in uv_fs_sendfile()
2165 req->off = off; in uv_fs_sendfile()
2166 req->bufsml[0].len = len; in uv_fs_sendfile()
2171 int uv_fs_stat(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { in uv_fs_stat() argument
2175 if (uv__iou_fs_statx(loop, req, /* is_fstat */ 0, /* is_lstat */ 0)) in uv_fs_stat()
2182 uv_fs_t* req, in uv_fs_symlink() argument
2189 req->flags = flags; in uv_fs_symlink()
2191 if (uv__iou_fs_symlink(loop, req)) in uv_fs_symlink()
2197 int uv_fs_unlink(uv_loop_t* loop, uv_fs_t* req, const char* path, uv_fs_cb cb) { in uv_fs_unlink() argument
2201 if (uv__iou_fs_unlink(loop, req)) in uv_fs_unlink()
2208 uv_fs_t* req, in uv_fs_utime() argument
2215 req->atime = atime; in uv_fs_utime()
2216 req->mtime = mtime; in uv_fs_utime()
2222 uv_fs_t* req, in uv_fs_write() argument
2233 req->file = file; in uv_fs_write()
2235 req->nbufs = nbufs; in uv_fs_write()
2236 req->bufs = req->bufsml; in uv_fs_write()
2237 if (nbufs > ARRAY_SIZE(req->bufsml)) in uv_fs_write()
2238 req->bufs = uv__malloc(nbufs * sizeof(*bufs)); in uv_fs_write()
2240 if (req->bufs == NULL) in uv_fs_write()
2243 memcpy(req->bufs, bufs, nbufs * sizeof(*bufs)); in uv_fs_write()
2245 req->off = off; in uv_fs_write()
2248 if (uv__iou_fs_read_or_write(loop, req, /* is_read */ 0)) in uv_fs_write()
2255 void uv_fs_req_cleanup(uv_fs_t* req) { in uv_fs_req_cleanup() argument
2256 if (req == NULL) in uv_fs_req_cleanup()
2264 if (req->path != NULL && in uv_fs_req_cleanup()
2265 (req->cb != NULL || in uv_fs_req_cleanup()
2266 req->fs_type == UV_FS_MKDTEMP || req->fs_type == UV_FS_MKSTEMP)) in uv_fs_req_cleanup()
2267 uv__free((void*) req->path); /* Memory is shared with req->new_path. */ in uv_fs_req_cleanup()
2269 req->path = NULL; in uv_fs_req_cleanup()
2270 req->new_path = NULL; in uv_fs_req_cleanup()
2272 if (req->fs_type == UV_FS_READDIR && req->ptr != NULL) in uv_fs_req_cleanup()
2273 uv__fs_readdir_cleanup(req); in uv_fs_req_cleanup()
2275 if (req->fs_type == UV_FS_SCANDIR && req->ptr != NULL) in uv_fs_req_cleanup()
2276 uv__fs_scandir_cleanup(req); in uv_fs_req_cleanup()
2278 if (req->bufs != req->bufsml) in uv_fs_req_cleanup()
2279 uv__free(req->bufs); in uv_fs_req_cleanup()
2280 req->bufs = NULL; in uv_fs_req_cleanup()
2282 if (req->fs_type != UV_FS_OPENDIR && req->ptr != &req->statbuf) in uv_fs_req_cleanup()
2283 uv__free(req->ptr); in uv_fs_req_cleanup()
2284 req->ptr = NULL; in uv_fs_req_cleanup()
2289 uv_fs_t* req, in uv_fs_copyfile() argument
2303 req->flags = flags; in uv_fs_copyfile()
2309 uv_fs_t* req, in uv_fs_statfs() argument
2317 int uv_fs_get_system_error(const uv_fs_t* req) { in uv_fs_get_system_error() argument
2318 return -req->result; in uv_fs_get_system_error()