Changeset 3149fc0 in mainline


Ignore:
Timestamp:
2010-02-10T19:39:10Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
36e9cd1
Parents:
a60b2d7 (diff), 24a2517 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge fixes from the file system branch.

Location:
uspace
Files:
4 edited

Legend:

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

    ra60b2d7 r3149fc0  
    5252#include <macros.h>
    5353#include <mem.h>
     54#include <sys/typefmt.h>
     55#include <stacktrace.h>
    5456
    5557/** Lock protecting the device connection list */
     
    813815        rc = async_req_3_0(devcon->dev_phone, BD_READ_BLOCKS, LOWER32(ba),
    814816            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        }
    815825        return rc;
    816826}
     
    832842        rc = async_req_3_0(devcon->dev_phone, BD_WRITE_BLOCKS, LOWER32(ba),
    833843            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        }
    834851        return rc;
    835852}
  • uspace/srv/bd/file_bd/file_bd.c

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

    ra60b2d7 r3149fc0  
    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;
    149155
    150156        bps = uint16_t_le2host(bs->bps);
  • uspace/srv/fs/fat/fat_ops.c

    ra60b2d7 r3149fc0  
    722722        fibril_mutex_lock(&childp->idx->lock);
    723723       
    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) {
     724        if (childp->type == FAT_DIRECTORY) {
    732725                /*
    733                  * Rather than returning an error, simply skip the creation of
    734                  * these two entries.
     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.
    735731                 */
    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);
     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        }
    766769skip_dots:
    767770
Note: See TracChangeset for help on using the changeset viewer.