Lines Matching refs:fd
27 int fd; member
68 rmtfds[i].fd = -1; in storage_init()
84 int fd; in storage_open() local
98 if ((rmtfds[i].fd != -1 || rmtfds[i].shadow_buf) && in storage_open()
105 if (rmtfds[i].fd == -1 && !rmtfds[i].shadow_buf) { in storage_open()
124 fd = open(fspath, O_RDWR); in storage_open()
125 if (fd < 0) { in storage_open()
132 rmtfd->fd = fd; in storage_open()
153 close(rmtfd->fd); in storage_close()
154 rmtfd->fd = -1; in storage_close()
192 if (rmtfds[i].fd >= 0) in storage_exit()
193 close(rmtfds[i].fd); in storage_exit()
202 n = pread(rmtfd->fd, buf, nbyte, offset); in storage_pread()
223 return pwrite(rmtfd->fd, buf, nbyte, offset); in storage_pwrite()
253 int fd; in storage_populate_shadow_buf() local
255 fd = open(file, O_RDONLY); in storage_populate_shadow_buf()
256 if (fd < 0) in storage_populate_shadow_buf()
259 len = lseek(fd, 0, SEEK_END); in storage_populate_shadow_buf()
265 lseek(fd, 0, SEEK_SET); in storage_populate_shadow_buf()
273 n = read(fd, buf, len); in storage_populate_shadow_buf()
285 close(fd); in storage_populate_shadow_buf()