Changeset 7a96476 in mainline


Ignore:
Timestamp:
2011-03-27T13:35:15Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ef76d72
Parents:
a04b62d
Message:

Add some comments

Location:
uspace/srv/fs/minixfs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/minixfs/mfs.h

    ra04b62d r7a96476  
    7171        unsigned long zbmap_blocks;
    7272        unsigned long firstdatazone;
    73         unsigned long itable_size;
    7473        int log2_zone_size;
    75         int ino_per_block;
    76         int dirsize;
    7774        int block_size;
    78         mfs_version_t fs_version;
    7975        uint32_t max_file_size;
    8076        uint16_t magic;
    8177        uint16_t state;
     78
     79        /*The following fields do not exist on disk but only in memory*/
     80        unsigned long itable_size;
     81        mfs_version_t fs_version;
     82        int ino_per_block;
     83        int dirsize;
    8284        bool long_names;
    8385        bool native;
     
    99101        uint32_t        i_izone[V2_NR_INDIRECT_ZONES];
    100102
     103        /*The following fields do not exist on disk but only in memory*/
    101104        bool dirty;
    102105        fs_index_t index;
     
    108111        char d_name[MFS3_MAX_NAME_LEN];
    109112
     113        /*The following fields do not exist on disk but only in memory*/
    110114        bool dirty;
    111115};
  • uspace/srv/fs/minixfs/mfs_ops.c

    ra04b62d r7a96476  
    151151
    152152        if (check_magic_number(sb->s_magic, &native, &version, &longnames)) {
     153                /*This is a V1 or V2 Minix filesystem*/
    153154                magic = sb->s_magic;
    154155                goto recognized;
     
    161162                return;
    162163        }
     164
     165        /*This is a V3 Minix filesystem*/
    163166
    164167        magic = sb3->s_magic;
     
    250253void mfs_stat(ipc_callid_t rid, ipc_call_t *request)
    251254{
    252         mfsdebug("mfs_stat called\n");
     255        mfsdebug("mfs_stat()\n");
    253256        libfs_stat(&mfs_libfs_ops, mfs_reg.fs_handle, rid, request);
    254257}
     
    260263        struct mfs_instance *instance;
    261264
    262         mfsdebug("node_get called\n");
     265        mfsdebug("mfs_node_get()\n");
    263266
    264267        rc = mfs_instance_get(devmap_handle, &instance);
     
    354357
    355358        if (!ino_i)
    356                 return -1;
     359                goto out_err;
    357360
    358361        ino_i->index = index;
     
    431434                d_info = read_directory_entry(mnode, i++);
    432435
    433                 if (!d_info)
     436                if (!d_info) {
     437                        /*Reached the end of the dentries list*/
    434438                        goto out;
     439                }
    435440
    436441                if (d_info->d_inum) {
     442                        /*A valid entry has been found*/
    437443                        *has_children = true;
    438444                        free(d_info);
     
    446452
    447453        if (n_dentries > 2 && !*has_children)
    448                 printf(NAME ": Filesystem corruption detected");
     454                printf(NAME ": Filesystem corruption detected\n");
    449455
    450456        if (*has_children)
     
    485491                                mfs_version_t *version, bool *longfilenames)
    486492{
     493        bool rc = false;
    487494        *longfilenames = false;
    488495
     
    490497                *native = magic == MFS_MAGIC_V1;
    491498                *version = MFS_VERSION_V1;
    492                 return true;
     499                rc = true;
    493500        } else if (magic == MFS_MAGIC_V1L || magic == MFS_MAGIC_V1LR) {
    494501                *native = magic == MFS_MAGIC_V1L;
    495502                *version = MFS_VERSION_V1;
    496503                *longfilenames = true;
    497                 return true;
     504                rc = true;
    498505        } else if (magic == MFS_MAGIC_V2 || magic == MFS_MAGIC_V2R) {
    499506                *native = magic == MFS_MAGIC_V2;
    500507                *version = MFS_VERSION_V2;
    501                 return true;
     508                rc = true;
    502509        } else if (magic == MFS_MAGIC_V2L || magic == MFS_MAGIC_V2LR) {
    503510                *native = magic == MFS_MAGIC_V2L;
    504511                *version = MFS_VERSION_V2;
    505512                *longfilenames = true;
    506                 return true;
     513                rc = true;
    507514        } else if (magic == MFS_MAGIC_V3 || magic == MFS_MAGIC_V3R) {
    508515                *native = magic == MFS_MAGIC_V3;
    509516                *version = MFS_VERSION_V3;
    510                 return true;
    511         }
    512 
    513         return false;
     517                rc = true;
     518        }
     519
     520        return rc;
    514521}
    515522
Note: See TracChangeset for help on using the changeset viewer.