Changeset ce8c848 in mainline for uspace/lib
- Timestamp:
- 2010-01-25T22:26:16Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bb0d3d24
- Parents:
- 64af8f1 (diff), c888102 (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:
-
- 3 edited
-
libc/include/ipc/vfs.h (modified) (5 diffs)
-
libfs/libfs.c (modified) (3 diffs)
-
libfs/libfs.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/ipc/vfs.h
r64af8f1 rce8c848 101 101 * No lookup flags used. 102 102 */ 103 #define L_NONE 0103 #define L_NONE 0 104 104 105 105 /** … … 108 108 * with L_DIRECTORY. 109 109 */ 110 #define L_FILE 1110 #define L_FILE 1 111 111 112 112 /** 113 * Lookup wil succeed only if the object is a directory. If L_CREATE is113 * Lookup will succeed only if the object is a directory. If L_CREATE is 114 114 * specified, an empty directory will be created. This flag is mutually 115 115 * exclusive with L_FILE. 116 116 */ 117 #define L_DIRECTORY 2 117 #define L_DIRECTORY 2 118 119 /** 120 * Lookup will succeed only if the object is a root directory. The flag is 121 * mutually exclusive with L_FILE and L_MP. 122 */ 123 #define L_ROOT 4 124 125 /** 126 * Lookup will succeed only if the object is a mount point. The flag is mutually 127 * exclusive with L_FILE and L_ROOT. 128 */ 129 #define L_MP 8 130 118 131 119 132 /** … … 121 134 * object already exists. L_EXCLUSIVE is implied when L_DIRECTORY is used. 122 135 */ 123 #define L_EXCLUSIVE 4136 #define L_EXCLUSIVE 16 124 137 125 138 /** 126 139 * L_CREATE is used for creating both regular files and directories. 127 140 */ 128 #define L_CREATE 8141 #define L_CREATE 32 129 142 130 143 /** 131 144 * L_LINK is used for linking to an already existing nodes. 132 145 */ 133 #define L_LINK 16146 #define L_LINK 64 134 147 135 148 /** … … 138 151 * VFS_UNLINK. 139 152 */ 140 #define L_UNLINK 32153 #define L_UNLINK 128 141 154 142 155 /** … … 146 159 * client. 147 160 */ 148 #define L_OPEN 64 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 161 #define L_OPEN 256 156 162 157 163 #endif -
uspace/lib/libfs/libfs.c
r64af8f1 rce8c848 224 224 ipc_answer_3(rid, rc, IPC_GET_ARG1(answer), IPC_GET_ARG2(answer), 225 225 IPC_GET_ARG3(answer)); 226 } 227 228 void libfs_unmount(libfs_ops_t *ops, ipc_callid_t rid, ipc_call_t *request) 229 { 230 dev_handle_t mp_dev_handle = (dev_handle_t) IPC_GET_ARG1(*request); 231 fs_index_t mp_fs_index = (fs_index_t) IPC_GET_ARG2(*request); 232 fs_node_t *fn; 233 int res; 234 235 res = ops->node_get(&fn, mp_dev_handle, mp_fs_index); 236 if ((res != EOK) || (!fn)) { 237 ipc_answer_0(rid, combine_rc(res, ENOENT)); 238 return; 239 } 240 241 /* 242 * We are clearly expecting to find the mount point active. 243 */ 244 if (!fn->mp_data.mp_active) { 245 (void) ops->node_put(fn); 246 ipc_answer_0(rid, EINVAL); 247 return; 248 } 249 250 /* 251 * Tell the mounted file system to unmount. 252 */ 253 res = async_req_1_0(fn->mp_data.phone, VFS_OUT_UNMOUNTED, 254 fn->mp_data.dev_handle); 255 256 /* 257 * If everything went well, perform the clean-up on our side. 258 */ 259 if (res == EOK) { 260 ipc_hangup(fn->mp_data.phone); 261 fn->mp_data.mp_active = false; 262 fn->mp_data.fs_handle = 0; 263 fn->mp_data.dev_handle = 0; 264 fn->mp_data.phone = 0; 265 /* Drop the reference created in libfs_mount(). */ 266 (void) ops->node_put(fn); 267 } 268 269 (void) ops->node_put(fn); 270 ipc_answer_0(rid, res); 226 271 } 227 272 … … 315 360 316 361 if ((tmp) && (tmp->mp_data.mp_active) && 317 (!(lflag & L_ NOCROSS_LAST_MP) || (next <= last))) {362 (!(lflag & L_MP) || (next <= last))) { 318 363 if (next > last) 319 364 next = last = first; … … 486 531 goto out; 487 532 } 533 534 if ((lflag & L_ROOT) && par) { 535 ipc_answer_0(rid, EINVAL); 536 goto out; 537 } 488 538 489 539 out_with_answer: -
uspace/lib/libfs/libfs.h
r64af8f1 rce8c848 95 95 96 96 extern void libfs_mount(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); 97 extern void libfs_unmount(libfs_ops_t *, ipc_callid_t, ipc_call_t *); 97 98 extern void libfs_lookup(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *); 98 99 extern void libfs_stat(libfs_ops_t *, fs_handle_t, ipc_callid_t, ipc_call_t *);
Note:
See TracChangeset
for help on using the changeset viewer.
