Changes in uspace/srv/fs/tmpfs/tmpfs_dump.c [6408be3:54e4479] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/fs/tmpfs/tmpfs_dump.c
r6408be3 r54e4479 47 47 #include <byteorder.h> 48 48 49 #define TMPFS_ BLOCK_SIZE102449 #define TMPFS_COMM_SIZE 1024 50 50 51 51 struct rdentry { … … 69 69 70 70 if (block_seqread(dev, bufpos, buflen, pos, &entry, 71 sizeof(entry) , TMPFS_BLOCK_SIZE) != EOK)71 sizeof(entry)) != EOK) 72 72 return false; 73 73 … … 82 82 return false; 83 83 84 fn = ops->create(dev, L_FILE);85 if ( fn == NULL) {84 rc = ops->create(&fn, dev, L_FILE); 85 if (rc != EOK || fn == NULL) { 86 86 free(fname); 87 87 return false; … … 89 89 90 90 if (block_seqread(dev, bufpos, buflen, pos, fname, 91 entry.len , TMPFS_BLOCK_SIZE) != EOK) {92 ops->destroy(fn);91 entry.len) != EOK) { 92 (void) ops->destroy(fn); 93 93 free(fname); 94 94 return false; … … 98 98 rc = ops->link(pfn, fn, fname); 99 99 if (rc != EOK) { 100 ops->destroy(fn);100 (void) ops->destroy(fn); 101 101 free(fname); 102 102 return false; … … 105 105 106 106 if (block_seqread(dev, bufpos, buflen, pos, &size, 107 sizeof(size) , TMPFS_BLOCK_SIZE) != EOK)107 sizeof(size)) != EOK) 108 108 return false; 109 109 … … 117 117 nodep->size = size; 118 118 if (block_seqread(dev, bufpos, buflen, pos, nodep->data, 119 size , TMPFS_BLOCK_SIZE) != EOK)119 size) != EOK) 120 120 return false; 121 121 … … 126 126 return false; 127 127 128 fn = ops->create(dev, L_DIRECTORY);129 if ( fn == NULL) {128 rc = ops->create(&fn, dev, L_DIRECTORY); 129 if (rc != EOK || fn == NULL) { 130 130 free(fname); 131 131 return false; … … 133 133 134 134 if (block_seqread(dev, bufpos, buflen, pos, fname, 135 entry.len , TMPFS_BLOCK_SIZE) != EOK) {136 ops->destroy(fn);135 entry.len) != EOK) { 136 (void) ops->destroy(fn); 137 137 free(fname); 138 138 return false; … … 142 142 rc = ops->link(pfn, fn, fname); 143 143 if (rc != EOK) { 144 ops->destroy(fn);144 (void) ops->destroy(fn); 145 145 free(fname); 146 146 return false; … … 164 164 { 165 165 libfs_ops_t *ops = &tmpfs_libfs_ops; 166 fs_node_t *fn; 166 167 int rc; 167 168 168 rc = block_init(dev, TMPFS_ BLOCK_SIZE);169 rc = block_init(dev, TMPFS_COMM_SIZE); 169 170 if (rc != EOK) 170 171 return false; … … 175 176 176 177 char tag[6]; 177 if (block_seqread(dev, &bufpos, &buflen, &pos, tag, 5, 178 TMPFS_BLOCK_SIZE) != EOK) 178 if (block_seqread(dev, &bufpos, &buflen, &pos, tag, 5) != EOK) 179 179 goto error; 180 180 … … 183 183 goto error; 184 184 185 if (!tmpfs_restore_recursion(dev, &bufpos, &buflen, &pos, 186 ops->root_get(dev))) 185 rc = ops->root_get(&fn, dev); 186 if (rc != EOK) 187 goto error; 188 189 if (!tmpfs_restore_recursion(dev, &bufpos, &buflen, &pos, fn)) 187 190 goto error; 188 191
Note:
See TracChangeset
for help on using the changeset viewer.