diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-04 18:13:56 -0500 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-03-06 10:32:46 -0500 |
commit | f597c53790f662662281b82b7692a22d2a4d4afa (patch) | |
tree | 3567e1c7e232973fee14b7ddffa3545cd88392d0 /fs/nfs/nfs4state.c | |
parent | 1e3987c3052a48fbfc8f5d30214c825eff41192d (diff) |
NFSv4: Add helpers for basic copying of stateids
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/nfs4state.c')
-rw-r--r-- | fs/nfs/nfs4state.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c index 6ba82271c868..55c8a81cd6fb 100644 --- a/fs/nfs/nfs4state.c +++ b/fs/nfs/nfs4state.c | |||
@@ -895,7 +895,7 @@ void nfs4_select_rw_stateid(nfs4_stateid *dst, struct nfs4_state *state, fl_owne | |||
895 | 895 | ||
896 | do { | 896 | do { |
897 | seq = read_seqbegin(&state->seqlock); | 897 | seq = read_seqbegin(&state->seqlock); |
898 | memcpy(dst, &state->stateid, sizeof(*dst)); | 898 | nfs4_stateid_copy(dst, &state->stateid); |
899 | } while (read_seqretry(&state->seqlock, seq)); | 899 | } while (read_seqretry(&state->seqlock, seq)); |
900 | if (test_bit(LK_STATE_IN_USE, &state->flags) == 0) | 900 | if (test_bit(LK_STATE_IN_USE, &state->flags) == 0) |
901 | return; | 901 | return; |
@@ -903,7 +903,7 @@ void nfs4_select_rw_stateid(nfs4_stateid *dst, struct nfs4_state *state, fl_owne | |||
903 | spin_lock(&state->state_lock); | 903 | spin_lock(&state->state_lock); |
904 | lsp = __nfs4_find_lock_state(state, fl_owner, fl_pid, NFS4_ANY_LOCK_TYPE); | 904 | lsp = __nfs4_find_lock_state(state, fl_owner, fl_pid, NFS4_ANY_LOCK_TYPE); |
905 | if (lsp != NULL && (lsp->ls_flags & NFS_LOCK_INITIALIZED) != 0) | 905 | if (lsp != NULL && (lsp->ls_flags & NFS_LOCK_INITIALIZED) != 0) |
906 | memcpy(dst, &lsp->ls_stateid, sizeof(*dst)); | 906 | nfs4_stateid_copy(dst, &lsp->ls_stateid); |
907 | spin_unlock(&state->state_lock); | 907 | spin_unlock(&state->state_lock); |
908 | nfs4_put_lock_state(lsp); | 908 | nfs4_put_lock_state(lsp); |
909 | } | 909 | } |
@@ -1126,7 +1126,7 @@ void nfs_inode_find_state_and_recover(struct inode *inode, | |||
1126 | continue; | 1126 | continue; |
1127 | if (!test_bit(NFS_DELEGATED_STATE, &state->flags)) | 1127 | if (!test_bit(NFS_DELEGATED_STATE, &state->flags)) |
1128 | continue; | 1128 | continue; |
1129 | if (memcmp(state->stateid.data, stateid->data, sizeof(state->stateid.data)) != 0) | 1129 | if (!nfs4_stateid_match(&state->stateid, stateid)) |
1130 | continue; | 1130 | continue; |
1131 | nfs4_state_mark_reclaim_nograce(clp, state); | 1131 | nfs4_state_mark_reclaim_nograce(clp, state); |
1132 | found = true; | 1132 | found = true; |