• Home
  • Raw
  • Download

Lines Matching refs:fd

41 int stat_file(const char *path, struct hostfs_stat *p, int fd)  in stat_file()  argument
45 if (fd >= 0) { in stat_file()
46 if (fstat64(fd, &buf) < 0) in stat_file()
72 int mode = 0, fd; in open_file() local
84 fd = open64(path, mode); in open_file()
85 if (fd < 0) in open_file()
87 else return fd; in open_file()
124 int read_file(int fd, unsigned long long *offset, char *buf, int len) in read_file() argument
128 n = pread64(fd, buf, len, *offset); in read_file()
135 int write_file(int fd, unsigned long long *offset, const char *buf, int len) in write_file() argument
139 n = pwrite64(fd, buf, len, *offset); in write_file()
146 int lseek_file(int fd, long long offset, int whence) in lseek_file() argument
150 ret = lseek64(fd, offset, whence); in lseek_file()
156 int fsync_file(int fd, int datasync) in fsync_file() argument
160 ret = fdatasync(fd); in fsync_file()
162 ret = fsync(fd); in fsync_file()
169 int replace_file(int oldfd, int fd) in replace_file() argument
171 return dup2(oldfd, fd); in replace_file()
186 int fd; in file_create() local
188 fd = open64(name, O_CREAT | O_RDWR, mode); in file_create()
189 if (fd < 0) in file_create()
191 return fd; in file_create()
194 int set_attr(const char *file, struct hostfs_iattr *attrs, int fd) in set_attr() argument
201 if (fd >= 0) { in set_attr()
202 if (fchmod(fd, attrs->ia_mode) != 0) in set_attr()
209 if (fd >= 0) { in set_attr()
210 if (fchown(fd, attrs->ia_uid, -1)) in set_attr()
217 if (fd >= 0) { in set_attr()
218 if (fchown(fd, -1, attrs->ia_gid)) in set_attr()
225 if (fd >= 0) { in set_attr()
226 if (ftruncate(fd, attrs->ia_size)) in set_attr()
240 err = stat_file(file, &st, fd); in set_attr()
258 if (fd >= 0) { in set_attr()
259 if (futimes(fd, times) != 0) in set_attr()
268 err = stat_file(file, &st, fd); in set_attr()