Changeset 26e7d6d in mainline for uspace/srv/fs/tmpfs/tmpfs_dump.c
- Timestamp:
- 2011-09-19T16:31:00Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a347a11
- Parents:
- 3842a955 (diff), 086290d (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs_dump.c
r3842a955 r26e7d6d 55 55 56 56 static bool 57 tmpfs_restore_recursion( devmap_handle_t dev, size_t *bufpos, size_t *buflen,57 tmpfs_restore_recursion(service_id_t dsid, size_t *bufpos, size_t *buflen, 58 58 aoff64_t *pos, fs_node_t *pfn) 59 59 { … … 68 68 uint32_t size; 69 69 70 if (block_seqread(d ev, bufpos, buflen, pos, &entry,70 if (block_seqread(dsid, bufpos, buflen, pos, &entry, 71 71 sizeof(entry)) != EOK) 72 72 return false; … … 82 82 return false; 83 83 84 rc = ops->create(&fn, d ev, L_FILE);84 rc = ops->create(&fn, dsid, L_FILE); 85 85 if (rc != EOK || fn == NULL) { 86 86 free(fname); … … 88 88 } 89 89 90 if (block_seqread(d ev, bufpos, buflen, pos, fname,90 if (block_seqread(dsid, bufpos, buflen, pos, fname, 91 91 entry.len) != EOK) { 92 92 (void) ops->destroy(fn); … … 104 104 free(fname); 105 105 106 if (block_seqread(d ev, bufpos, buflen, pos, &size,106 if (block_seqread(dsid, bufpos, buflen, pos, &size, 107 107 sizeof(size)) != EOK) 108 108 return false; … … 116 116 117 117 nodep->size = size; 118 if (block_seqread(d ev, bufpos, buflen, pos, nodep->data,118 if (block_seqread(dsid, bufpos, buflen, pos, nodep->data, 119 119 size) != EOK) 120 120 return false; … … 126 126 return false; 127 127 128 rc = ops->create(&fn, d ev, L_DIRECTORY);128 rc = ops->create(&fn, dsid, L_DIRECTORY); 129 129 if (rc != EOK || fn == NULL) { 130 130 free(fname); … … 132 132 } 133 133 134 if (block_seqread(d ev, bufpos, buflen, pos, fname,134 if (block_seqread(dsid, bufpos, buflen, pos, fname, 135 135 entry.len) != EOK) { 136 136 (void) ops->destroy(fn); … … 148 148 free(fname); 149 149 150 if (!tmpfs_restore_recursion(d ev, bufpos, buflen, pos,150 if (!tmpfs_restore_recursion(dsid, bufpos, buflen, pos, 151 151 fn)) 152 152 return false; … … 161 161 } 162 162 163 bool tmpfs_restore( devmap_handle_t dev)163 bool tmpfs_restore(service_id_t dsid) 164 164 { 165 165 libfs_ops_t *ops = &tmpfs_libfs_ops; … … 167 167 int rc; 168 168 169 rc = block_init(EXCHANGE_SERIALIZE, d ev, TMPFS_COMM_SIZE);169 rc = block_init(EXCHANGE_SERIALIZE, dsid, TMPFS_COMM_SIZE); 170 170 if (rc != EOK) 171 171 return false; … … 176 176 177 177 char tag[6]; 178 if (block_seqread(d ev, &bufpos, &buflen, &pos, tag, 5) != EOK)178 if (block_seqread(dsid, &bufpos, &buflen, &pos, tag, 5) != EOK) 179 179 goto error; 180 180 … … 183 183 goto error; 184 184 185 rc = ops->root_get(&fn, d ev);185 rc = ops->root_get(&fn, dsid); 186 186 if (rc != EOK) 187 187 goto error; 188 188 189 if (!tmpfs_restore_recursion(d ev, &bufpos, &buflen, &pos, fn))190 goto error; 191 192 block_fini(d ev);189 if (!tmpfs_restore_recursion(dsid, &bufpos, &buflen, &pos, fn)) 190 goto error; 191 192 block_fini(dsid); 193 193 return true; 194 194 195 195 error: 196 block_fini(d ev);196 block_fini(dsid); 197 197 return false; 198 198 }
Note:
See TracChangeset
for help on using the changeset viewer.