Changes in / [3149fc0:a60b2d7] in mainline


Ignore:
Location:
uspace
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libblock/libblock.c

    r3149fc0 ra60b2d7  
    5252#include <macros.h>
    5353#include <mem.h>
    54 #include <sys/typefmt.h>
    55 #include <stacktrace.h>
    5654
    5755/** Lock protecting the device connection list */
     
    815813        rc = async_req_3_0(devcon->dev_phone, BD_READ_BLOCKS, LOWER32(ba),
    816814            UPPER32(ba), cnt);
    817         if (rc != EOK) {
    818                 printf("Error %d reading %d blocks starting at block %" PRIuBN
    819                     " from device handle %d\n", rc, cnt, ba,
    820                     devcon->dev_handle);
    821 #ifndef NDEBUG
    822                 stacktrace_print();
    823 #endif
    824         }
    825815        return rc;
    826816}
     
    842832        rc = async_req_3_0(devcon->dev_phone, BD_WRITE_BLOCKS, LOWER32(ba),
    843833            UPPER32(ba), cnt);
    844         if (rc != EOK) {
    845                 printf("Error %d writing %d blocks starting at block %" PRIuBN
    846                     " to device handle %d\n", rc, cnt, ba, devcon->dev_handle);
    847 #ifndef NDEBUG
    848                 stacktrace_print();
    849 #endif
    850         }
    851834        return rc;
    852835}
  • uspace/srv/bd/file_bd/file_bd.c

    r3149fc0 ra60b2d7  
    249249        if (ba + cnt > num_blocks) {
    250250                printf(NAME ": Accessed blocks %" PRIuBN "-%" PRIuBN ", while "
    251                     "max block number is %" PRIuBN ".\n", ba, ba + cnt - 1,
     251                    "max block numeber is %" PRIuBN ".\n", ba, ba + cnt - 1,
    252252                    num_blocks - 1);
    253253                return ELIMIT;
  • uspace/srv/fs/fat/fat_fat.c

    r3149fc0 ra60b2d7  
    147147        fat_cluster_t lastc;
    148148        int rc;
    149 
    150         /*
    151          * This function can only operate on non-zero length files.
    152          */
    153         if (firstc == FAT_CLST_RES0)
    154                 return ELIMIT;
    155149
    156150        bps = uint16_t_le2host(bs->bps);
  • uspace/srv/fs/fat/fat_ops.c

    r3149fc0 ra60b2d7  
    722722        fibril_mutex_lock(&childp->idx->lock);
    723723       
    724         if (childp->type == FAT_DIRECTORY) {
     724        /*
     725         * If possible, create the Sub-directory Identifier Entry and the
     726         * Sub-directory Parent Pointer Entry (i.e. "." and ".."). These entries
     727         * are not mandatory according to Standard ECMA-107 and HelenOS VFS does
     728         * not use them anyway, so this is rather a sign of our good will.
     729         */
     730        rc = fat_block_get(&b, bs, childp, 0, BLOCK_FLAGS_NONE);
     731        if (rc != EOK) {
    725732                /*
    726                  * If possible, create the Sub-directory Identifier Entry and
    727                  * the Sub-directory Parent Pointer Entry (i.e. "." and "..").
    728                  * These entries are not mandatory according to Standard
    729                  * ECMA-107 and HelenOS VFS does not use them anyway, so this is
    730                  * rather a sign of our good will.
     733                 * Rather than returning an error, simply skip the creation of
     734                 * these two entries.
    731735                 */
    732                 rc = fat_block_get(&b, bs, childp, 0, BLOCK_FLAGS_NONE);
    733                 if (rc != EOK) {
    734                         /*
    735                          * Rather than returning an error, simply skip the
    736                          * creation of these two entries.
    737                          */
    738                         goto skip_dots;
    739                 }
    740                 d = (fat_dentry_t *)b->data;
    741                 if (fat_classify_dentry(d) == FAT_DENTRY_LAST ||
    742                     str_cmp(d->name, FAT_NAME_DOT) == 0) {
    743                         memset(d, 0, sizeof(fat_dentry_t));
    744                         str_cpy(d->name, 8, FAT_NAME_DOT);
    745                         str_cpy(d->ext, 3, FAT_EXT_PAD);
    746                         d->attr = FAT_ATTR_SUBDIR;
    747                         d->firstc = host2uint16_t_le(childp->firstc);
    748                         /* TODO: initialize also the date/time members. */
    749                 }
    750                 d++;
    751                 if (fat_classify_dentry(d) == FAT_DENTRY_LAST ||
    752                     str_cmp(d->name, FAT_NAME_DOT_DOT) == 0) {
    753                         memset(d, 0, sizeof(fat_dentry_t));
    754                         str_cpy(d->name, 8, FAT_NAME_DOT_DOT);
    755                         str_cpy(d->ext, 3, FAT_EXT_PAD);
    756                         d->attr = FAT_ATTR_SUBDIR;
    757                         d->firstc = (parentp->firstc == FAT_CLST_ROOT) ?
    758                             host2uint16_t_le(FAT_CLST_RES0) :
    759                             host2uint16_t_le(parentp->firstc);
    760                         /* TODO: initialize also the date/time members. */
    761                 }
    762                 b->dirty = true;                /* need to sync block */
    763                 /*
    764                  * Ignore the return value as we would have fallen through on error
    765                  * anyway.
    766                  */
    767                 (void) block_put(b);
    768         }
     736                goto skip_dots;
     737        }
     738        d = (fat_dentry_t *)b->data;
     739        if (fat_classify_dentry(d) == FAT_DENTRY_LAST ||
     740            str_cmp(d->name, FAT_NAME_DOT) == 0) {
     741                memset(d, 0, sizeof(fat_dentry_t));
     742                str_cpy(d->name, 8, FAT_NAME_DOT);
     743                str_cpy(d->ext, 3, FAT_EXT_PAD);
     744                d->attr = FAT_ATTR_SUBDIR;
     745                d->firstc = host2uint16_t_le(childp->firstc);
     746                /* TODO: initialize also the date/time members. */
     747        }
     748        d++;
     749        if (fat_classify_dentry(d) == FAT_DENTRY_LAST ||
     750            str_cmp(d->name, FAT_NAME_DOT_DOT) == 0) {
     751                memset(d, 0, sizeof(fat_dentry_t));
     752                str_cpy(d->name, 8, FAT_NAME_DOT_DOT);
     753                str_cpy(d->ext, 3, FAT_EXT_PAD);
     754                d->attr = FAT_ATTR_SUBDIR;
     755                d->firstc = (parentp->firstc == FAT_CLST_ROOT) ?
     756                    host2uint16_t_le(FAT_CLST_RES0) :
     757                    host2uint16_t_le(parentp->firstc);
     758                /* TODO: initialize also the date/time members. */
     759        }
     760        b->dirty = true;                /* need to sync block */
     761        /*
     762         * Ignore the return value as we would have fallen through on error
     763         * anyway.
     764         */
     765        (void) block_put(b);
    769766skip_dots:
    770767
Note: See TracChangeset for help on using the changeset viewer.