Subversion Repositories HelenOS

Rev

Rev 4337 | Rev 4389 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4337 Rev 4348
Line 485... Line 485...
485
     * not use them anyway, so this is rather a sign of our good will.
485
     * not use them anyway, so this is rather a sign of our good will.
486
     */
486
     */
487
    b = fat_block_get(bs, childp, 0, BLOCK_FLAGS_NONE);
487
    b = fat_block_get(bs, childp, 0, BLOCK_FLAGS_NONE);
488
    d = (fat_dentry_t *)b->data;
488
    d = (fat_dentry_t *)b->data;
489
    if (fat_classify_dentry(d) == FAT_DENTRY_LAST ||
489
    if (fat_classify_dentry(d) == FAT_DENTRY_LAST ||
490
        strcmp(d->name, FAT_NAME_DOT) == 0) {
490
        str_cmp(d->name, FAT_NAME_DOT) == 0) {
491
        memset(d, 0, sizeof(fat_dentry_t));
491
        memset(d, 0, sizeof(fat_dentry_t));
492
        strcpy(d->name, FAT_NAME_DOT);
492
        str_cpy(d->name, 8, FAT_NAME_DOT);
493
        strcpy(d->ext, FAT_EXT_PAD);
493
        str_cpy(d->ext, 3, FAT_EXT_PAD);
494
        d->attr = FAT_ATTR_SUBDIR;
494
        d->attr = FAT_ATTR_SUBDIR;
495
        d->firstc = host2uint16_t_le(childp->firstc);
495
        d->firstc = host2uint16_t_le(childp->firstc);
496
        /* TODO: initialize also the date/time members. */
496
        /* TODO: initialize also the date/time members. */
497
    }
497
    }
498
    d++;
498
    d++;
499
    if (fat_classify_dentry(d) == FAT_DENTRY_LAST ||
499
    if (fat_classify_dentry(d) == FAT_DENTRY_LAST ||
500
        strcmp(d->name, FAT_NAME_DOT_DOT) == 0) {
500
        str_cmp(d->name, FAT_NAME_DOT_DOT) == 0) {
501
        memset(d, 0, sizeof(fat_dentry_t));
501
        memset(d, 0, sizeof(fat_dentry_t));
502
        strcpy(d->name, FAT_NAME_DOT_DOT);
502
        str_cpy(d->name, 8, FAT_NAME_DOT_DOT);
503
        strcpy(d->ext, FAT_EXT_PAD);
503
        str_cpy(d->ext, 3, FAT_EXT_PAD);
504
        d->attr = FAT_ATTR_SUBDIR;
504
        d->attr = FAT_ATTR_SUBDIR;
505
        d->firstc = (parentp->firstc == FAT_CLST_ROOT) ?
505
        d->firstc = (parentp->firstc == FAT_CLST_ROOT) ?
506
            host2uint16_t_le(FAT_CLST_RES0) :
506
            host2uint16_t_le(FAT_CLST_RES0) :
507
            host2uint16_t_le(parentp->firstc);
507
            host2uint16_t_le(parentp->firstc);
508
        /* TODO: initialize also the date/time members. */
508
        /* TODO: initialize also the date/time members. */
Line 753... Line 753...
753
    fat_bs_t *bs;
753
    fat_bs_t *bs;
754
    uint16_t bps;
754
    uint16_t bps;
755
    uint16_t rde;
755
    uint16_t rde;
756
    int rc;
756
    int rc;
757
 
757
 
-
 
758
    /* accept the mount options */
-
 
759
    ipc_callid_t callid;
-
 
760
    size_t size;
-
 
761
    if (!ipc_data_write_receive(&callid, &size)) {
-
 
762
        ipc_answer_0(callid, EINVAL);
-
 
763
        ipc_answer_0(rid, EINVAL);
-
 
764
        return;
-
 
765
    }
-
 
766
    char *opts = malloc(size + 1);
-
 
767
    if (!opts) {
-
 
768
        ipc_answer_0(callid, ENOMEM);
-
 
769
        ipc_answer_0(rid, ENOMEM);
-
 
770
        return;
-
 
771
    }
-
 
772
    ipcarg_t retval = ipc_data_write_finalize(callid, opts, size);
-
 
773
    if (retval != EOK) {
-
 
774
        ipc_answer_0(rid, retval);
-
 
775
        free(opts);
-
 
776
        return;
-
 
777
    }
-
 
778
    opts[size] = '\0';
-
 
779
 
758
    /* initialize libblock */
780
    /* initialize libblock */
759
    rc = block_init(dev_handle, BS_SIZE);
781
    rc = block_init(dev_handle, BS_SIZE);
760
    if (rc != EOK) {
782
    if (rc != EOK) {
761
        ipc_answer_0(rid, rc);
783
        ipc_answer_0(rid, rc);
762
        return;
784
        return;
Line 935... Line 957...
935
        fat_node_put(nodep);
957
        fat_node_put(nodep);
936
        ipc_answer_0(callid, ENOENT);
958
        ipc_answer_0(callid, ENOENT);
937
        ipc_answer_1(rid, ENOENT, 0);
959
        ipc_answer_1(rid, ENOENT, 0);
938
        return;
960
        return;
939
hit:
961
hit:
940
        (void) ipc_data_read_finalize(callid, name, strlen(name) + 1);
962
        (void) ipc_data_read_finalize(callid, name, str_size(name) + 1);
941
        bytes = (pos - spos) + 1;
963
        bytes = (pos - spos) + 1;
942
    }
964
    }
943
 
965
 
944
    fat_node_put(nodep);
966
    fat_node_put(nodep);
945
    ipc_answer_1(rid, EOK, (ipcarg_t)bytes);
967
    ipc_answer_1(rid, EOK, (ipcarg_t)bytes);