Changeset a61d1fc3 in mainline


Ignore:
Timestamp:
2008-08-07T21:40:27Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c544c5d
Parents:
61bc901
Message:

Pass block size to block_get() in the last argument.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_ops.c

    r61bc901 ra61d1fc3  
    5050
    5151#define BS_BLOCK                0
     52#define BS_SIZE                 512
    5253
    5354/** Futex protecting the list of cached free FAT nodes. */
     
    100101} block_t;
    101102
    102 static block_t *block_get(dev_handle_t dev_handle, off_t offset)
     103static block_t *block_get(dev_handle_t dev_handle, off_t offset, size_t bs)
    103104{
    104105        return NULL;    /* TODO */
     
    144145        unsigned i;
    145146
    146         bb = block_get(dev_handle, BS_BLOCK);
     147        bb = block_get(dev_handle, BS_BLOCK, BS_SIZE);
    147148        bps = uint16_t_le2host(FAT_BS(bb)->bps);
    148149        spc = FAT_BS(bb)->spc;
     
    160161                /* root directory special case */
    161162                assert(offset < rds);
    162                 b = block_get(dev_handle, rscnt + fatcnt * sf + offset);
     163                b = block_get(dev_handle, rscnt + fatcnt * sf + offset, bps);
    163164                return b;
    164165        }
     
    173174                fidx = clst % (bps / sizeof(fat_cluster_t));
    174175                /* read FAT1 */
    175                 b = block_get(dev_handle, rscnt + fsec);
     176                b = block_get(dev_handle, rscnt + fsec, bps);
    176177                clst = uint16_t_le2host(((fat_cluster_t *)b->data)[fidx]);
    177178                assert(clst != FAT_CLST_BAD);
     
    181182
    182183        b = block_get(dev_handle, ssa + (clst - FAT_CLST_FIRST) * spc +
    183             offset % spc);
     184            offset % spc, bps);
    184185
    185186        return b;
     
    203204        uint16_t bps;
    204205       
    205         bb = block_get(dev_handle, BS_BLOCK);
     206        bb = block_get(dev_handle, BS_BLOCK, BS_SIZE);
    206207        assert(bb != NULL);
    207208        bps = uint16_t_le2host(FAT_BS(bb)->bps);
     
    572573
    573574        /* Read the number of root directory entries. */
    574         bb = block_get(dev_handle, BS_BLOCK);
     575        bb = block_get(dev_handle, BS_BLOCK, BS_SIZE);
    575576        rde = uint16_t_le2host(FAT_BS(bb)->root_ent_max);
    576577        block_put(bb);
Note: See TracChangeset for help on using the changeset viewer.