Changeset 979c313a in mainline
- Timestamp:
- 2011-05-02T07:35:20Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a8c14aa
- Parents:
- b5db2ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
rb5db2ae r979c313a 57 57 (SSA((bs)) + ((cl) - FAT_CLST_FIRST) * SPC((bs)) + (bn) % SPC((bs))) 58 58 59 #define IS_ODD(number) (number & 0x1) 60 59 61 /** 60 62 * The fat_alloc_lock mutex protects all copies of the File Allocation Table … … 302 304 assert(fatno < FATCNT(bs)); 303 305 304 *value = 0;305 306 306 if (FAT_IS_FAT12(bs)) 307 307 offset = (clst + clst/2); … … 314 314 return rc; 315 315 316 /* This cluster access spans a sector boundary. Check only for FAT12 */317 316 if (FAT_IS_FAT12(bs)) { 317 /* This cluster access spans a sector boundary. Check only for FAT12 */ 318 318 if ((offset % BPS(bs) + 1 == BPS(bs))) { 319 319 /* Is it last sector of FAT? */ … … 331 331 */ 332 332 *value = *(uint8_t *)(b->data + BPS(bs) - 1); 333 *value |= *(uint8_t *)(b1->data) ;333 *value |= *(uint8_t *)(b1->data) << 8; 334 334 335 335 rc = block_put(b1); … … 345 345 } 346 346 } 347 348 if (clst & 0x0001) 347 else 348 *value = *(uint16_t *)(b->data + offset % BPS(bs)); 349 350 if (IS_ODD(clst)) 349 351 *value = (*value) >> 4; 350 352 else … … 358 360 } 359 361 360 *value = uint 16_t_le2host(*value);362 *value = uint32_t_le2host(*value); 361 363 rc = block_put(b); 362 364
Note:
See TracChangeset
for help on using the changeset viewer.