SUNRPC: Use atomic(64)_t for seq_send(64)
[linux-2.6-block.git] / net / sunrpc / auth_gss / gss_krb5_wrap.c
index 39a2e672900bdde2fe8c362d026db49af4e3d3e5..6af6f119d9c1af6e5fb271138874fe55b35782c0 100644 (file)
@@ -228,9 +228,7 @@ gss_wrap_kerberos_v1(struct krb5_ctx *kctx, int offset,
 
        memcpy(ptr + GSS_KRB5_TOK_HDR_LEN, md5cksum.data, md5cksum.len);
 
-       spin_lock(&krb5_seq_lock);
-       seq_send = kctx->seq_send++;
-       spin_unlock(&krb5_seq_lock);
+       seq_send = atomic_fetch_inc(&kctx->seq_send);
 
        /* XXX would probably be more efficient to compute checksum
         * and encrypt at the same time: */
@@ -477,9 +475,7 @@ gss_wrap_kerberos_v2(struct krb5_ctx *kctx, u32 offset,
        *be16ptr++ = 0;
 
        be64ptr = (__be64 *)be16ptr;
-       spin_lock(&krb5_seq_lock);
-       *be64ptr = cpu_to_be64(kctx->seq_send64++);
-       spin_unlock(&krb5_seq_lock);
+       *be64ptr = cpu_to_be64(atomic64_fetch_inc(&kctx->seq_send64));
 
        err = (*kctx->gk5e->encrypt_v2)(kctx, offset, buf, pages);
        if (err)