On Tue, Nov 13, 2007 at 03:33:48AM -0800, David Miller wrote:Brilliant, make that patch 25/25 :) [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 <herbert@gondor.apana.org.au> --- 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 944fdad..e184c11 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 d41588d..02cf26f 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -1993,8 +1993,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; } -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
| Greg KH | Re: [malware-list] [RFC 0/5] [TALPA] Intro to a linux interface for on access scan... |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Parag Warudkar | BUG: soft lockup - CPU#1 stuck for 15s! [swapper:0] |
git: | |
| Jakub Narebski | Re: VCS comparison table |
| Jakub Narebski | Git User's Survey 2007 unfinished summary continued |
| Linus Torvalds | I'm a total push-over.. |
| Marco Costalba | Decompression speed: zip vs lzo |
| Richard Stallman | Real men don't attack straw men |
| GVG GVG | ssh_exchange_identification: Connection closed by remote host |
| Marcos Laufer | dmesg IBM x3650 OpenBSD 4.3 |
| Bill Chmura | SSL Certs on Carp'd web servers |
| Denys Fedoryshchenko | thousands of classes, e1000 TX unit hang |
| Steve French | Fwd: [PATCH] Fix CIFS compilation with CONFIG_KEYS unset |
| Jens Axboe | Re: [BUG] New Kernel Bugs |
| KOSAKI Motohiro | [bug?] tg3: Failed to load firmware "tigon/tg3_tso.bin" |
| Treason Uncloaked | 3 hours ago | Linux kernel |
| Shared swap partition | 14 hours ago | Linux general |
| high memory | 2 days ago | Linux kernel |
| semaphore access speed | 2 days ago | Applications and Utilities |
| the kernel how to power off the machine | 2 days ago | Linux kernel |
| Easter Eggs in windows XP | 2 days ago | Windows |
| Root password | 2 days ago | Linux general |
| Where/when DNOTIFY is used? | 2 days ago | Linux kernel |
| How to convert Linux Kernel built-in module into a loadable module | 2 days ago | Linux kernel |
| Linux 2.6.24 and I/O schedulers | 2 days ago | Linux kernel |
