Chinaunix首页 | 论坛 | 博客
  • 博客访问: 75632
  • 博文数量: 172
  • 博客积分: 2047
  • 博客等级: 大尉
  • 技术积分: 1745
  • 用 户 组: 普通用户
  • 注册时间: 2010-05-19 15:23
文章分类

全部博文(172)

文章存档

2011年(72)

2010年(100)

我的朋友

分类: LINUX

2010-05-20 10:09:28

struct super_block {
    struct list_head    s_list;        /* Keep this first */
    dev_t            s_dev;        /* search index; _not_ kdev_t */
    unsigned long        s_blocksize;
    unsigned char        s_blocksize_bits;
    unsigned char        s_dirt;
    loff_t            s_maxbytes;    /* Max file size */
    struct file_system_type    *s_type;
    const struct super_operations    *s_op;
    const struct dquot_operations    *dq_op;
    const struct quotactl_ops    *s_qcop;
    const struct export_operations *s_export_op;
    unsigned long        s_flags;
    unsigned long        s_magic;
    struct dentry        *s_root;
    struct rw_semaphore    s_umount;
    struct mutex        s_lock;
    int            s_count;
    int            s_need_sync;
    atomic_t        s_active;
#ifdef CONFIG_SECURITY
    void *s_security;
#endif
    struct xattr_handler    **s_xattr;

    struct list_head    s_inodes;    /* all inodes */
    struct hlist_head    s_anon;        /* anonymous dentries for (nfs) exporting */
    struct list_head    s_files;
    /* s_dentry_lru and s_nr_dentry_unused are protected by dcache_lock */
    struct list_head    s_dentry_lru;    /* unused dentry lru */
    int            s_nr_dentry_unused;    /* # of dentry on lru */

    struct block_device    *s_bdev;
    struct backing_dev_info *s_bdi;
    struct mtd_info        *s_mtd;
    struct list_head    s_instances;
    struct quota_info    s_dquot;    /* Diskquota specific options */

    int            s_frozen;
    wait_queue_head_t    s_wait_unfrozen;

    char s_id[32];                /* Informational name */

    void             *s_fs_info;    /* Filesystem private info */
    fmode_t            s_mode;

    /*
     * The next field is for VFS *only*. No filesystems have any business
     * even looking at it. You had been warned.
     */

    struct mutex s_vfs_rename_mutex;    /* Kludge */

    /* Granularity of c/m/atime in ns.
     Cannot be worse than a second */

    u32         s_time_gran;

    /*
     * Filesystem subtype. If non-empty the filesystem type field
     * in /proc/mounts will be "type.subtype"
     */

    char *s_subtype;

    /*
     * Saved mount options for lazy filesystems using
     * generic_show_options()
     */

    char *s_options;
};




struct super_operations {
       struct inode *(*alloc_inode)(struct super_block *sb);
    void (*destroy_inode)(struct inode *);

       void (*dirty_inode) (struct inode *);
    int (*write_inode) (struct inode *, int);
    void (*drop_inode) (struct inode *);
    void (*delete_inode) (struct inode *);
    void (*put_super) (struct super_block *);
    void (*write_super) (struct super_block *);
    int (*sync_fs)(struct super_block *sb, int wait);
    int (*freeze_fs) (struct super_block *);
    int (*unfreeze_fs) (struct super_block *);
    int (*statfs) (struct dentry *, struct kstatfs *);
    int (*remount_fs) (struct super_block *, int *, char *);
    void (*clear_inode) (struct inode *);
    void (*umount_begin) (struct super_block *);

    int (*show_options)(struct seq_file *, struct vfsmount *);
    int (*show_stats)(struct seq_file *, struct vfsmount *);
#ifdef CONFIG_QUOTA
    ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t);
    ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
#endif
    int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
};


阅读(697) | 评论(0) | 转发(0) |
0

上一篇:vfs file

下一篇:vfs lock

给主人留下些什么吧!~~