Changeset 8a06c1b in mainline


Ignore:
Timestamp:
2011-08-15T17:19:23Z (13 years ago)
Author:
Oleg Romanenko <romanenko.oleg@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7d78d163
Parents:
d9aeab3
Message:

exFAT: implement exfat_zero_cluster

Location:
uspace/srv/fs/exfat
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/exfat/exfat_fat.c

    rd9aeab3 r8a06c1b  
    194194        int rc;
    195195
    196         if (fcl < EXFAT_CLST_FIRST)
     196        if (fcl < EXFAT_CLST_FIRST || fcl > DATA_CNT(bs)+2)
    197197                return ELIMIT;
    198198
     
    476476}
    477477
     478int
     479exfat_zero_cluster(exfat_bs_t *bs, devmap_handle_t devmap_handle, exfat_cluster_t c)
     480{
     481        size_t i;
     482        block_t *b;
     483        int rc;
     484
     485        for (i = 0; i < SPC(bs); i++) {
     486                rc = exfat_block_get_by_clst(&b, bs, devmap_handle, false, c, NULL, i,
     487                    BLOCK_FLAGS_NOREAD);
     488                if (rc != EOK)
     489                        return rc;
     490                memset(b->data, 0, BPS(bs));
     491                b->dirty = true;
     492                rc = block_put(b);
     493                if (rc != EOK)
     494                        return rc;
     495        }
     496
     497        return EOK;
     498}
     499
    478500/** Perform basic sanity checks on the file system.
    479501 *
  • uspace/srv/fs/exfat/exfat_fat.h

    rd9aeab3 r8a06c1b  
    8383    exfat_cluster_t *, exfat_cluster_t *);
    8484extern int exfat_free_clusters(struct exfat_bs *, devmap_handle_t, exfat_cluster_t);
    85 
     85extern int exfat_zero_cluster(struct exfat_bs * bs, devmap_handle_t devmap_handle,
     86    exfat_cluster_t mcl);
    8687
    8788#endif
Note: See TracChangeset for help on using the changeset viewer.