zoukankan      html  css  js  c++  java
  • Linux 超级块

    Linux 超级块的结构

     1 //come from /usr/src/kernel/'uname –r'/include/linux/fs.h 
     2 struct super_block { 
     3         struct list_head s_list; /* Keep this first */ 
     4         dev_t s_dev;                                 /* search index; _not_ kdev_t */ 
     5         unsigned long s_blocksize;                     //数据块大小 
     6         unsigned char s_blocksize_bits;             //块大小占用的位数 
     7         unsigned char s_dirt;                         //脏位,如果该位置位,说明超级块被修改 
     8         unsigned long long s_maxbytes;                //单个文件最大体积 
     9         struct file_system_type *s_type;             //文件系统结构 
    10         struct super_operations *s_op;                 //超级块支持的操作
    11         struct dquot_operations *dq_op;             //
    12         struct quotactl_ops *s_qcop;                 //用户配额限制
    13         struct export_operations *s_export_op;        //
    14 
    15         unsigned longs_flags; 
    16         unsigned long s_magic;                         //区块的magic数
    17         struct dentry *s_root;                         //根目录
    18         struct rw_semaphore s_umount;                 //
    19         struct mutex s_lock;                         //
    20         int s_count;                                 //
    21         int s_syncing;                                 //
    22         int s_need_sync_fs;                         //
    23         atomic_t s_active;                             //是否活动
    24         void *s_security;                             //
    25         struct xattr_handler **s_xattr;                //
    26 
    27         struct list_head s_inodes;                    //所有inode 
    28         struct list_head s_dirty;                     //脏inode 
    29         struct list_head s_io;                        //用于写回的缓存 
    30         struct hlist_head s_anon;                     //nfs匿名入口 
    31         struct list_head s_files;                    //文件链表头
    32 
    33         struct block_device *s_bdev; 
    34         struct list_head s_instances; 
    35         struct quota_info s_dquot;                     //配额定制选项
    36 
    37         int s_frozen;                     
    38         wait_queue_head_t s_wait_unfrozen;
    39 
    40         char s_id[32];                                //名字
    41 
    42         void *s_fs_info; /* Filesystem private info */ 
    43         /** The next field is for VFS *only*. No filesystems have any business 
    44         * even looking at it. You had been warned. */ 
    45         struct mutex s_vfs_rename_mutex; /* Kludge */ 
    46         /* Granularity of c/m/atime in ns. Cannot be worse than a second */ 
    47         u32 s_time_gran; 
    48 };
  • 相关阅读:
    30 algorithm questions study
    Binary Tree: Write a function to return count of nodes in binary tree which has only one child.
    分布式排序
    android开发中,工程前面有感叹号的解决办法
    android导入工程出现红色感叹号
    INSTALL_FAILED_MISSING_SHARED_LIBRARY错误解决方法
    安卓手机铃声怎么设置
    如何开启Mysql远程访问
    android 链接mysql数据库
    android 连接mysql数据库问题
  • 原文地址:https://www.cnblogs.com/Lifehacker/p/Linux_superblock_structure.html
Copyright © 2011-2022 走看看