[so2] Tema 4 - Driver de sistem de fișiere - superbloc

Daniel Baluta daniel.baluta at gmail.com
Thu Apr 26 13:02:58 EEST 2012


2012/4/26 Cristian Bercaru <cristianbercaru.of at gmail.com>:
> Salut!
>
> In laboratorul 9 scrie ca un superbloc are structura
>
> struct super_block {
>        //...
>        dev_t                   s_dev;              /* identifier */
>        unsigned long           s_blocksize;        /* block size in bytes */
>        unsigned char           s_blocksize_bits;   /* block size in bits */
>        unsigned char           s_dirt;             /* dirty flag */
>        unsigned long long      s_maxbytes;         /* max file size */
>        struct file_system_type *s_type;            /* filesystem type */
>        struct super_operations *s_op;              /* superblock methods */
>        //...
>        unsigned long           s_flags;            /* mount flags */
>        unsigned long           s_magic;            /* filesystem's
> magic number */
>        struct dentry           *s_root;            /* directory mount point */
>        //...
>        char                    s_id[32];           /* informational name */
>        void                    *s_fs_info;         /* filesystem
> private info */
> };
>
> In enuntul temei 4, superblocul are structura:

+ Structura superblocului (pe disc) este descrisă de următoarea structură:

>
> struct pitix_super_block {
>        unsigned long magic;
>        __u8 version;
>        __u8 inode_data_blocks;
>        __u8 block_size_bits;
>        __u8 imap_block;
>        __u8 dmap_block;
>        __u8 izone_block;
>        __u8 dzone_block;
>        __u16 bfree;
>        __u16 ffree;
> //...
> }
>
> Asta inseamna ca trebuie sa-mi scriu propriile functii 'get_sb_bdev'
> si 'kill_block_super'?
> Daca da, atunci structura 'pitix_super_block' nu ar trebui sa contina
> si un camp numit 's_fs_info' de tipul 'pitix_sb_info' ?

thanks,
Daniel


More information about the so2 mailing list