Lines Matching refs:fs

28 struct fs {  struct
41 static struct fs fs__entries[] = { argument
54 static bool fs__read_mounts(struct fs *fs) in fs__read_mounts() argument
66 fs->path, type) == 2) { in fs__read_mounts()
68 if (strcmp(type, fs->name) == 0) in fs__read_mounts()
73 return fs->found = found; in fs__read_mounts()
76 static int fs__valid_mount(const char *fs, long magic) in fs__valid_mount() argument
80 if (statfs(fs, &st_fs) < 0) in fs__valid_mount()
88 static bool fs__check_mounts(struct fs *fs) in fs__check_mounts() argument
92 ptr = fs->mounts; in fs__check_mounts()
94 if (fs__valid_mount(*ptr, fs->magic) == 0) { in fs__check_mounts()
95 fs->found = true; in fs__check_mounts()
96 strcpy(fs->path, *ptr); in fs__check_mounts()
119 static bool fs__env_override(struct fs *fs) in fs__env_override() argument
122 size_t name_len = strlen(fs->name); in fs__env_override()
125 memcpy(upper_name, fs->name, name_len); in fs__env_override()
133 fs->found = true; in fs__env_override()
134 strncpy(fs->path, override_path, sizeof(fs->path)); in fs__env_override()
138 static const char *fs__get_mountpoint(struct fs *fs) in fs__get_mountpoint() argument
140 if (fs__env_override(fs)) in fs__get_mountpoint()
141 return fs->path; in fs__get_mountpoint()
143 if (fs__check_mounts(fs)) in fs__get_mountpoint()
144 return fs->path; in fs__get_mountpoint()
146 if (fs__read_mounts(fs)) in fs__get_mountpoint()
147 return fs->path; in fs__get_mountpoint()
154 struct fs *fs = &fs__entries[idx]; in fs__mountpoint() local
156 if (fs->found) in fs__mountpoint()
157 return (const char *)fs->path; in fs__mountpoint()
159 return fs__get_mountpoint(fs); in fs__mountpoint()