diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-10-18 17:20:13 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2005-10-18 17:20:13 -0400 |
commit | e6dfa553cffcb9740f932311dff42f81d6ac63bb (patch) | |
tree | d5519b749b6a7fb6e25b0459385011cd69a6caaf /fs/nfs/nfs4state.c | |
parent | 9512135df14f8293b9bc5e8fb22d4279dee5ff66 (diff) |
NFSv4: Remove obsolete state_owner and lock_owner semaphores
OPEN, CLOSE, etc no longer need these semaphores to ensure ordering of
requests.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 59c93f37e1b2..86c08c165ce7 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -267,7 +267,6 @@ nfs4_alloc_state_owner(void) | |||
267 | sp = kzalloc(sizeof(*sp),GFP_KERNEL); | 267 | sp = kzalloc(sizeof(*sp),GFP_KERNEL); |
268 | if (!sp) | 268 | if (!sp) |
269 | return NULL; | 269 | return NULL; |
270 | init_MUTEX(&sp->so_sema); | ||
271 | INIT_LIST_HEAD(&sp->so_states); | 270 | INIT_LIST_HEAD(&sp->so_states); |
272 | INIT_LIST_HEAD(&sp->so_delegations); | 271 | INIT_LIST_HEAD(&sp->so_delegations); |
273 | rpc_init_wait_queue(&sp->so_sequence.wait, "Seqid_waitqueue"); | 272 | rpc_init_wait_queue(&sp->so_sequence.wait, "Seqid_waitqueue"); |
@@ -362,7 +361,6 @@ nfs4_alloc_open_state(void) | |||
362 | memset(state->stateid.data, 0, sizeof(state->stateid.data)); | 361 | memset(state->stateid.data, 0, sizeof(state->stateid.data)); |
363 | atomic_set(&state->count, 1); | 362 | atomic_set(&state->count, 1); |
364 | INIT_LIST_HEAD(&state->lock_states); | 363 | INIT_LIST_HEAD(&state->lock_states); |
365 | init_MUTEX(&state->lock_sema); | ||
366 | spin_lock_init(&state->state_lock); | 364 | spin_lock_init(&state->state_lock); |
367 | return state; | 365 | return state; |
368 | } | 366 | } |
@@ -444,7 +442,6 @@ nfs4_get_open_state(struct inode *inode, struct nfs4_state_owner *owner) | |||
444 | state = __nfs4_find_state_byowner(inode, owner); | 442 | state = __nfs4_find_state_byowner(inode, owner); |
445 | if (state == NULL && new != NULL) { | 443 | if (state == NULL && new != NULL) { |
446 | state = new; | 444 | state = new; |
447 | /* Caller *must* be holding owner->so_sem */ | ||
448 | /* Note: The reclaim code dictates that we add stateless | 445 | /* Note: The reclaim code dictates that we add stateless |
449 | * and read-only stateids to the end of the list */ | 446 | * and read-only stateids to the end of the list */ |
450 | list_add_tail(&state->open_states, &owner->so_states); | 447 | list_add_tail(&state->open_states, &owner->so_states); |
@@ -464,7 +461,7 @@ out: | |||
464 | 461 | ||
465 | /* | 462 | /* |
466 | * Beware! Caller must be holding exactly one | 463 | * Beware! Caller must be holding exactly one |
467 | * reference to clp->cl_sem and owner->so_sema! | 464 | * reference to clp->cl_sem! |
468 | */ | 465 | */ |
469 | void nfs4_put_open_state(struct nfs4_state *state) | 466 | void nfs4_put_open_state(struct nfs4_state *state) |
470 | { | 467 | { |
@@ -485,7 +482,6 @@ void nfs4_put_open_state(struct nfs4_state *state) | |||
485 | 482 | ||
486 | /* | 483 | /* |
487 | * Beware! Caller must be holding no references to clp->cl_sem! | 484 | * Beware! Caller must be holding no references to clp->cl_sem! |
488 | * of owner->so_sema! | ||
489 | */ | 485 | */ |
490 | void nfs4_close_state(struct nfs4_state *state, mode_t mode) | 486 | void nfs4_close_state(struct nfs4_state *state, mode_t mode) |
491 | { | 487 | { |
@@ -496,7 +492,6 @@ void nfs4_close_state(struct nfs4_state *state, mode_t mode) | |||
496 | 492 | ||
497 | atomic_inc(&owner->so_count); | 493 | atomic_inc(&owner->so_count); |
498 | down_read(&clp->cl_sem); | 494 | down_read(&clp->cl_sem); |
499 | down(&owner->so_sema); | ||
500 | /* Protect against nfs4_find_state() */ | 495 | /* Protect against nfs4_find_state() */ |
501 | spin_lock(&inode->i_lock); | 496 | spin_lock(&inode->i_lock); |
502 | if (mode & FMODE_READ) | 497 | if (mode & FMODE_READ) |
@@ -527,7 +522,6 @@ void nfs4_close_state(struct nfs4_state *state, mode_t mode) | |||
527 | } | 522 | } |
528 | out: | 523 | out: |
529 | nfs4_put_open_state(state); | 524 | nfs4_put_open_state(state); |
530 | up(&owner->so_sema); | ||
531 | nfs4_put_state_owner(owner); | 525 | nfs4_put_state_owner(owner); |
532 | up_read(&clp->cl_sem); | 526 | up_read(&clp->cl_sem); |
533 | } | 527 | } |
@@ -553,7 +547,6 @@ __nfs4_find_lock_state(struct nfs4_state *state, fl_owner_t fl_owner) | |||
553 | * Return a compatible lock_state. If no initialized lock_state structure | 547 | * Return a compatible lock_state. If no initialized lock_state structure |
554 | * exists, return an uninitialized one. | 548 | * exists, return an uninitialized one. |
555 | * | 549 | * |
556 | * The caller must be holding state->lock_sema | ||
557 | */ | 550 | */ |
558 | static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, fl_owner_t fl_owner) | 551 | static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, fl_owner_t fl_owner) |
559 | { | 552 | { |
@@ -577,7 +570,7 @@ static struct nfs4_lock_state *nfs4_alloc_lock_state(struct nfs4_state *state, f | |||
577 | * Return a compatible lock_state. If no initialized lock_state structure | 570 | * Return a compatible lock_state. If no initialized lock_state structure |
578 | * exists, return an uninitialized one. | 571 | * exists, return an uninitialized one. |
579 | * | 572 | * |
580 | * The caller must be holding state->lock_sema and clp->cl_sem | 573 | * The caller must be holding clp->cl_sem |
581 | */ | 574 | */ |
582 | static struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_owner_t owner) | 575 | static struct nfs4_lock_state *nfs4_get_lock_state(struct nfs4_state *state, fl_owner_t owner) |
583 | { | 576 | { |
@@ -711,7 +704,7 @@ void nfs_free_seqid(struct nfs_seqid *seqid) | |||
711 | } | 704 | } |
712 | 705 | ||
713 | /* | 706 | /* |
714 | * Called with sp->so_sema and clp->cl_sem held. | 707 | * Called with clp->cl_sem held. |
715 | * | 708 | * |
716 | * Increment the seqid if the OPEN/OPEN_DOWNGRADE/CLOSE succeeded, or | 709 | * Increment the seqid if the OPEN/OPEN_DOWNGRADE/CLOSE succeeded, or |
717 | * failed with a seqid incrementing error - | 710 | * failed with a seqid incrementing error - |
@@ -750,7 +743,7 @@ void nfs_increment_open_seqid(int status, struct nfs_seqid *seqid) | |||
750 | } | 743 | } |
751 | 744 | ||
752 | /* | 745 | /* |
753 | * Called with ls->lock_sema and clp->cl_sem held. | 746 | * Called with clp->cl_sem held. |
754 | * | 747 | * |
755 | * Increment the seqid if the LOCK/LOCKU succeeded, or | 748 | * Increment the seqid if the LOCK/LOCKU succeeded, or |
756 | * failed with a seqid incrementing error - | 749 | * failed with a seqid incrementing error - |