Rev 2678 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2678 | Rev 2679 | ||
---|---|---|---|
Line 91... | Line 91... | ||
91 | /* |
91 | /* |
92 | * Avoid the race condition in which the file can be deleted before we |
92 | * Avoid the race condition in which the file can be deleted before we |
93 | * find/create-and-lock the VFS node corresponding to the looked-up |
93 | * find/create-and-lock the VFS node corresponding to the looked-up |
94 | * triplet. |
94 | * triplet. |
95 | */ |
95 | */ |
96 | futex_down(&unlink_futex); |
96 | futex_down(&namespace_futex); |
97 | 97 | ||
98 | /* |
98 | /* |
99 | * The path is now populated and we can call vfs_lookup_internal(). |
99 | * The path is now populated and we can call vfs_lookup_internal(). |
100 | */ |
100 | */ |
101 | vfs_triplet_t triplet; |
101 | vfs_triplet_t triplet; |
102 | rc = vfs_lookup_internal(path, size, &triplet, NULL); |
102 | rc = vfs_lookup_internal(path, size, &triplet, NULL); |
103 | if (rc) { |
103 | if (rc) { |
104 | futex_up(&unlink_futex); |
104 | futex_up(&namespace_futex); |
105 | ipc_answer_0(rid, rc); |
105 | ipc_answer_0(rid, rc); |
106 | free(path); |
106 | free(path); |
107 | return; |
107 | return; |
108 | } |
108 | } |
109 | 109 | ||
Line 111... | Line 111... | ||
111 | * Path is no longer needed. |
111 | * Path is no longer needed. |
112 | */ |
112 | */ |
113 | free(path); |
113 | free(path); |
114 | 114 | ||
115 | vfs_node_t *node = vfs_node_get(&triplet); |
115 | vfs_node_t *node = vfs_node_get(&triplet); |
116 | futex_up(&unlink_futex); |
116 | futex_up(&namespace_futex); |
117 | 117 | ||
118 | /* |
118 | /* |
119 | * Get ourselves a file descriptor and the corresponding vfs_file_t |
119 | * Get ourselves a file descriptor and the corresponding vfs_file_t |
120 | * structure. |
120 | * structure. |
121 | */ |
121 | */ |