Vfs_statfs for Kernel File System API, kernel apivfs_statfs

Source: Internet
Author: User

Vfs_statfs for Kernel File System API, kernel apivfs_statfs

Kernel File System API-vfs_statfs

Int vfs_statfs (const struct path * path, struct kstatfs * buf) is used to return the results returned by the mount point of the file indicated by the path parameter and the valid flags of the super block. The structure is as follows: struct kstatfs {long f_type; long f_bsize; u64 f_blocks; u64 f_bfree; u64 f_bavail; u64 f_files; u64 f_ffree ;__ kernel_fsid_t f_fsid; long f_namelen; long f_frsize; long f_flags; long f_spare [4];}; source code analysis: int vfs_statfs (const struct path * path, struct kstatfs * buf) {int error; # Check pat Whether the dentry corresponding to h has errorerror = statfs_by_dentry (path-> dentry, buf); if (! Error) # If no error exists, the effective flagsbuf-> f_flags = calculate_f_flags (path-> mnt); return error;} of the mount point and super block are returned ;} the following function clearly shows that effective flagsstatic int calculate_f_flags (struct vfsmount * mnt) {return ST_VALID | flags_by_mnt (mnt-> mnt_flags) of mnt and super blocks are returned) | flags_by_sb (mnt-> mnt_sb-> s_flags );}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.