Changeset c621f4aa in mainline for uspace/srv/fs/fat/fat_ops.c


Ignore:
Timestamp:
2010-07-25T10:11:13Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
377cce8
Parents:
24a2517 (diff), a2da43c (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 with mainline.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_ops.c

    r24a2517 rc621f4aa  
    4545#include <ipc/services.h>
    4646#include <ipc/devmap.h>
     47#include <macros.h>
    4748#include <async.h>
    4849#include <errno.h>
    49 #include <string.h>
     50#include <str.h>
    5051#include <byteorder.h>
    5152#include <adt/hash_table.h>
     
    7980static int fat_has_children(bool *, fs_node_t *);
    8081static fs_index_t fat_index_get(fs_node_t *);
    81 static size_t fat_size_get(fs_node_t *);
     82static aoff64_t fat_size_get(fs_node_t *);
    8283static unsigned fat_lnkcnt_get(fs_node_t *);
    8384static char fat_plb_get_char(unsigned);
     
    738739                        goto skip_dots;
    739740                }
    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) {
     741                d = (fat_dentry_t *) b->data;
     742                if ((fat_classify_dentry(d) == FAT_DENTRY_LAST) ||
     743                    (str_cmp((char *) d->name, FAT_NAME_DOT)) == 0) {
    743744                        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);
     745                        str_cpy((char *) d->name, 8, FAT_NAME_DOT);
     746                        str_cpy((char *) d->ext, 3, FAT_EXT_PAD);
    746747                        d->attr = FAT_ATTR_SUBDIR;
    747748                        d->firstc = host2uint16_t_le(childp->firstc);
     
    749750                }
    750751                d++;
    751                 if (fat_classify_dentry(d) == FAT_DENTRY_LAST ||
    752                     str_cmp(d->name, FAT_NAME_DOT_DOT) == 0) {
     752                if ((fat_classify_dentry(d) == FAT_DENTRY_LAST) ||
     753                    (str_cmp((char *) d->name, FAT_NAME_DOT_DOT) == 0)) {
    753754                        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);
     755                        str_cpy((char *) d->name, 8, FAT_NAME_DOT_DOT);
     756                        str_cpy((char *) d->ext, 3, FAT_EXT_PAD);
    756757                        d->attr = FAT_ATTR_SUBDIR;
    757758                        d->firstc = (parentp->firstc == FAT_CLST_ROOT) ?
     
    915916}
    916917
    917 size_t fat_size_get(fs_node_t *fn)
     918aoff64_t fat_size_get(fs_node_t *fn)
    918919{
    919920        return FAT_NODE(fn)->size;
     
    11571158void fat_read(ipc_callid_t rid, ipc_call_t *request)
    11581159{
    1159         dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request);
    1160         fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request);
    1161         off_t pos = (off_t)IPC_GET_ARG3(*request);
     1160        dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     1161        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
     1162        aoff64_t pos =
     1163            (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
    11621164        fs_node_t *fn;
    11631165        fat_node_t *nodep;
     
    12231225        } else {
    12241226                unsigned bnum;
    1225                 off_t spos = pos;
     1227                aoff64_t spos = pos;
    12261228                char name[FAT_NAME_LEN + 1 + FAT_EXT_LEN + 1];
    12271229                fat_dentry_t *d;
     
    12391241                bnum = (pos * sizeof(fat_dentry_t)) / bps;
    12401242                while (bnum < nodep->size / bps) {
    1241                         off_t o;
     1243                        aoff64_t o;
    12421244
    12431245                        rc = fat_block_get(&b, bs, nodep, bnum,
     
    12951297void fat_write(ipc_callid_t rid, ipc_call_t *request)
    12961298{
    1297         dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request);
    1298         fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request);
    1299         off_t pos = (off_t)IPC_GET_ARG3(*request);
     1299        dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     1300        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
     1301        aoff64_t pos =
     1302            (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
    13001303        fs_node_t *fn;
    13011304        fat_node_t *nodep;
     
    13061309        unsigned spc;
    13071310        unsigned bpc;           /* bytes per cluster */
    1308         off_t boundary;
     1311        aoff64_t boundary;
    13091312        int flags = BLOCK_FLAGS_NONE;
    13101313        int rc;
     
    14521455void fat_truncate(ipc_callid_t rid, ipc_call_t *request)
    14531456{
    1454         dev_handle_t dev_handle = (dev_handle_t)IPC_GET_ARG1(*request);
    1455         fs_index_t index = (fs_index_t)IPC_GET_ARG2(*request);
    1456         size_t size = (off_t)IPC_GET_ARG3(*request);
     1457        dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request);
     1458        fs_index_t index = (fs_index_t) IPC_GET_ARG2(*request);
     1459        aoff64_t size =
     1460            (aoff64_t) MERGE_LOUP32(IPC_GET_ARG3(*request), IPC_GET_ARG4(*request));
    14571461        fs_node_t *fn;
    14581462        fat_node_t *nodep;
Note: See TracChangeset for help on using the changeset viewer.