Changeset e095644 in mainline for uspace/lib
- Timestamp:
- 2010-01-24T17:32:20Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 50fda24
- Parents:
- fea0ce6 (diff), ae75e2e3 (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. - Location:
- uspace/lib
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/generic/adt/hash_table.c
rfea0ce6 re095644 193 193 } 194 194 195 /** Apply fucntion to all items in hash table. 196 * 197 * @param h Hash table. 198 * @param f Function to be applied. 199 * @param arg Argument to be passed to the function. 200 */ 201 void 202 hash_table_apply(hash_table_t *h, void (*f)(link_t *, void *), void *arg) 203 { 204 hash_index_t bucket; 205 link_t *cur; 206 207 for (bucket = 0; bucket < h->entries; bucket++) { 208 for (cur = h->entry[bucket].next; cur != &h->entry[bucket]; 209 cur = cur->next) { 210 f(cur, arg); 211 } 212 } 213 } 214 195 215 /** @} 196 216 */ -
uspace/lib/libc/generic/vfs/vfs.c
rfea0ce6 re095644 197 197 } 198 198 199 int unmount(const char *mp) 200 { 201 ipcarg_t rc; 202 ipcarg_t rc_orig; 203 aid_t req; 204 size_t mpa_size; 205 char *mpa; 206 207 mpa = absolutize(mp, &mpa_size); 208 if (!mpa) 209 return ENOMEM; 210 211 futex_down(&vfs_phone_futex); 212 async_serialize_start(); 213 vfs_connect(); 214 215 req = async_send_0(vfs_phone, VFS_IN_UNMOUNT, NULL); 216 rc = async_data_write_start(vfs_phone, (void *) mpa, mpa_size); 217 if (rc != EOK) { 218 async_wait_for(req, &rc_orig); 219 async_serialize_end(); 220 futex_up(&vfs_phone_futex); 221 free(mpa); 222 if (rc_orig == EOK) 223 return (int) rc; 224 else 225 return (int) rc_orig; 226 } 227 228 229 async_wait_for(req, &rc); 230 async_serialize_end(); 231 futex_up(&vfs_phone_futex); 232 free(mpa); 233 234 return (int) rc; 235 } 236 199 237 static int open_internal(const char *abs, size_t abs_size, int lflag, int oflag) 200 238 { -
uspace/lib/libc/include/adt/hash_table.h
rfea0ce6 re095644 88 88 extern void hash_table_remove(hash_table_t *, unsigned long [], hash_count_t); 89 89 extern void hash_table_destroy(hash_table_t *); 90 extern void hash_table_apply(hash_table_t *, void (*)(link_t *, void *), 91 void *); 90 92 91 93 #endif -
uspace/lib/libc/include/ipc/vfs.h
rfea0ce6 re095644 86 86 VFS_OUT_MOUNTED, 87 87 VFS_OUT_UNMOUNT, 88 VFS_OUT_UNMOUNTED, 88 89 VFS_OUT_SYNC, 89 90 VFS_OUT_STAT, … … 140 141 141 142 /** 142 * L_OPEN is used to indicate that the lookup operation is a part of VFS_ OPEN143 * L_OPEN is used to indicate that the lookup operation is a part of VFS_IN_OPEN 143 144 * call from the client. This means that the server might allocate some 144 145 * resources for the opened file. This flag cannot be passed directly by the … … 147 148 #define L_OPEN 64 148 149 150 /** 151 * L_NOCROSS_LAST_MP is used exclusively during the VFS_IN_UNMOUNT operation. It 152 * tells the lookup routine not to cross the last mount point in the lookup 153 * path. 154 */ 155 #define L_NOCROSS_LAST_MP 128 156 149 157 #endif 150 158 -
uspace/lib/libc/include/vfs/vfs.h
rfea0ce6 re095644 55 55 extern int mount(const char *, const char *, const char *, const char *, 56 56 unsigned int); 57 extern int unmount(const char *); 57 58 58 59 extern void __stdio_init(int filc, fdi_node_t *filv[]); -
uspace/lib/libfs/libfs.c
rfea0ce6 re095644 304 304 on_error(rc, goto out_with_answer); 305 305 306 if ((tmp) && (tmp->mp_data.mp_active)) { 306 /* 307 * If the matching component is a mount point, there are two 308 * legitimate semantics of the lookup operation. The first is 309 * the commonly used one in which the lookup crosses each mount 310 * point into the mounted file system. The second semantics is 311 * used mostly during unmount() and differs from the first one 312 * only in that the last mount point in the looked up path, 313 * which is also its last component, is not crossed. 314 */ 315 316 if ((tmp) && (tmp->mp_data.mp_active) && 317 (!(lflag & L_NOCROSS_LAST_MP) || (next <= last))) { 307 318 if (next > last) 308 319 next = last = first;
Note:
See TracChangeset
for help on using the changeset viewer.