diff options
Diffstat (limited to 'fs/afs/vlocation.c')
| -rw-r--r-- | fs/afs/vlocation.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/afs/vlocation.c b/fs/afs/vlocation.c index eced20618ecc..782ee7c600ca 100644 --- a/fs/afs/vlocation.c +++ b/fs/afs/vlocation.c | |||
| @@ -281,11 +281,10 @@ int afs_vlocation_lookup(struct afs_cell *cell, | |||
| 281 | spin_unlock(&cell->vl_gylock); | 281 | spin_unlock(&cell->vl_gylock); |
| 282 | 282 | ||
| 283 | /* not in the cell's in-memory lists - create a new record */ | 283 | /* not in the cell's in-memory lists - create a new record */ |
| 284 | vlocation = kmalloc(sizeof(struct afs_vlocation), GFP_KERNEL); | 284 | vlocation = kzalloc(sizeof(struct afs_vlocation), GFP_KERNEL); |
| 285 | if (!vlocation) | 285 | if (!vlocation) |
| 286 | return -ENOMEM; | 286 | return -ENOMEM; |
| 287 | 287 | ||
| 288 | memset(vlocation, 0, sizeof(struct afs_vlocation)); | ||
| 289 | atomic_set(&vlocation->usage, 1); | 288 | atomic_set(&vlocation->usage, 1); |
| 290 | INIT_LIST_HEAD(&vlocation->link); | 289 | INIT_LIST_HEAD(&vlocation->link); |
| 291 | rwlock_init(&vlocation->lock); | 290 | rwlock_init(&vlocation->lock); |
| @@ -326,8 +325,7 @@ int afs_vlocation_lookup(struct afs_cell *cell, | |||
| 326 | /* found in the graveyard - resurrect */ | 325 | /* found in the graveyard - resurrect */ |
| 327 | _debug("found in graveyard"); | 326 | _debug("found in graveyard"); |
| 328 | atomic_inc(&vlocation->usage); | 327 | atomic_inc(&vlocation->usage); |
| 329 | list_del(&vlocation->link); | 328 | list_move_tail(&vlocation->link, &cell->vl_list); |
| 330 | list_add_tail(&vlocation->link, &cell->vl_list); | ||
| 331 | spin_unlock(&cell->vl_gylock); | 329 | spin_unlock(&cell->vl_gylock); |
| 332 | 330 | ||
| 333 | afs_kafstimod_del_timer(&vlocation->timeout); | 331 | afs_kafstimod_del_timer(&vlocation->timeout); |
| @@ -478,8 +476,7 @@ static void __afs_put_vlocation(struct afs_vlocation *vlocation) | |||
| 478 | } | 476 | } |
| 479 | 477 | ||
| 480 | /* move to graveyard queue */ | 478 | /* move to graveyard queue */ |
| 481 | list_del(&vlocation->link); | 479 | list_move_tail(&vlocation->link,&cell->vl_graveyard); |
| 482 | list_add_tail(&vlocation->link,&cell->vl_graveyard); | ||
| 483 | 480 | ||
| 484 | /* remove from pending timeout queue (refcounted if actually being | 481 | /* remove from pending timeout queue (refcounted if actually being |
| 485 | * updated) */ | 482 | * updated) */ |
