Changeset 7858bc5f in mainline
- Timestamp:
- 2008-10-28T15:40:19Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 916bf1a
- Parents:
- 5cf723b
- Location:
- uspace
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libblock/libblock.c
r5cf723b r7858bc5f 39 39 #include "../../srv/vfs/vfs.h" 40 40 #include "../../srv/rd/rd.h" 41 #include <ipc/devmap.h> 42 #include <ipc/services.h> 41 43 #include <errno.h> 44 #include <sys/mman.h> 42 45 #include <async.h> 43 46 #include <ipc/ipc.h> … … 45 48 #include <assert.h> 46 49 50 static int dev_phone = -1; /* FIXME */ 51 static void *dev_buffer = NULL; /* FIXME */ 52 static size_t dev_buffer_len = 0; /* FIXME */ 53 static void *bblock = NULL; /* FIXME */ 54 55 int 56 block_init(dev_handle_t dev_handle, size_t com_size, off_t bb_off, 57 size_t bb_size) 58 { 59 int rc; 60 61 bblock = malloc(bb_size); 62 if (!bblock) 63 return ENOMEM; 64 dev_buffer_len = com_size; 65 dev_buffer = mmap(NULL, com_size, PROTO_READ | PROTO_WRITE, 66 MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); 67 if (!dev_buffer) { 68 free(bblock); 69 return ENOMEM; 70 } 71 dev_phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, 72 DEVMAP_CONNECT_TO_DEVICE, dev_handle); 73 74 if (dev_phone < 0) { 75 free(bblock); 76 munmap(dev_buffer, com_size); 77 return dev_phone; 78 } 79 80 rc = ipc_share_out_start(dev_phone, dev_buffer, 81 AS_AREA_READ | AS_AREA_WRITE); 82 if (rc != EOK) { 83 ipc_hangup(dev_phone); 84 free(bblock); 85 munmap(dev_buffer, com_size); 86 return rc; 87 } 88 off_t bufpos = 0; 89 size_t buflen = 0; 90 if (!block_read(dev_handle, &bufpos, &buflen, &bb_off, 91 bblock, bb_size, bb_size)) { 92 ipc_hangup(dev_phone); 93 free(bblock); 94 munmap(dev_buffer, com_size); 95 return EIO; /* XXX real error code */ 96 } 97 return EOK; 98 } 99 100 void block_fini(dev_handle_t dev_handle) 101 { 102 /* XXX */ 103 free(bblock); 104 munmap(dev_buffer, dev_buffer_len); 105 ipc_hangup(dev_phone); 106 } 107 108 void *block_bb_get(dev_handle_t dev_handle) 109 { 110 /* XXX */ 111 return bblock; 112 } 113 47 114 /** Read data from a block device. 48 115 * 49 * @param phone Phone to be used to communicate with the device. 50 * @param buffer Communication buffer shared with the device. 116 * @param dev_handle Device handle of the block device. 51 117 * @param bufpos Pointer to the first unread valid offset within the 52 118 * communication buffer. … … 60 126 * @return True on success, false on failure. 61 127 */ 62 bool blockread(int phone, void *buffer, off_t *bufpos, size_t *buflen, 63 off_t *pos, void *dst, size_t size, size_t block_size) 128 bool 129 block_read(int dev_handle, off_t *bufpos, size_t *buflen, off_t *pos, void *dst, 130 size_t size, size_t block_size) 64 131 { 65 132 off_t offset = 0; … … 79 146 * destination buffer. 80 147 */ 81 memcpy(dst + offset, buffer + *bufpos, rd);148 memcpy(dst + offset, dev_buffer + *bufpos, rd); 82 149 offset += rd; 83 150 *bufpos += rd; … … 89 156 /* Refill the communication buffer with a new block. */ 90 157 ipcarg_t retval; 91 int rc = async_req_2_1( phone, RD_READ_BLOCK,158 int rc = async_req_2_1(dev_phone, RD_READ_BLOCK, 92 159 *pos / block_size, block_size, &retval); 93 160 if ((rc != EOK) || (retval != EOK)) … … 101 168 return true; 102 169 } 103 104 int dev_phone = -1; /* FIXME */105 void *dev_buffer = NULL; /* FIXME */106 170 107 171 block_t *block_get(dev_handle_t dev_handle, off_t offset, size_t bs) … … 127 191 b->size = bs; 128 192 129 if (!block read(dev_phone, dev_buffer, &bufpos, &buflen, &pos, b->data,193 if (!block_read(dev_handle, &bufpos, &buflen, &pos, b->data, 130 194 bs, bs)) { 131 195 free(b->data); -
uspace/lib/libblock/libblock.h
r5cf723b r7858bc5f 68 68 } block_t; 69 69 70 extern int dev_phone; /* FIXME */ 71 extern void *dev_buffer; /* FIXME */ 70 extern int block_init(dev_handle_t, size_t, off_t, size_t); 71 extern void block_fini(dev_handle_t); 72 extern void *block_bb_get(dev_handle_t); 72 73 73 74 extern block_t *block_get(dev_handle_t, off_t, size_t); 74 75 extern void block_put(block_t *); 75 76 76 extern bool blockread(int, void *, off_t *, size_t *, off_t *, void *, size_t, 77 size_t); 77 extern bool block_read(int, off_t *, size_t *, off_t *, void *, size_t, size_t); 78 78 79 79 #endif -
uspace/lib/libc/include/errno.h
r5cf723b r7858bc5f 47 47 #define ERANGE (-263) 48 48 #define EXDEV (-264) 49 #define EIO (-265) 49 50 50 51 #endif -
uspace/srv/fs/fat/Makefile
r5cf723b r7858bc5f 39 39 40 40 LIBS = \ 41 $(LIBC_PREFIX)/libc.a \42 41 $(LIBFS_PREFIX)/libfs.a \ 43 $(LIBBLOCK_PREFIX)/libblock.a 42 $(LIBBLOCK_PREFIX)/libblock.a \ 43 $(LIBC_PREFIX)/libc.a 44 44 45 45 ## Sources -
uspace/srv/fs/fat/fat.h
r5cf723b r7858bc5f 122 122 } __attribute__ ((packed)) fat_bs_t; 123 123 124 #define FAT_BS(b) ((fat_bs_t *)((b)->data))125 126 124 typedef enum { 127 125 FAT_INVALID, -
uspace/srv/fs/fat/fat_ops.c
r5cf723b r7858bc5f 76 76 static void fat_node_sync(fat_node_t *node) 77 77 { 78 block_t *bb, *b; 78 block_t *b; 79 fat_bs_t *bs; 79 80 fat_dentry_t *d; 80 81 uint16_t bps; … … 83 84 assert(node->dirty); 84 85 85 b b = block_get(node->idx->dev_handle, BS_BLOCK, BS_SIZE);86 bps = uint16_t_le2host( FAT_BS(bb)->bps);86 bs = block_bb_get(node->idx->dev_handle); 87 bps = uint16_t_le2host(bs->bps); 87 88 dps = bps / sizeof(fat_dentry_t); 88 89 89 90 /* Read the block that contains the dentry of interest. */ 90 b = _fat_block_get(b b->data, node->idx->dev_handle, node->idx->pfc,91 b = _fat_block_get(bs, node->idx->dev_handle, node->idx->pfc, 91 92 (node->idx->pdi * sizeof(fat_dentry_t)) / bps); 92 93 … … 100 101 b->dirty = true; /* need to sync block */ 101 102 block_put(b); 102 block_put(bb);103 103 } 104 104 … … 109 109 static void *fat_node_get_core(fat_idx_t *idxp) 110 110 { 111 block_t *bb, *b; 111 block_t *b; 112 fat_bs_t *bs; 112 113 fat_dentry_t *d; 113 114 fat_node_t *nodep = NULL; … … 162 163 fat_node_initialize(nodep); 163 164 164 b b = block_get(idxp->dev_handle, BS_BLOCK, BS_SIZE);165 bps = uint16_t_le2host( FAT_BS(bb)->bps);165 bs = block_bb_get(idxp->dev_handle); 166 bps = uint16_t_le2host(bs->bps); 166 167 dps = bps / sizeof(fat_dentry_t); 167 168 168 169 /* Read the block that contains the dentry of interest. */ 169 b = _fat_block_get(b b->data, idxp->dev_handle, idxp->pfc,170 b = _fat_block_get(bs, idxp->dev_handle, idxp->pfc, 170 171 (idxp->pdi * sizeof(fat_dentry_t)) / bps); 171 172 assert(b); … … 184 185 * size of the directory by walking the FAT. 185 186 */ 186 nodep->size = bps * _fat_blcks_get(b b->data, idxp->dev_handle,187 nodep->size = bps * _fat_blcks_get(bs, idxp->dev_handle, 187 188 uint16_t_le2host(d->firstc), NULL); 188 189 } else { … … 195 196 196 197 block_put(b); 197 block_put(bb);198 198 199 199 /* Link the idx structure with the node structure. */ … … 254 254 static void *fat_match(void *prnt, const char *component) 255 255 { 256 fat_bs_t *bs; 256 257 fat_node_t *parentp = (fat_node_t *)prnt; 257 258 char name[FAT_NAME_LEN + 1 + FAT_EXT_LEN + 1]; … … 261 262 unsigned blocks; 262 263 fat_dentry_t *d; 263 block_t *b b, *b;264 block_t *b; 264 265 265 266 futex_down(&parentp->idx->lock); 266 b b = block_get(parentp->idx->dev_handle, BS_BLOCK, BS_SIZE);267 bps = uint16_t_le2host( FAT_BS(bb)->bps);267 bs = block_bb_get(parentp->idx->dev_handle); 268 bps = uint16_t_le2host(bs->bps); 268 269 dps = bps / sizeof(fat_dentry_t); 269 270 blocks = parentp->size / bps; 270 271 for (i = 0; i < blocks; i++) { 271 b = fat_block_get(b b->data, parentp, i);272 b = fat_block_get(bs, parentp, i); 272 273 for (j = 0; j < dps; j++) { 273 274 d = ((fat_dentry_t *)b->data) + j; … … 277 278 case FAT_DENTRY_LAST: 278 279 block_put(b); 279 block_put(bb);280 280 futex_up(&parentp->idx->lock); 281 281 return NULL; … … 304 304 */ 305 305 block_put(b); 306 block_put(bb);307 306 return NULL; 308 307 } … … 310 309 futex_up(&idx->lock); 311 310 block_put(b); 312 block_put(bb);313 311 return node; 314 312 } … … 316 314 block_put(b); 317 315 } 318 block_put(bb);319 316 320 317 futex_up(&parentp->idx->lock); … … 342 339 static bool fat_has_children(void *node) 343 340 { 341 fat_bs_t *bs; 344 342 fat_node_t *nodep = (fat_node_t *)node; 345 343 unsigned bps; 346 344 unsigned dps; 347 345 unsigned blocks; 348 block_t *b b, *b;346 block_t *b; 349 347 unsigned i, j; 350 348 … … 353 351 354 352 futex_down(&nodep->idx->lock); 355 b b = block_get(nodep->idx->dev_handle, BS_BLOCK, BS_SIZE);356 bps = uint16_t_le2host( FAT_BS(bb)->bps);353 bs = block_bb_get(nodep->idx->dev_handle); 354 bps = uint16_t_le2host(bs->bps); 357 355 dps = bps / sizeof(fat_dentry_t); 358 356 … … 362 360 fat_dentry_t *d; 363 361 364 b = fat_block_get(b b->data, nodep, i);362 b = fat_block_get(bs, nodep, i); 365 363 for (j = 0; j < dps; j++) { 366 364 d = ((fat_dentry_t *)b->data) + j; … … 370 368 case FAT_DENTRY_LAST: 371 369 block_put(b); 372 block_put(bb);373 370 futex_up(&nodep->idx->lock); 374 371 return false; … … 376 373 case FAT_DENTRY_VALID: 377 374 block_put(b); 378 block_put(bb);379 375 futex_up(&nodep->idx->lock); 380 376 return true; 381 377 } 382 378 block_put(b); 383 block_put(bb);384 379 futex_up(&nodep->idx->lock); 385 380 return true; … … 387 382 block_put(b); 388 383 } 389 block_put(bb);390 384 391 385 futex_up(&nodep->idx->lock); … … 435 429 { 436 430 dev_handle_t dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); 437 block_t *bb;431 fat_bs_t *bs; 438 432 uint16_t bps; 439 433 uint16_t rde; 440 434 int rc; 441 435 442 /* 443 * For now, we don't bother to remember dev_handle, dev_phone or 444 * dev_buffer in some data structure. We use global variables because we 445 * know there will be at most one mount on this file system. 446 * Of course, this is a huge TODO item. 447 */ 448 dev_buffer = mmap(NULL, BS_SIZE, PROTO_READ | PROTO_WRITE, 449 MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); 450 451 if (!dev_buffer) { 452 ipc_answer_0(rid, ENOMEM); 453 return; 454 } 455 456 dev_phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, 457 DEVMAP_CONNECT_TO_DEVICE, dev_handle); 458 459 if (dev_phone < 0) { 460 munmap(dev_buffer, BS_SIZE); 461 ipc_answer_0(rid, dev_phone); 462 return; 463 } 464 465 rc = ipc_share_out_start(dev_phone, dev_buffer, 466 AS_AREA_READ | AS_AREA_WRITE); 436 /* initialize libblock */ 437 rc = block_init(dev_handle, BS_SIZE, BS_BLOCK * BS_SIZE, BS_SIZE); 467 438 if (rc != EOK) { 468 munmap(dev_buffer, BS_SIZE); 469 ipc_answer_0(rid, rc); 470 return; 471 } 472 439 ipc_answer_0(rid, 0); 440 return; 441 } 442 443 /* get the buffer with the boot sector */ 444 bs = block_bb_get(dev_handle); 445 473 446 /* Read the number of root directory entries. */ 474 bb = block_get(dev_handle, BS_BLOCK, BS_SIZE); 475 bps = uint16_t_le2host(FAT_BS(bb)->bps); 476 rde = uint16_t_le2host(FAT_BS(bb)->root_ent_max); 477 block_put(bb); 447 bps = uint16_t_le2host(bs->bps); 448 rde = uint16_t_le2host(bs->root_ent_max); 478 449 479 450 if (bps != BS_SIZE) { 480 munmap(dev_buffer, BS_SIZE);451 block_fini(dev_handle); 481 452 ipc_answer_0(rid, ENOTSUP); 482 453 return; … … 485 456 rc = fat_idx_init_by_dev_handle(dev_handle); 486 457 if (rc != EOK) { 487 munmap(dev_buffer, BS_SIZE);458 block_fini(dev_handle); 488 459 ipc_answer_0(rid, rc); 489 460 return; … … 493 464 fat_node_t *rootp = (fat_node_t *)malloc(sizeof(fat_node_t)); 494 465 if (!rootp) { 495 munmap(dev_buffer, BS_SIZE);466 block_fini(dev_handle); 496 467 fat_idx_fini_by_dev_handle(dev_handle); 497 468 ipc_answer_0(rid, ENOMEM); … … 502 473 fat_idx_t *ridxp = fat_idx_get_by_pos(dev_handle, FAT_CLST_ROOTPAR, 0); 503 474 if (!ridxp) { 504 munmap(dev_buffer, BS_SIZE);475 block_fini(dev_handle); 505 476 free(rootp); 506 477 fat_idx_fini_by_dev_handle(dev_handle); … … 540 511 off_t pos = (off_t)IPC_GET_ARG3(*request); 541 512 fat_node_t *nodep = (fat_node_t *)fat_node_get(dev_handle, index); 513 fat_bs_t *bs; 542 514 uint16_t bps; 543 515 size_t bytes; 544 block_t *b b, *b;516 block_t *b; 545 517 546 518 if (!nodep) { … … 558 530 } 559 531 560 b b = block_get(dev_handle, BS_BLOCK, BS_SIZE);561 bps = uint16_t_le2host( FAT_BS(bb)->bps);532 bs = block_bb_get(dev_handle); 533 bps = uint16_t_le2host(bs->bps); 562 534 563 535 if (nodep->type == FAT_FILE) { … … 568 540 */ 569 541 bytes = min(len, bps - pos % bps); 570 b = fat_block_get(b b->data, nodep, pos / bps);542 b = fat_block_get(bs, nodep, pos / bps); 571 543 (void) ipc_data_read_finalize(callid, b->data + pos % bps, 572 544 bytes); … … 592 564 off_t o; 593 565 594 b = fat_block_get(b b->data, nodep, bnum);566 b = fat_block_get(bs, nodep, bnum); 595 567 for (o = pos % (bps / sizeof(fat_dentry_t)); 596 568 o < bps / sizeof(fat_dentry_t); … … 615 587 miss: 616 588 fat_node_put(nodep); 617 block_put(bb);618 589 ipc_answer_0(callid, ENOENT); 619 590 ipc_answer_1(rid, ENOENT, 0); … … 625 596 626 597 fat_node_put(nodep); 627 block_put(bb);628 598 ipc_answer_1(rid, EOK, (ipcarg_t)bytes); 629 599 } … … 635 605 off_t pos = (off_t)IPC_GET_ARG3(*request); 636 606 fat_node_t *nodep = (fat_node_t *)fat_node_get(dev_handle, index); 607 fat_bs_t *bs; 637 608 size_t bytes; 638 block_t *b , *bb;609 block_t *b; 639 610 uint16_t bps; 640 611 unsigned spc; … … 671 642 bytes = min(len, bps - pos % bps); 672 643 673 b b = block_get(dev_handle, BS_BLOCK, BS_SIZE);674 bps = uint16_t_le2host( FAT_BS(bb)->bps);675 spc = FAT_BS(bb)->spc;644 bs = block_bb_get(dev_handle); 645 bps = uint16_t_le2host(bs->bps); 646 spc = bs->spc; 676 647 677 648 boundary = ROUND_UP(nodep->size, bps * spc); … … 683 654 * next block size boundary. 684 655 */ 685 fat_fill_gap(b b->data, nodep, FAT_CLST_RES0, pos);686 b = fat_block_get(b b->data, nodep, pos / bps);656 fat_fill_gap(bs, nodep, FAT_CLST_RES0, pos); 657 b = fat_block_get(bs, nodep, pos / bps); 687 658 (void) ipc_data_write_finalize(callid, b->data + pos % bps, 688 659 bytes); … … 694 665 } 695 666 fat_node_put(nodep); 696 block_put(bb);697 667 ipc_answer_1(rid, EOK, bytes); 698 668 return; … … 709 679 bps * spc; 710 680 /* create an independent chain of nclsts clusters in all FATs */ 711 status = fat_alloc_clusters(b b->data, dev_handle, nclsts, &mcl,681 status = fat_alloc_clusters(bs, dev_handle, nclsts, &mcl, 712 682 &lcl); 713 683 if (status != EOK) { 714 684 /* could not allocate a chain of nclsts clusters */ 715 685 fat_node_put(nodep); 716 block_put(bb);717 686 ipc_answer_0(callid, status); 718 687 ipc_answer_0(rid, status); … … 720 689 } 721 690 /* zero fill any gaps */ 722 fat_fill_gap(b b->data, nodep, mcl, pos);723 b = _fat_block_get(b b->data, dev_handle, lcl,691 fat_fill_gap(bs, nodep, mcl, pos); 692 b = _fat_block_get(bs, dev_handle, lcl, 724 693 (pos / bps) % spc); 725 694 (void) ipc_data_write_finalize(callid, b->data + pos % bps, … … 731 700 * node's cluster chain. 732 701 */ 733 fat_append_clusters(b b->data, nodep, mcl);702 fat_append_clusters(bs, nodep, mcl); 734 703 nodep->size = pos + bytes; 735 704 nodep->dirty = true; /* need to sync node */ 736 705 fat_node_put(nodep); 737 block_put(bb);738 706 ipc_answer_1(rid, EOK, bytes); 739 707 return; -
uspace/srv/fs/tmpfs/Makefile
r5cf723b r7858bc5f 39 39 40 40 LIBS = \ 41 $(LIBC_PREFIX)/libc.a \42 41 $(LIBFS_PREFIX)/libfs.a \ 43 $(LIBBLOCK_PREFIX)/libblock.a 42 $(LIBBLOCK_PREFIX)/libblock.a \ 43 $(LIBC_PREFIX)/libc.a 44 44 45 45 ## Sources -
uspace/srv/fs/tmpfs/tmpfs_dump.c
r5cf723b r7858bc5f 39 39 #include "tmpfs.h" 40 40 #include "../../vfs/vfs.h" 41 #include <ipc/ipc.h>42 #include <async.h>43 41 #include <errno.h> 44 42 #include <stdlib.h> … … 47 45 #include <as.h> 48 46 #include <libblock.h> 49 #include <ipc/services.h>50 #include <ipc/devmap.h>51 #include <sys/mman.h>52 47 #include <byteorder.h> 53 48 … … 60 55 61 56 static bool 62 tmpfs_restore_recursion(int phone, void *block, off_t *bufpos, size_t *buflen,63 off_t *pos,tmpfs_dentry_t *parent)57 tmpfs_restore_recursion(int dev, off_t *bufpos, size_t *buflen, off_t *pos, 58 tmpfs_dentry_t *parent) 64 59 { 65 60 struct rdentry entry; … … 71 66 uint32_t size; 72 67 73 if (!block read(phone, block, bufpos, buflen, pos, &entry,74 sizeof(entry),TMPFS_BLOCK_SIZE))68 if (!block_read(dev, bufpos, buflen, pos, &entry, sizeof(entry), 69 TMPFS_BLOCK_SIZE)) 75 70 return false; 76 71 … … 91 86 } 92 87 93 if (!block read(phone, block, bufpos, buflen, pos, fname,88 if (!block_read(dev, bufpos, buflen, pos, fname, 94 89 entry.len, TMPFS_BLOCK_SIZE)) { 95 90 ops->destroy((void *) node); … … 106 101 free(fname); 107 102 108 if (!block read(phone, block, bufpos, buflen, pos, &size,103 if (!block_read(dev, bufpos, buflen, pos, &size, 109 104 sizeof(size), TMPFS_BLOCK_SIZE)) 110 105 return false; … … 117 112 118 113 node->size = size; 119 if (!block read(phone, block, bufpos, buflen, pos,120 node->data,size, TMPFS_BLOCK_SIZE))114 if (!block_read(dev, bufpos, buflen, pos, node->data, 115 size, TMPFS_BLOCK_SIZE)) 121 116 return false; 122 117 … … 133 128 } 134 129 135 if (!block read(phone, block, bufpos, buflen, pos, fname,136 entry.len, TMPFS_BLOCK_SIZE)) {130 if (!block_read(dev, bufpos, buflen, pos, 131 fname, entry.len, TMPFS_BLOCK_SIZE)) { 137 132 ops->destroy((void *) node); 138 133 free(fname); … … 148 143 free(fname); 149 144 150 if (!tmpfs_restore_recursion( phone, block, bufpos,151 buflen, pos,node))145 if (!tmpfs_restore_recursion(dev, bufpos, buflen, pos, 146 node)) 152 147 return false; 153 148 … … 164 159 { 165 160 libfs_ops_t *ops = &tmpfs_libfs_ops; 161 int rc; 166 162 167 void *block = mmap(NULL, TMPFS_BLOCK_SIZE, 168 PROTO_READ | PROTO_WRITE, MAP_ANONYMOUS | MAP_PRIVATE, 0, 0); 169 170 if (block == NULL) 171 return false; 172 173 int phone = ipc_connect_me_to(PHONE_NS, SERVICE_DEVMAP, 174 DEVMAP_CONNECT_TO_DEVICE, dev); 175 176 if (phone < 0) { 177 munmap(block, TMPFS_BLOCK_SIZE); 178 return false; 179 } 180 181 if (ipc_share_out_start(phone, block, AS_AREA_READ | AS_AREA_WRITE) != 182 EOK) 183 goto error; 163 rc = block_init(dev, TMPFS_BLOCK_SIZE, 0, 0); 164 if (rc != EOK) 165 return false; 184 166 185 167 off_t bufpos = 0; … … 188 170 189 171 char tag[6]; 190 if (!block read(phone, block, &bufpos, &buflen, &pos, tag, 5,172 if (!block_read(dev, &bufpos, &buflen, &pos, tag, 5, 191 173 TMPFS_BLOCK_SIZE)) 192 174 goto error; … … 196 178 goto error; 197 179 198 if (!tmpfs_restore_recursion( phone, block, &bufpos, &buflen, &pos,180 if (!tmpfs_restore_recursion(dev, &bufpos, &buflen, &pos, 199 181 ops->root_get(dev))) 200 182 goto error; 201 183 202 ipc_hangup(phone); 203 munmap(block, TMPFS_BLOCK_SIZE); 184 block_fini(dev); 204 185 return true; 205 186 206 187 error: 207 ipc_hangup(phone); 208 munmap(block, TMPFS_BLOCK_SIZE); 188 block_fini(dev); 209 189 return false; 210 190 }
Note:
See TracChangeset
for help on using the changeset viewer.