Rev 3308 | Rev 3314 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3308 | Rev 3312 | ||
---|---|---|---|
Line 289... | Line 289... | ||
289 | */ |
289 | */ |
290 | static void *fat_node_get_core(fat_idx_t *idxp) |
290 | static void *fat_node_get_core(fat_idx_t *idxp) |
291 | { |
291 | { |
292 | block_t *b; |
292 | block_t *b; |
293 | fat_dentry_t *d; |
293 | fat_dentry_t *d; |
294 | fat_node_t *nodep; |
294 | fat_node_t *nodep = NULL; |
295 | unsigned bps; |
295 | unsigned bps; |
296 | unsigned dps; |
296 | unsigned dps; |
297 | 297 | ||
298 | if (idxp->nodep) { |
298 | if (idxp->nodep) { |
299 | /* |
299 | /* |
300 | * We are lucky. |
300 | * We are lucky. |
301 | * The node is already instantiated in memory. |
301 | * The node is already instantiated in memory. |
302 | */ |
302 | */ |
303 | futex_down(&idxp->nodep->lock); |
303 | futex_down(&idxp->nodep->lock); |
304 | if (!idxp->nodep->refcnt++) |
304 | if (!idxp->nodep->refcnt++) |
305 | list_remove(&nodep->ffn_link); |
305 | list_remove(&idxp->nodep->ffn_link); |
306 | futex_up(&idxp->nodep->lock); |
306 | futex_up(&idxp->nodep->lock); |
307 | return idxp->nodep; |
307 | return idxp->nodep; |
308 | } |
308 | } |
309 | 309 | ||
310 | /* |
310 | /* |