Changeset fc840d9 in mainline for uspace/srv/fs/fat/fat_ops.c
- Timestamp:
- 2008-10-27T16:53:38Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7a5cdded
- Parents:
- 04619ba
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/fat/fat_ops.c
r04619ba rfc840d9 41 41 #include "../../vfs/vfs.h" 42 42 #include <libfs.h> 43 #include <libblock.h> 43 44 #include <ipc/ipc.h> 44 45 #include <ipc/services.h> … … 60 61 /** List of cached free FAT nodes. */ 61 62 static LIST_INITIALIZE(ffn_head); 62 63 static int dev_phone = -1; /* FIXME */64 static void *dev_buffer = NULL; /* FIXME */65 66 block_t *block_get(dev_handle_t dev_handle, off_t offset, size_t bs)67 {68 /* FIXME */69 block_t *b;70 off_t bufpos = 0;71 size_t buflen = 0;72 off_t pos = offset * bs;73 74 assert(dev_phone != -1);75 assert(dev_buffer);76 77 b = malloc(sizeof(block_t));78 if (!b)79 return NULL;80 81 b->data = malloc(bs);82 if (!b->data) {83 free(b);84 return NULL;85 }86 b->size = bs;87 88 if (!libfs_blockread(dev_phone, dev_buffer, &bufpos, &buflen, &pos,89 b->data, bs, bs)) {90 free(b->data);91 free(b);92 return NULL;93 }94 95 return b;96 }97 98 void block_put(block_t *block)99 {100 /* FIXME */101 free(block->data);102 free(block);103 }104 63 105 64 static void fat_node_initialize(fat_node_t *node)
Note:
See TracChangeset
for help on using the changeset viewer.