Modify the size of the internal storage of the rom system in Android 11.0 kernel

1 Introduction

 In the 11.0 system rom product development and customization, in terms of the requirements for some product hardware configuration requirements, because some products are exported in the follow-up orders of the products, but the hardware has been fixed, the time is relatively short, so it is
necessary The software cheats on the size of the internal storage of the rom and modifies the real size and capacity of the rom. Therefore, it is best to modify the value of this part in the kenel driver. Next, analyze the relevant codes for calculating the rom capacity, and then make modifications
.

2. The core class that modifies the size of the internal storage of the rom system in kenel

    kernel\kernel4.14\fs\statfs.c
    kernel/kernel4.14/include/linux/statfs.h

3. Core function analysis and implementation of modifying the size of rom system internal storage in
kenel 3.1 Analysis of related rom parameters in statfs.h

   /* SPDX-License-Identifier: GPL-2.0 */
    #ifndef _LINUX_STATFS_H
    #define _LINUX_STATFS_H
     
    #include <linux/types.h>
    #include <asm/statfs.h>
     
    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

Guess you like

Origin blog.csdn.net/baidu_41666295/article/details/131114588