Lines Matching refs:fd

49 int stat_file(const char *path, struct hostfs_stat *p, int fd)  in stat_file()  argument
54 if (fd >= 0) { in stat_file()
59 if ((statx(fd, path, flags, STATX_BASIC_STATS | STATX_BTIME, &buf)) < 0) in stat_file()
83 int mode = 0, fd; in open_file() local
95 fd = open64(path, mode); in open_file()
96 if (fd < 0) in open_file()
98 else return fd; in open_file()
135 int read_file(int fd, unsigned long long *offset, char *buf, int len) in read_file() argument
139 n = pread64(fd, buf, len, *offset); in read_file()
146 int write_file(int fd, unsigned long long *offset, const char *buf, int len) in write_file() argument
150 n = pwrite64(fd, buf, len, *offset); in write_file()
157 int lseek_file(int fd, long long offset, int whence) in lseek_file() argument
161 ret = lseek64(fd, offset, whence); in lseek_file()
167 int fsync_file(int fd, int datasync) in fsync_file() argument
171 ret = fdatasync(fd); in fsync_file()
173 ret = fsync(fd); in fsync_file()
180 int replace_file(int oldfd, int fd) in replace_file() argument
182 return dup2(oldfd, fd); in replace_file()
197 int fd; in file_create() local
199 fd = open64(name, O_CREAT | O_RDWR, mode); in file_create()
200 if (fd < 0) in file_create()
202 return fd; in file_create()
205 int set_attr(const char *file, struct hostfs_iattr *attrs, int fd) in set_attr() argument
212 if (fd >= 0) { in set_attr()
213 if (fchmod(fd, attrs->ia_mode) != 0) in set_attr()
220 if (fd >= 0) { in set_attr()
221 if (fchown(fd, attrs->ia_uid, -1)) in set_attr()
228 if (fd >= 0) { in set_attr()
229 if (fchown(fd, -1, attrs->ia_gid)) in set_attr()
236 if (fd >= 0) { in set_attr()
237 if (ftruncate(fd, attrs->ia_size)) in set_attr()
251 err = stat_file(file, &st, fd); in set_attr()
269 if (fd >= 0) { in set_attr()
270 if (futimes(fd, times) != 0) in set_attr()
279 err = stat_file(file, &st, fd); in set_attr()