Changeset a61d1fc3 in mainline
- Timestamp:
- 2008-08-07T21:40:27Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c544c5d
- Parents:
- 61bc901
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
r61bc901 ra61d1fc3 50 50 51 51 #define BS_BLOCK 0 52 #define BS_SIZE 512 52 53 53 54 /** Futex protecting the list of cached free FAT nodes. */ … … 100 101 } block_t; 101 102 102 static block_t *block_get(dev_handle_t dev_handle, off_t offset )103 static block_t *block_get(dev_handle_t dev_handle, off_t offset, size_t bs) 103 104 { 104 105 return NULL; /* TODO */ … … 144 145 unsigned i; 145 146 146 bb = block_get(dev_handle, BS_BLOCK );147 bb = block_get(dev_handle, BS_BLOCK, BS_SIZE); 147 148 bps = uint16_t_le2host(FAT_BS(bb)->bps); 148 149 spc = FAT_BS(bb)->spc; … … 160 161 /* root directory special case */ 161 162 assert(offset < rds); 162 b = block_get(dev_handle, rscnt + fatcnt * sf + offset );163 b = block_get(dev_handle, rscnt + fatcnt * sf + offset, bps); 163 164 return b; 164 165 } … … 173 174 fidx = clst % (bps / sizeof(fat_cluster_t)); 174 175 /* read FAT1 */ 175 b = block_get(dev_handle, rscnt + fsec );176 b = block_get(dev_handle, rscnt + fsec, bps); 176 177 clst = uint16_t_le2host(((fat_cluster_t *)b->data)[fidx]); 177 178 assert(clst != FAT_CLST_BAD); … … 181 182 182 183 b = block_get(dev_handle, ssa + (clst - FAT_CLST_FIRST) * spc + 183 offset % spc );184 offset % spc, bps); 184 185 185 186 return b; … … 203 204 uint16_t bps; 204 205 205 bb = block_get(dev_handle, BS_BLOCK );206 bb = block_get(dev_handle, BS_BLOCK, BS_SIZE); 206 207 assert(bb != NULL); 207 208 bps = uint16_t_le2host(FAT_BS(bb)->bps); … … 572 573 573 574 /* 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); 575 576 rde = uint16_t_le2host(FAT_BS(bb)->root_ent_max); 576 577 block_put(bb);
Note:
See TracChangeset
for help on using the changeset viewer.