Rev 2679 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2679 | Rev 2681 | ||
---|---|---|---|
Line 180... | Line 180... | ||
180 | futex_down(&rootfs_futex); |
180 | futex_down(&rootfs_futex); |
181 | if (rootfs.fs_handle) { |
181 | if (rootfs.fs_handle) { |
182 | /* |
182 | /* |
183 | * We already have the root FS. |
183 | * We already have the root FS. |
184 | */ |
184 | */ |
185 | futex_down(&namespace_futex); |
185 | rwlock_writer_lock(&namespace_rwlock); |
186 | rc = vfs_lookup_internal(buf, size, &mp, NULL); |
186 | rc = vfs_lookup_internal(buf, size, &mp, NULL); |
187 | if (rc != EOK) { |
187 | if (rc != EOK) { |
188 | /* |
188 | /* |
189 | * The lookup failed for some reason. |
189 | * The lookup failed for some reason. |
190 | */ |
190 | */ |
191 | futex_up(&namespace_futex); |
191 | rwlock_writer_unlock(&namespace_rwlock); |
192 | futex_up(&rootfs_futex); |
192 | futex_up(&rootfs_futex); |
193 | vfs_node_put(mr_node); /* failed -> drop reference */ |
193 | vfs_node_put(mr_node); /* failed -> drop reference */ |
194 | free(buf); |
194 | free(buf); |
195 | ipc_answer_0(rid, rc); |
195 | ipc_answer_0(rid, rc); |
196 | return; |
196 | return; |
197 | } |
197 | } |
198 | mp_node = vfs_node_get(&mp); |
198 | mp_node = vfs_node_get(&mp); |
199 | if (!mp_node) { |
199 | if (!mp_node) { |
200 | futex_up(&namespace_futex); |
200 | rwlock_writer_unlock(&namespace_rwlock); |
201 | futex_up(&rootfs_futex); |
201 | futex_up(&rootfs_futex); |
202 | vfs_node_put(mr_node); /* failed -> drop reference */ |
202 | vfs_node_put(mr_node); /* failed -> drop reference */ |
203 | free(buf); |
203 | free(buf); |
204 | ipc_answer_0(rid, ENOMEM); |
204 | ipc_answer_0(rid, ENOMEM); |
205 | return; |
205 | return; |
Line 207... | Line 207... | ||
207 | /* |
207 | /* |
208 | * Now we hold a reference to mp_node. |
208 | * Now we hold a reference to mp_node. |
209 | * It will be dropped upon the corresponding VFS_UNMOUNT. |
209 | * It will be dropped upon the corresponding VFS_UNMOUNT. |
210 | * This prevents the mount point from being deleted. |
210 | * This prevents the mount point from being deleted. |
211 | */ |
211 | */ |
212 | futex_up(&namespace_futex); |
212 | rwlock_writer_unlock(&namespace_rwlock); |
213 | } else { |
213 | } else { |
214 | /* |
214 | /* |
215 | * We still don't have the root file system mounted. |
215 | * We still don't have the root file system mounted. |
216 | */ |
216 | */ |
217 | if ((size == 1) && (buf[0] == '/')) { |
217 | if ((size == 1) && (buf[0] == '/')) { |