equal
deleted
inserted
replaced
180 |
180 |
181 kmem_cache_t *spa_buffer_pool; |
181 kmem_cache_t *spa_buffer_pool; |
182 int spa_mode; |
182 int spa_mode; |
183 |
183 |
184 #ifdef ZFS_DEBUG |
184 #ifdef ZFS_DEBUG |
185 int zfs_flags = ~0; |
185 /* Everything except dprintf is on by default in debug builds */ |
|
186 int zfs_flags = ~ZFS_DEBUG_DPRINTF; |
186 #else |
187 #else |
187 int zfs_flags = 0; |
188 int zfs_flags = 0; |
188 #endif |
189 #endif |
189 |
190 |
190 /* |
191 /* |
209 spa_t * |
210 spa_t * |
210 spa_lookup(const char *name) |
211 spa_lookup(const char *name) |
211 { |
212 { |
212 spa_t search, *spa; |
213 spa_t search, *spa; |
213 avl_index_t where; |
214 avl_index_t where; |
|
215 char c; |
|
216 char *cp; |
214 |
217 |
215 ASSERT(MUTEX_HELD(&spa_namespace_lock)); |
218 ASSERT(MUTEX_HELD(&spa_namespace_lock)); |
|
219 |
|
220 /* |
|
221 * If it's a full dataset name, figure out the pool name and |
|
222 * just use that. |
|
223 */ |
|
224 cp = strpbrk(name, "/@"); |
|
225 if (cp) { |
|
226 c = *cp; |
|
227 *cp = '\0'; |
|
228 } |
216 |
229 |
217 search.spa_name = (char *)name; |
230 search.spa_name = (char *)name; |
218 spa = avl_find(&spa_namespace_avl, &search, &where); |
231 spa = avl_find(&spa_namespace_avl, &search, &where); |
|
232 |
|
233 if (cp) |
|
234 *cp = c; |
219 |
235 |
220 return (spa); |
236 return (spa); |
221 } |
237 } |
222 |
238 |
223 /* |
239 /* |