Lines Matching refs:buf

21 static void statx_to_hostfs(const struct statx *buf, struct hostfs_stat *p)  in statx_to_hostfs()  argument
23 p->ino = buf->stx_ino; in statx_to_hostfs()
24 p->mode = buf->stx_mode; in statx_to_hostfs()
25 p->nlink = buf->stx_nlink; in statx_to_hostfs()
26 p->uid = buf->stx_uid; in statx_to_hostfs()
27 p->gid = buf->stx_gid; in statx_to_hostfs()
28 p->size = buf->stx_size; in statx_to_hostfs()
29 p->atime.tv_sec = buf->stx_atime.tv_sec; in statx_to_hostfs()
30 p->atime.tv_nsec = buf->stx_atime.tv_nsec; in statx_to_hostfs()
31 p->ctime.tv_sec = buf->stx_ctime.tv_sec; in statx_to_hostfs()
32 p->ctime.tv_nsec = buf->stx_ctime.tv_nsec; in statx_to_hostfs()
33 p->mtime.tv_sec = buf->stx_mtime.tv_sec; in statx_to_hostfs()
34 p->mtime.tv_nsec = buf->stx_mtime.tv_nsec; in statx_to_hostfs()
35 if (buf->stx_mask & STATX_BTIME) { in statx_to_hostfs()
36 p->btime.tv_sec = buf->stx_btime.tv_sec; in statx_to_hostfs()
37 p->btime.tv_nsec = buf->stx_btime.tv_nsec; in statx_to_hostfs()
41 p->blksize = buf->stx_blksize; in statx_to_hostfs()
42 p->blocks = buf->stx_blocks; in statx_to_hostfs()
43 p->rdev.maj = buf->stx_rdev_major; in statx_to_hostfs()
44 p->rdev.min = buf->stx_rdev_minor; in statx_to_hostfs()
45 p->dev.maj = buf->stx_dev_major; in statx_to_hostfs()
46 p->dev.min = buf->stx_dev_minor; in statx_to_hostfs()
51 struct statx buf; in stat_file() local
59 if ((statx(fd, path, flags, STATX_BASIC_STATS | STATX_BTIME, &buf)) < 0) in stat_file()
62 statx_to_hostfs(&buf, p); in stat_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()
348 int hostfs_do_readlink(char *file, char *buf, int size) in hostfs_do_readlink() argument
352 n = readlink(file, buf, size); in hostfs_do_readlink()
356 buf[n] = '\0'; in hostfs_do_readlink()
402 struct statfs64 buf; in do_statfs() local
405 err = statfs64(root, &buf); in do_statfs()
409 *bsize_out = buf.f_bsize; in do_statfs()
410 *blocks_out = buf.f_blocks; in do_statfs()
411 *bfree_out = buf.f_bfree; in do_statfs()
412 *bavail_out = buf.f_bavail; in do_statfs()
413 *files_out = buf.f_files; in do_statfs()
414 *ffree_out = buf.f_ffree; in do_statfs()
415 memcpy(fsid_out, &buf.f_fsid, in do_statfs()
416 sizeof(buf.f_fsid) > fsid_size ? fsid_size : in do_statfs()
417 sizeof(buf.f_fsid)); in do_statfs()
418 *namelen_out = buf.f_namelen; in do_statfs()