Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d26f398400311982d2433debae85746c348b7d58
Commit:     d26f398400311982d2433debae85746c348b7d58
Parent:     0ebea8ef3559b545c37b016f44e84c3b33e47c39
Author:     Herbert Xu <[EMAIL PROTECTED]>
AuthorDate: Tue Nov 13 21:47:08 2007 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 14:53:52 2008 -0800

    [IPSEC]: Make x->lastused an unsigned long
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/net/xfrm.h       |    2 +-
 net/ipv6/xfrm6_mode_ro.c |    2 --
 net/xfrm/xfrm_user.c     |    4 ++--
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 329de41..311bbd1 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -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. */
diff --git a/net/ipv6/xfrm6_mode_ro.c b/net/ipv6/xfrm6_mode_ro.c
index 4a01cb3..63d5d49 100644
--- a/net/ipv6/xfrm6_mode_ro.c
+++ b/net/ipv6/xfrm6_mode_ro.c
@@ -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;
 }
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index c4f6419..6424e53 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -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;
 }
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to