starnix_types/vfs.rs
1// Copyright 2024 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use super::PAGE_SIZE;
6
7use starnix_uapi::uapi;
8
9pub fn default_statfs(magic: u32) -> uapi::statfs {
10 uapi::statfs {
11 f_type: magic as i64,
12 f_bsize: *PAGE_SIZE as i64,
13 f_blocks: 0,
14 f_bfree: 0,
15 f_bavail: 0,
16 f_files: 0,
17 f_ffree: 0,
18 f_fsid: uapi::__kernel_fsid_t::default(),
19 f_namelen: uapi::NAME_MAX as i64,
20 f_frsize: *PAGE_SIZE as i64,
21 f_flags: 0,
22 f_spare: [0, 0, 0, 0],
23 }
24}