Ignore:
Timestamp:
2012-05-03T17:32:06Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2226cc3
Parents:
e40ece98
Message:

added TODOs for comments and first part of superblock comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ext4/libext4_superblock.c

    re40ece98 r9fc72fb3  
    4242#include "libext4.h"
    4343
     44/** Get number of i-nodes in the whole filesystem.
     45 *
     46 * @param sb            superblock
     47 * @return                      number of i-nodes
     48 */
    4449uint32_t ext4_superblock_get_inodes_count(ext4_superblock_t *sb)
    4550{
     
    4752}
    4853
     54/** Set number of i-nodes in the whole filesystem.
     55 *
     56 * @param sb            superblock
     57 * @param count         number of i-nodes
     58 */
    4959void ext4_superblock_set_inodes_count(ext4_superblock_t *sb, uint32_t count)
    5060{
     
    5262}
    5363
     64/** Get number of data blocks in the whole filesystem.
     65 *
     66 * @param sb            superblock
     67 * @return                      number of data blocks
     68 */
    5469uint64_t ext4_superblock_get_blocks_count(ext4_superblock_t *sb)
    5570{
     
    5873}
    5974
     75/** Set number of data blocks in the whole filesystem.
     76 *
     77 * @param sb            superblock
     78 * @param count         number of data blocks
     79 */
    6080void ext4_superblock_set_blocks_count(ext4_superblock_t *sb, uint64_t count)
    6181{
     
    6484}
    6585
     86/** Get number of reserved data blocks in the whole filesystem.
     87 *
     88 * @param sb            superblock
     89 * @return                      number of reserved data blocks
     90 */
    6691uint64_t ext4_superblock_get_reserved_blocks_count(ext4_superblock_t *sb)
    6792{
     
    7095}
    7196
     97/** Set number of reserved data blocks in the whole filesystem.
     98 *
     99 * @param sb            superblock
     100 * @param count         number of reserved data blocks
     101 */
    72102void ext4_superblock_set_reserved_blocks_count(ext4_superblock_t *sb, uint64_t count)
    73103{
     
    76106}
    77107
     108/** Get number of free data blocks in the whole filesystem.
     109 *
     110 * @param sb            superblock
     111 * @return                      number of free data blocks
     112 */
    78113uint64_t ext4_superblock_get_free_blocks_count(ext4_superblock_t *sb)
    79114{
     
    82117}
    83118
     119/** Set number of free data blocks in the whole filesystem.
     120 *
     121 * @param sb            superblock
     122 * @param count         number of free data blocks
     123 */
    84124void ext4_superblock_set_free_blocks_count(ext4_superblock_t *sb, uint64_t count)
    85125{
     
    88128}
    89129
     130/** Get number of free i-nodes in the whole filesystem.
     131 *
     132 * @param sb            superblock
     133 * @return                      number of free i-nodes
     134 */
    90135uint32_t ext4_superblock_get_free_inodes_count(ext4_superblock_t *sb)
    91136{
     
    93138}
    94139
     140/** Set number of free i-nodes in the whole filesystem.
     141 *
     142 * @param sb            superblock
     143 * @param count         number of free i-nodes
     144 */
    95145void ext4_superblock_set_free_inodes_count(ext4_superblock_t *sb, uint32_t count)
    96146{
     
    98148}
    99149
     150/** Get index of first data block (block, where is located superblock)
     151 *
     152 * @param sb            superblock
     153 * @return                      index of the first data block
     154 */
    100155uint32_t ext4_superblock_get_first_data_block(ext4_superblock_t *sb)
    101156{
     
    103158}
    104159
     160/** Set index of first data block (block, where is located superblock)
     161 *
     162 * @param sb            superblock
     163 * @param first         index of the first data block
     164 */
    105165void ext4_superblock_set_first_data_block(ext4_superblock_t *sb, uint32_t first)
    106166{
     
    108168}
    109169
     170/** Get logarithmic block size (1024 << size == block_size)
     171 *
     172 * @param sb            superblock
     173 * @return                      logarithmic block size
     174 */
    110175uint32_t ext4_superblock_get_log_block_size(ext4_superblock_t *sb)
    111176{
     
    113178}
    114179
     180/** Set logarithmic block size (1024 << size == block_size)
     181 *
     182 * @param sb            superblock
     183 * @return                      logarithmic block size
     184 */
    115185void ext4_superblock_set_log_block_size(ext4_superblock_t *sb, uint32_t log_size)
    116186{
     
    118188}
    119189
     190/** Get size of data block (in bytes).
     191 *
     192 * @param sb            superblock
     193 * @return                      size of data block
     194 */
    120195uint32_t ext4_superblock_get_block_size(ext4_superblock_t *sb)
    121196{
     
    123198}
    124199
     200/** Set size of data block (in bytes).
     201 *
     202 * @param sb            superblock
     203 * @param size          size of data block (must be power of 2, at least 1024)
     204 */
    125205void ext4_superblock_set_block_size(ext4_superblock_t *sb, uint32_t size)
    126206{
     
    137217}
    138218
     219/** Get number of data blocks per block group (except last BG)
     220 *
     221 * @param sb            superblock
     222 * @return                      data blocks per block group
     223 */
    139224uint32_t ext4_superblock_get_blocks_per_group(ext4_superblock_t *sb)
    140225{
     
    142227}
    143228
     229/** Set number of data blocks per block group (except last BG)
     230 *
     231 * @param sb            superblock
     232 * @param blocks        data blocks per block group
     233 */
    144234void ext4_superblock_set_blocks_per_group(ext4_superblock_t *sb, uint32_t blocks)
    145235{
     
    147237}
    148238
     239/** Get number of i-nodes per block group (except last BG)
     240 *
     241 * @param sb            superblock
     242 * @return                      i-nodes per block group
     243 */
    149244uint32_t ext4_superblock_get_inodes_per_group(ext4_superblock_t *sb)
    150245{
     
    152247}
    153248
     249/** Set number of i-nodes per block group (except last BG)
     250 *
     251 * @param sb            superblock
     252 * @param inodes        i-nodes per block group
     253 */
    154254void ext4_superblock_set_inodes_per_group(ext4_superblock_t *sb, uint32_t inodes)
    155255{
     
    157257}
    158258
     259/** Get time when filesystem was mounted (POSIX time).
     260 *
     261 * @param sb            superblock
     262 * @return                      mount time
     263 */
    159264uint32_t ext4_superblock_get_mount_time(ext4_superblock_t *sb)
    160265{
     
    162267}
    163268
     269/** Set time when filesystem was mounted (POSIX time).
     270 *
     271 * @param sb            superblock
     272 * @param time          mount time
     273 */
    164274void ext4_superblock_set_mount_time(ext4_superblock_t *sb, uint32_t time)
    165275{
     
    167277}
    168278
     279/** Get time when filesystem was last accesed by write operation (POSIX time).
     280 *
     281 * @param sb            superblock
     282 * @return                      write time
     283 */
    169284uint32_t ext4_superblock_get_write_time(ext4_superblock_t *sb)
    170285{
     
    172287}
    173288
     289/** Set time when filesystem was last accesed by write operation (POSIX time).
     290 *
     291 * @param sb            superblock
     292 * @param time          write time
     293 */
    174294void ext4_superblock_set_write_time(ext4_superblock_t *sb, uint32_t time)
    175295{
     
    177297}
    178298
     299/** Get number of mount from last filesystem check.
     300 *
     301 * @param sb            superblock
     302 * @return                      number of mounts
     303 */
    179304uint16_t ext4_superblock_get_mount_count(ext4_superblock_t *sb)
    180305{
     
    182307}
    183308
     309/** Set number of mount from last filesystem check.
     310 *
     311 * @param sb            superblock
     312 * @param count         number of mounts
     313 */
    184314void ext4_superblock_set_mount_count(ext4_superblock_t *sb, uint16_t count)
    185315{
     
    187317}
    188318
     319/** Get maximum number of mount from last filesystem check.
     320 *
     321 * @param sb            superblock
     322 * @return                      maximum number of mounts
     323 */
    189324uint16_t ext4_superblock_get_max_mount_count(ext4_superblock_t *sb)
    190325{
     
    192327}
    193328
     329/** Set maximum number of mount from last filesystem check.
     330 *
     331 * @param sb            superblock
     332 * @param count         maximum number of mounts
     333 */
    194334void ext4_superblock_set_max_mount_count(ext4_superblock_t *sb, uint16_t count)
    195335{
     
    197337}
    198338
     339/** Get superblock magic value.
     340 *
     341 * @param sb            superblock
     342 * @return                      magic value
     343 */
    199344uint16_t ext4_superblock_get_magic(ext4_superblock_t *sb)
    200345{
     
    202347}
    203348
     349/** Set superblock magic value.
     350 *
     351 * @param sb            superblock
     352 * @param                       magic value
     353 */
     354void ext4_superblock_set_magic(ext4_superblock_t *sb, uint16_t magic)
     355{
     356        sb->magic = host2uint16_t_le(magic);
     357}
     358
     359/** TODO comment
     360 *
     361 */
    204362uint16_t ext4_superblock_get_state(ext4_superblock_t *sb)
    205363{
     
    207365}
    208366
     367/** TODO comment
     368 *
     369 */
    209370void ext4_superblock_set_state(ext4_superblock_t *sb, uint16_t state)
    210371{
     
    212373}
    213374
     375/** TODO comment
     376 *
     377 */
    214378uint16_t ext4_superblock_get_errors(ext4_superblock_t *sb)
    215379{
     
    217381}
    218382
     383/** TODO comment
     384 *
     385 */
    219386void ext4_superblock_set_errors(ext4_superblock_t *sb, uint16_t errors)
    220387{
     
    222389}
    223390
     391/** TODO comment
     392 *
     393 */
    224394uint16_t ext4_superblock_get_minor_rev_level(ext4_superblock_t *sb)
    225395{
     
    227397}
    228398
     399/** TODO comment
     400 *
     401 */
    229402void ext4_superblock_set_minor_rev_level(ext4_superblock_t *sb, uint16_t level)
    230403{
     
    232405}
    233406
     407/** TODO comment
     408 *
     409 */
    234410uint32_t ext4_superblock_get_last_check_time(ext4_superblock_t *sb)
    235411{
     
    237413}
    238414
     415/** TODO comment
     416 *
     417 */
    239418void ext4_superblock_set_last_check_time(ext4_superblock_t *sb, uint32_t time)
    240419{
     
    242421}
    243422
     423/** TODO comment
     424 *
     425 */
    244426uint32_t ext4_superblock_get_check_interval(ext4_superblock_t *sb){
    245427        return uint32_t_le2host(sb->check_interval);
    246428}
    247429
     430/** TODO comment
     431 *
     432 */
    248433void ext4_superblock_set_check_interval(ext4_superblock_t *sb, uint32_t interval)
    249434{
     
    251436}
    252437
     438/** TODO comment
     439 *
     440 */
    253441uint32_t ext4_superblock_get_creator_os(ext4_superblock_t *sb)
    254442{
     
    256444}
    257445
     446/** TODO comment
     447 *
     448 */
    258449void ext4_superblock_set_creator_os(ext4_superblock_t *sb, uint32_t os)
    259450{
     
    261452}
    262453
     454/** TODO comment
     455 *
     456 */
    263457uint32_t ext4_superblock_get_rev_level(ext4_superblock_t *sb)
    264458{
     
    266460}
    267461
     462/** TODO comment
     463 *
     464 */
    268465void ext4_superblock_set_rev_level(ext4_superblock_t *sb, uint32_t level)
    269466{
     
    271468}
    272469
     470/** TODO comment
     471 *
     472 */
    273473uint16_t ext4_superblock_get_def_resuid(ext4_superblock_t *sb)
    274474{
     
    276476}
    277477
     478/** TODO comment
     479 *
     480 */
    278481void ext4_superblock_set_def_resuid(ext4_superblock_t *sb, uint16_t uid)
    279482{
     
    281484}
    282485
     486/** TODO comment
     487 *
     488 */
    283489uint16_t ext4_superblock_get_def_resgid(ext4_superblock_t *sb)
    284490{
     
    286492}
    287493
     494/** TODO comment
     495 *
     496 */
    288497void ext4_superblock_set_def_resgid(ext4_superblock_t *sb, uint16_t gid)
    289498{
     
    291500}
    292501
     502/** TODO comment
     503 *
     504 */
    293505uint32_t ext4_superblock_get_first_inode(ext4_superblock_t *sb)
    294506{
     
    296508}
    297509
     510/** TODO comment
     511 *
     512 */
    298513void ext4_superblock_set_first_inode(ext4_superblock_t *sb, uint32_t first_inode)
    299514{
     
    301516}
    302517
     518/** TODO comment
     519 *
     520 */
    303521uint16_t ext4_superblock_get_inode_size(ext4_superblock_t *sb)
    304522{
     
    309527}
    310528
     529/** TODO comment
     530 *
     531 */
    311532void ext4_superblock_set_inode_size(ext4_superblock_t *sb, uint16_t size)
    312533{
     
    314535}
    315536
     537/** TODO comment
     538 *
     539 */
    316540uint16_t ext4_superblock_get_block_group_number(ext4_superblock_t *sb)
    317541{
     
    319543}
    320544
     545/** TODO comment
     546 *
     547 */
    321548void ext4_superblock_set_block_group_number(ext4_superblock_t *sb, uint16_t bg)
    322549{
     
    324551}
    325552
     553/** TODO comment
     554 *
     555 */
    326556uint32_t ext4_superblock_get_features_compatible(ext4_superblock_t *sb)
    327557{
     
    329559}
    330560
     561/** TODO comment
     562 *
     563 */
    331564void ext4_superblock_set_features_compatible(ext4_superblock_t *sb, uint32_t features)
    332565{
     
    334567}
    335568
     569/** TODO comment
     570 *
     571 */
    336572uint32_t ext4_superblock_get_features_incompatible(ext4_superblock_t *sb)
    337573{
     
    339575}
    340576
     577/** TODO comment
     578 *
     579 */
    341580void ext4_superblock_set_features_incompatible(ext4_superblock_t *sb, uint32_t features)
    342581{
     
    344583}
    345584
     585/** TODO comment
     586 *
     587 */
    346588uint32_t ext4_superblock_get_features_read_only(ext4_superblock_t *sb)
    347589{
     
    349591}
    350592
     593/** TODO comment
     594 *
     595 */
    351596void ext4_superblock_set_features_read_only(ext4_superblock_t *sb, uint32_t features)
    352597{
     
    354599}
    355600
     601/** TODO comment
     602 *
     603 */
    356604const uint8_t * ext4_superblock_get_uuid(ext4_superblock_t *sb)
    357605{
     
    359607}
    360608
     609/** TODO comment
     610 *
     611 */
    361612void ext4_superblock_set_uuid(ext4_superblock_t *sb, const uint8_t *uuid)
    362613{
     
    369620}
    370621
     622/** TODO comment
     623 *
     624 */
    371625void ext4_superblock_set_volume_name(ext4_superblock_t *sb, const char *name)
    372626{
     
    374628}
    375629
     630/** TODO comment
     631 *
     632 */
    376633const char * ext4_superblock_get_last_mounted(ext4_superblock_t *sb)
    377634{
     
    379636}
    380637
     638/** TODO comment
     639 *
     640 */
    381641void ext4_superblock_set_last_mounted(ext4_superblock_t *sb, const char *last)
    382642{
     
    384644}
    385645
    386 
     646/** TODO comment
     647 *
     648 */
    387649uint32_t ext4_superblock_get_last_orphan(ext4_superblock_t *sb)
    388650{
     
    390652}
    391653
     654/** TODO comment
     655 *
     656 */
    392657void ext4_superblock_set_last_orphan(ext4_superblock_t *sb, uint32_t last_orphan)
    393658{
     
    395660}
    396661
     662/** TODO comment
     663 *
     664 */
    397665uint32_t* ext4_superblock_get_hash_seed(ext4_superblock_t *sb)
    398666{
     
    400668}
    401669
     670/** TODO comment
     671 *
     672 */
    402673uint8_t ext4_superblock_get_default_hash_version(ext4_superblock_t *sb)
    403674{
     
    405676}
    406677
     678/** TODO comment
     679 *
     680 */
    407681void ext4_superblock_set_default_hash_version(ext4_superblock_t *sb, uint8_t version)
    408682{
     
    410684}
    411685
     686/** TODO comment
     687 *
     688 */
    412689uint16_t ext4_superblock_get_desc_size(ext4_superblock_t *sb)
    413690{
     
    421698}
    422699
     700/** TODO comment
     701 *
     702 */
    423703void ext4_superblock_set_desc_size(ext4_superblock_t *sb, uint16_t size)
    424704{
     
    426706}
    427707
     708/** TODO comment
     709 *
     710 */
    428711uint32_t ext4_superblock_get_flags(ext4_superblock_t *sb)
    429712{
     
    431714}
    432715
     716/** TODO comment
     717 *
     718 */
    433719void ext4_superblock_set_flags(ext4_superblock_t *sb, uint32_t flags)
    434720{
     
    441727 */
    442728
     729/** TODO comment
     730 *
     731 */
    443732bool ext4_superblock_has_flag(ext4_superblock_t *sb, uint32_t flag)
    444733{
     
    449738}
    450739
    451 // Feature checkers
     740/** TODO comment
     741 *
     742 */
    452743bool ext4_superblock_has_feature_compatible(ext4_superblock_t *sb, uint32_t feature)
    453744{
     
    458749}
    459750
     751/** TODO comment
     752 *
     753 */
    460754bool ext4_superblock_has_feature_incompatible(ext4_superblock_t *sb, uint32_t feature)
    461755{
     
    466760}
    467761
     762/** TODO comment
     763 *
     764 */
    468765bool ext4_superblock_has_feature_read_only(ext4_superblock_t *sb, uint32_t feature)
    469766{
     
    474771}
    475772
    476 
     773/** TODO comment
     774 *
     775 */
    477776int ext4_superblock_read_direct(service_id_t service_id,
    478777    ext4_superblock_t **superblock)
     
    498797}
    499798
     799/** TODO comment
     800 *
     801 */
    500802int ext4_superblock_write_direct(service_id_t service_id,
    501803                ext4_superblock_t *sb)
     
    521823}
    522824
    523 
     825/** TODO comment
     826 *
     827 */
    524828int ext4_superblock_check_sanity(ext4_superblock_t *sb)
    525829{
     
    537841}
    538842
     843/** TODO comment
     844 *
     845 */
    539846uint32_t ext4_superblock_get_block_group_count(ext4_superblock_t *sb)
    540847{
     
    552859}
    553860
     861/** TODO comment
     862 *
     863 */
    554864uint32_t ext4_superblock_get_blocks_in_group(ext4_superblock_t *sb, uint32_t bgid)
    555865{
     
    566876}
    567877
     878/** TODO comment
     879 *
     880 */
    568881uint32_t ext4_superblock_get_inodes_in_group(ext4_superblock_t *sb, uint32_t bgid)
    569882{
Note: See TracChangeset for help on using the changeset viewer.