~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to net/core/flow.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
172
172
 
173
173
static u32 flow_hash_code(struct flow_cache *fc,
174
174
                          struct flow_cache_percpu *fcp,
175
 
                          struct flowi *key)
 
175
                          const struct flowi *key)
176
176
{
177
 
        u32 *k = (u32 *) key;
 
177
        const u32 *k = (const u32 *) key;
178
178
 
179
179
        return jhash2(k, (sizeof(*key) / sizeof(u32)), fcp->hash_rnd)
180
180
                & (flow_cache_hash_size(fc) - 1);
186
186
 * important assumptions that we can here, such as alignment and
187
187
 * constant size.
188
188
 */
189
 
static int flow_key_compare(struct flowi *key1, struct flowi *key2)
 
189
static int flow_key_compare(const struct flowi *key1, const struct flowi *key2)
190
190
{
191
 
        flow_compare_t *k1, *k1_lim, *k2;
 
191
        const flow_compare_t *k1, *k1_lim, *k2;
192
192
        const int n_elem = sizeof(struct flowi) / sizeof(flow_compare_t);
193
193
 
194
194
        BUILD_BUG_ON(sizeof(struct flowi) % sizeof(flow_compare_t));
195
195
 
196
 
        k1 = (flow_compare_t *) key1;
 
196
        k1 = (const flow_compare_t *) key1;
197
197
        k1_lim = k1 + n_elem;
198
198
 
199
 
        k2 = (flow_compare_t *) key2;
 
199
        k2 = (const flow_compare_t *) key2;
200
200
 
201
201
        do {
202
202
                if (*k1++ != *k2++)
207
207
}
208
208
 
209
209
struct flow_cache_object *
210
 
flow_cache_lookup(struct net *net, struct flowi *key, u16 family, u8 dir,
 
210
flow_cache_lookup(struct net *net, const struct flowi *key, u16 family, u8 dir,
211
211
                  flow_resolve_t resolver, void *ctx)
212
212
{
213
213
        struct flow_cache *fc = &flow_cache_global;