Changeset ff0c270 in mainline for uspace/srv/fs/exfat/exfat_bitmap.c
- Timestamp:
- 2011-08-25T22:15:33Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0dbe5ac
- Parents:
- abb7491c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/exfat/exfat_bitmap.c
rabb7491c rff0c270 53 53 { 54 54 fs_node_t *fn; 55 block_t *b =NULL;55 block_t *b = NULL; 56 56 exfat_node_t *bitmapp; 57 57 uint8_t *bitmap; … … 94 94 { 95 95 fs_node_t *fn; 96 block_t *b =NULL;96 block_t *b = NULL; 97 97 exfat_node_t *bitmapp; 98 98 uint8_t *bitmap; … … 129 129 { 130 130 fs_node_t *fn; 131 block_t *b =NULL;131 block_t *b = NULL; 132 132 exfat_node_t *bitmapp; 133 133 uint8_t *bitmap; … … 142 142 143 143 aoff64_t offset = clst / 8; 144 rc = exfat_block_get(&b, bs, bitmapp, offset / BPS(bs), BLOCK_FLAGS_NONE); 144 rc = exfat_block_get(&b, bs, bitmapp, offset / BPS(bs), 145 BLOCK_FLAGS_NONE); 145 146 if (rc != EOK) { 146 147 (void) exfat_node_put(fn); … … 167 168 clst = firstc; 168 169 169 while (clst < firstc +count ) {170 while (clst < firstc + count ) { 170 171 rc = bitmap_set_cluster(bs, service_id, clst); 171 172 if (rc != EOK) { 172 if ((clst-firstc) > 0) 173 (void) bitmap_clear_clusters(bs, service_id, firstc, clst-firstc); 173 if (clst - firstc > 0) 174 (void) bitmap_clear_clusters(bs, service_id, 175 firstc, clst - firstc); 174 176 return rc; 175 177 } … … 186 188 clst = firstc; 187 189 188 while (clst < firstc +count) {190 while (clst < firstc + count) { 189 191 rc = bitmap_clear_cluster(bs, service_id, clst); 190 192 if (rc != EOK) … … 201 203 startc = EXFAT_CLST_FIRST; 202 204 203 while (startc < DATA_CNT(bs) +2) {205 while (startc < DATA_CNT(bs) + 2) { 204 206 endc = startc; 205 207 while (bitmap_is_free(bs, service_id, endc) == EOK) { 206 if ((endc - startc) +1 == count){208 if ((endc - startc) + 1 == count) { 207 209 *firstc = startc; 208 210 return bitmap_set_clusters(bs, service_id, startc, count); 209 } 210 else 211 } else 211 212 endc++; 212 213 } … … 227 228 lastc = nodep->firstc + ROUND_UP(nodep->size, BPC(bs)) / BPC(bs) - 1; 228 229 229 clst = lastc +1;230 clst = lastc + 1; 230 231 while (bitmap_is_free(bs, nodep->idx->service_id, clst) == EOK) { 231 if ( (clst - lastc)== count){232 if (clst - lastc == count){ 232 233 return bitmap_set_clusters(bs, nodep->idx->service_id, 233 lastc+1, count); 234 } 235 else 234 lastc + 1, count); 235 } else 236 236 clst++; 237 237 } … … 248 248 lastc -= count; 249 249 250 return bitmap_clear_clusters(bs, nodep->idx->service_id, lastc +1, count);250 return bitmap_clear_clusters(bs, nodep->idx->service_id, lastc + 1, count); 251 251 } 252 252 … … 260 260 261 261 for (clst = nodep->firstc; clst < lastc; clst++) { 262 rc = exfat_set_cluster(bs, service_id, clst, clst +1);262 rc = exfat_set_cluster(bs, service_id, clst, clst + 1); 263 263 if (rc != EOK) 264 264 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.