]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[IPSEC]: Make x->lastused an unsigned long
authorHerbert Xu <herbert@gondor.apana.org.au>
Wed, 14 Nov 2007 05:47:08 +0000 (21:47 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 22:53:52 +0000 (14:53 -0800)
Currently x->lastused is u64 which means that it cannot be
read/written atomically on all architectures.  David Miller observed
that the value stored in it is only an unsigned long which is always
atomic.

So based on his suggestion this patch changes the internal
representation from u64 to unsigned long while the user-interface
still refers to it as u64.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/xfrm.h
net/ipv6/xfrm6_mode_ro.c
net/xfrm/xfrm_user.c

index 329de412c0ba5bce47293c4b680e9a035732cbad..311bbd113aa7eb7ccf3530ade685a78ca9e6d7e6 100644 (file)
@@ -183,7 +183,7 @@ struct xfrm_state
        struct timer_list       timer;
 
        /* Last used time */
-       u64                     lastused;
+       unsigned long           lastused;
 
        /* Reference to data common to all the instances of this
         * transformer. */
index 4a01cb3c370b6a365f1497ed57e51a060f8e3c8f..63d5d493098afd6b250e77b3ef15a880bd7232c7 100644 (file)
@@ -54,9 +54,7 @@ static int xfrm6_ro_output(struct xfrm_state *x, struct sk_buff *skb)
        __skb_pull(skb, hdr_len);
        memmove(ipv6_hdr(skb), iph, hdr_len);
 
-       spin_lock_bh(&x->lock);
        x->lastused = get_seconds();
-       spin_unlock_bh(&x->lock);
 
        return 0;
 }
index c4f6419b176943bd54752c644f0b4cc937587327..6424e53605118223981f04a8e367fba72cd7dabc 100644 (file)
@@ -1986,8 +1986,8 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x)
        if (x->coaddr)
                l += nla_total_size(sizeof(*x->coaddr));
 
-       /* Must count this as this may become non-zero behind our back. */
-       l += nla_total_size(sizeof(x->lastused));
+       /* Must count x->lastused as it may become non-zero behind our back. */
+       l += nla_total_size(sizeof(u64));
 
        return l;
 }