Changeset 18b6a88 in mainline for uspace/srv/fs/fat
- Timestamp:
- 2018-04-15T09:35:04Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c1f44ca
- Parents:
- 8ebe212
- Location:
- uspace/srv/fs/fat
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_fat.c
r8ebe212 r18b6a88 249 249 for (o = nodep->size; o < pos && o < boundary; 250 250 o = ALIGN_DOWN(o + BPS(bs), BPS(bs))) { 251 int flags = (o % BPS(bs) == 0) ?251 int flags = (o % BPS(bs) == 0) ? 252 252 BLOCK_FLAGS_NOREAD : BLOCK_FLAGS_NONE; 253 253 rc = fat_block_get(&b, bs, nodep, o / BPS(bs), flags); … … 324 324 * first byte of next sector 325 325 */ 326 byte2 = ((uint8_t *) b1->data)[0];326 byte2 = ((uint8_t *) b1->data)[0]; 327 327 328 328 rc = block_put(b1); … … 469 469 return rc; 470 470 471 byte1 = ((uint8_t *) b->data)[offset % BPS(bs)];471 byte1 = ((uint8_t *) b->data)[offset % BPS(bs)]; 472 472 bool border = false; 473 473 /* This cluster access spans a sector boundary. */ … … 495 495 } 496 496 } else 497 byte2 = ((uint8_t *) b->data)[(offset % BPS(bs)) + 1];497 byte2 = ((uint8_t *) b->data)[(offset % BPS(bs)) + 1]; 498 498 499 499 if (IS_ODD(clst)) { -
uspace/srv/fs/fat/fat_idx.c
r8ebe212 r18b6a88 119 119 static inline size_t pos_key_hash(void *key) 120 120 { 121 pos_key_t *pos = (pos_key_t *)key;121 pos_key_t *pos = (pos_key_t *)key; 122 122 123 123 size_t hash = 0; … … 141 141 static bool pos_key_equal(void *key, const ht_link_t *item) 142 142 { 143 pos_key_t *pos = (pos_key_t *)key;143 pos_key_t *pos = (pos_key_t *)key; 144 144 fat_idx_t *fidx = hash_table_get_inst(item, fat_idx_t, uph_link); 145 145 146 return pos->service_id == fidx->service_id 147 && pos->pdi == fidx->pdi148 &&pos->pfc == fidx->pfc;146 return pos->service_id == fidx->service_id && 147 pos->pdi == fidx->pdi && 148 pos->pfc == fidx->pfc; 149 149 } 150 150 … … 170 170 static size_t idx_key_hash(void *key_arg) 171 171 { 172 idx_key_t *key = (idx_key_t *)key_arg;172 idx_key_t *key = (idx_key_t *)key_arg; 173 173 return hash_combine(key->service_id, key->index); 174 174 } … … 183 183 { 184 184 fat_idx_t *fidx = hash_table_get_inst(item, fat_idx_t, uih_link); 185 idx_key_t *key = (idx_key_t *)key_arg;185 idx_key_t *key = (idx_key_t *)key_arg; 186 186 187 187 return key->index == fidx->index && key->service_id == fidx->service_id; … … 508 508 static bool rm_pos_service_id(ht_link_t *item, void *arg) 509 509 { 510 service_id_t service_id = *(service_id_t *)arg;510 service_id_t service_id = *(service_id_t *)arg; 511 511 fat_idx_t *fidx = hash_table_get_inst(item, fat_idx_t, uph_link); 512 512 … … 520 520 static bool rm_idx_service_id(ht_link_t *item, void *arg) 521 521 { 522 service_id_t service_id = *(service_id_t *)arg;522 service_id_t service_id = *(service_id_t *)arg; 523 523 fat_idx_t *fidx = hash_table_get_inst(item, fat_idx_t, uih_link); 524 524 -
uspace/srv/fs/fat/fat_ops.c
r8ebe212 r18b6a88 241 241 fn = FS_NODE(nodep); 242 242 } else { 243 skip_cache:243 skip_cache: 244 244 /* Try to allocate a new node structure. */ 245 245 fibril_mutex_unlock(&ffn_mutex); … … 1289 1289 goto miss; 1290 1290 1291 err:1291 err: 1292 1292 (void) fat_node_put(fn); 1293 1293 async_answer_0(chandle, rc); 1294 1294 return rc; 1295 1295 1296 miss:1296 miss: 1297 1297 rc = fat_directory_close(&di); 1298 1298 if (rc != EOK) … … 1303 1303 return rc != EOK ? rc : ENOENT; 1304 1304 1305 hit:1305 hit: 1306 1306 pos = di.pos; 1307 1307 rc = fat_directory_close(&di);
Note:
See TracChangeset
for help on using the changeset viewer.
