Lines Matching refs:file
133 offset = c->file.start + c->offset; in network_write_chunkqueue_linuxsendfile()
134 toSend = c->file.length - c->offset; in network_write_chunkqueue_linuxsendfile()
138 if (-1 == c->file.fd) { in network_write_chunkqueue_linuxsendfile()
139 if (-1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) { in network_write_chunkqueue_linuxsendfile()
145 fcntl(c->file.fd, F_SETFD, FD_CLOEXEC); in network_write_chunkqueue_linuxsendfile()
149 if (-1 == posix_fadvise(c->file.fd, 0, 0, POSIX_FADV_SEQUENTIAL)) { in network_write_chunkqueue_linuxsendfile()
152 "posix_fadvise failed:", strerror(errno), c->file.fd); in network_write_chunkqueue_linuxsendfile()
158 if (-1 == (r = sendfile(fd, c->file.fd, &offset, toSend))) { in network_write_chunkqueue_linuxsendfile()
180 if (HANDLER_ERROR == stat_cache_get_entry(srv, con, c->file.name, &sce)) { in network_write_chunkqueue_linuxsendfile()
204 …if (-1 == posix_fadvise(c->file.fd, (c->offset + r) & ~(READ_AHEAD - 1), READ_AHEAD, POSIX_FADV_NO… in network_write_chunkqueue_linuxsendfile()
206 "posix_fadvise failed:", strerror(errno), c->file.fd); in network_write_chunkqueue_linuxsendfile()
216 if (c->offset == c->file.length) { in network_write_chunkqueue_linuxsendfile()
221 if (c->file.fd != -1) { in network_write_chunkqueue_linuxsendfile()
222 close(c->file.fd); in network_write_chunkqueue_linuxsendfile()
223 c->file.fd = -1; in network_write_chunkqueue_linuxsendfile()