aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-06-16 00:52:13 -0400
committerDavid S. Miller <davem@davemloft.net>2010-06-16 14:55:39 -0400
commit317fe0e6c5dc9448bcef41a2e31fecfd3dba7f55 (patch)
treec2a042e1c8bb96b7fdeadf658309ead1b6e8dabc /net/ipv4/route.c
parentfdb93f8ac39aa5902f3d264edd50dffcabfdd13b (diff)
inetpeer: restore small inet_peer structures
Addition of rcu_head to struct inet_peer added 16bytes on 64bit arches. Thats a bit unfortunate, since old size was exactly 64 bytes. This can be solved, using an union between this rcu_head an four fields, that are normally used only when a refcount is taken on inet_peer. rcu_head is used only when refcnt=-1, right before structure freeing. Add a inet_peer_refcheck() function to check this assertion for a while. We can bring back SLAB_HWCACHE_ALIGN qualifier in kmem cache creation. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index a291edbbc97f..03430de46166 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2881,6 +2881,7 @@ static int rt_fill_info(struct net *net,
2881 error = rt->dst.error; 2881 error = rt->dst.error;
2882 expires = rt->dst.expires ? rt->dst.expires - jiffies : 0; 2882 expires = rt->dst.expires ? rt->dst.expires - jiffies : 0;
2883 if (rt->peer) { 2883 if (rt->peer) {
2884 inet_peer_refcheck(rt->peer);
2884 id = atomic_read(&rt->peer->ip_id_count) & 0xffff; 2885 id = atomic_read(&rt->peer->ip_id_count) & 0xffff;
2885 if (rt->peer->tcp_ts_stamp) { 2886 if (rt->peer->tcp_ts_stamp) {
2886 ts = rt->peer->tcp_ts; 2887 ts = rt->peer->tcp_ts;
t">)); /* er_Type board type bits */ #define ERT_TYPEMASK 0xc0 #define ERT_ZORROII 0xc0 #define ERT_ZORROIII 0x80 /* other bits defined in er_Type */ #define ERTB_MEMLIST 5 /* Link RAM into free memory list */ #define ERTF_MEMLIST (1<<5) struct ConfigDev { struct Node cd_Node; __u8 cd_Flags; /* (read/write) */ __u8 cd_Pad; /* reserved */ struct ExpansionRom cd_Rom; /* copy of board's expansion ROM */ void *cd_BoardAddr; /* where in memory the board was placed */ __u32 cd_BoardSize; /* size of board in bytes */ __u16 cd_SlotAddr; /* which slot number (PRIVATE) */ __u16 cd_SlotSize; /* number of slots (PRIVATE) */ void *cd_Driver; /* pointer to node of driver */ struct ConfigDev *cd_NextCD; /* linked list of drivers to config */ __u32 cd_Unused[4]; /* for whatever the driver wants */ } __attribute__ ((packed)); #define ZORRO_NUM_AUTO 16 #ifdef __KERNEL__ #include <linux/init.h> #include <linux/ioport.h> #include <linux/mod_devicetable.h> #include <asm/zorro.h> /* * Zorro devices */ struct zorro_dev { struct ExpansionRom rom; zorro_id id; struct zorro_driver *driver; /* which driver has allocated this device */ struct device dev; /* Generic device interface */ u16 slotaddr; u16 slotsize; char name[64]; struct resource resource; }; #define to_zorro_dev(n) container_of(n, struct zorro_dev, dev) /* * Zorro bus */ extern struct bus_type zorro_bus_type; /* * Zorro device drivers */ struct zorro_driver { struct list_head node; char *name; const struct zorro_device_id *id_table; /* NULL if wants all devices */ int (*probe)(struct zorro_dev *z, const struct zorro_device_id *id); /* New device inserted */ void (*remove)(struct zorro_dev *z); /* Device removed (NULL if not a hot-plug capable driver) */ struct device_driver driver; }; #define to_zorro_driver(drv) container_of(drv, struct zorro_driver, driver) #define zorro_for_each_dev(dev) \ for (dev = &zorro_autocon[0]; dev < zorro_autocon+zorro_num_autocon; dev++) /* New-style probing */ extern int zorro_register_driver(struct zorro_driver *); extern void zorro_unregister_driver(struct zorro_driver *); extern const struct zorro_device_id *zorro_match_device(const struct zorro_device_id *ids, const struct zorro_dev *z); static inline struct zorro_driver *zorro_dev_driver(const struct zorro_dev *z) { return z->driver; } extern unsigned int zorro_num_autocon; /* # of autoconfig devices found */ extern struct zorro_dev zorro_autocon[ZORRO_NUM_AUTO]; /* * Zorro Functions */ extern struct zorro_dev *zorro_find_device(zorro_id id, struct zorro_dev *from); #define zorro_resource_start(z) ((z)->resource.start) #define zorro_resource_end(z) ((z)->resource.end) #define zorro_resource_len(z) (resource_size(&(z)->resource)) #define zorro_resource_flags(z) ((z)->resource.flags) #define zorro_request_device(z, name) \ request_mem_region(zorro_resource_start(z), zorro_resource_len(z), name) #define zorro_release_device(z) \ release_mem_region(zorro_resource_start(z), zorro_resource_len(z)) /* Similar to the helpers above, these manipulate per-zorro_dev * driver-specific data. They are really just a wrapper around * the generic device structure functions of these calls. */ static inline void *zorro_get_drvdata (struct zorro_dev *z) { return dev_get_drvdata(&z->dev); } static inline void zorro_set_drvdata (struct zorro_dev *z, void *data) { dev_set_drvdata(&z->dev, data); } /* * Bitmask indicating portions of available Zorro II RAM that are unused * by the system. Every bit represents a 64K chunk, for a maximum of 8MB * (128 chunks, physical 0x00200000-0x009fffff). * * If you want to use (= allocate) portions of this RAM, you should clear * the corresponding bits. */ extern DECLARE_BITMAP(zorro_unused_z2ram, 128); #define Z2RAM_START (0x00200000) #define Z2RAM_END (0x00a00000) #define Z2RAM_SIZE (0x00800000) #define Z2RAM_CHUNKSIZE (0x00010000) #define Z2RAM_CHUNKMASK (0x0000ffff) #define Z2RAM_CHUNKSHIFT (16) #endif /* __KERNEL__ */ #endif /* _LINUX_ZORRO_H */