mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
inet: rename netns_frags to fqdir
1) struct netns_frags is renamed to struct fqdir This structure is really holding many frag queues in a hash table. 2) (struct inet_frag_queue)->net field is renamed to fqdir since net is generally associated to a 'struct net' pointer in networking stack. Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
ddf6ddb057
commit
6ce3b4dcee
9 changed files with 61 additions and 60 deletions
|
@ -4,7 +4,8 @@
|
|||
|
||||
#include <linux/rhashtable-types.h>
|
||||
|
||||
struct netns_frags {
|
||||
/* Per netns frag queues directory */
|
||||
struct fqdir {
|
||||
/* sysctls */
|
||||
long high_thresh;
|
||||
long low_thresh;
|
||||
|
@ -64,7 +65,7 @@ struct frag_v6_compare_key {
|
|||
* @meat: length of received fragments so far
|
||||
* @flags: fragment queue flags
|
||||
* @max_size: maximum received fragment size
|
||||
* @net: namespace that this frag belongs to
|
||||
* @fqdir: pointer to struct fqdir
|
||||
* @rcu: rcu head for freeing deferall
|
||||
*/
|
||||
struct inet_frag_queue {
|
||||
|
@ -84,7 +85,7 @@ struct inet_frag_queue {
|
|||
int meat;
|
||||
__u8 flags;
|
||||
u16 max_size;
|
||||
struct netns_frags *net;
|
||||
struct fqdir *fqdir;
|
||||
struct rcu_head rcu;
|
||||
};
|
||||
|
||||
|
@ -103,16 +104,16 @@ struct inet_frags {
|
|||
int inet_frags_init(struct inet_frags *);
|
||||
void inet_frags_fini(struct inet_frags *);
|
||||
|
||||
static inline int inet_frags_init_net(struct netns_frags *nf)
|
||||
static inline int inet_frags_init_net(struct fqdir *fqdir)
|
||||
{
|
||||
atomic_long_set(&nf->mem, 0);
|
||||
return rhashtable_init(&nf->rhashtable, &nf->f->rhash_params);
|
||||
atomic_long_set(&fqdir->mem, 0);
|
||||
return rhashtable_init(&fqdir->rhashtable, &fqdir->f->rhash_params);
|
||||
}
|
||||
void inet_frags_exit_net(struct netns_frags *nf);
|
||||
void inet_frags_exit_net(struct fqdir *fqdir);
|
||||
|
||||
void inet_frag_kill(struct inet_frag_queue *q);
|
||||
void inet_frag_destroy(struct inet_frag_queue *q);
|
||||
struct inet_frag_queue *inet_frag_find(struct netns_frags *nf, void *key);
|
||||
struct inet_frag_queue *inet_frag_find(struct fqdir *fqdir, void *key);
|
||||
|
||||
/* Free all skbs in the queue; return the sum of their truesizes. */
|
||||
unsigned int inet_frag_rbtree_purge(struct rb_root *root);
|
||||
|
@ -125,19 +126,19 @@ static inline void inet_frag_put(struct inet_frag_queue *q)
|
|||
|
||||
/* Memory Tracking Functions. */
|
||||
|
||||
static inline long frag_mem_limit(const struct netns_frags *nf)
|
||||
static inline long frag_mem_limit(const struct fqdir *fqdir)
|
||||
{
|
||||
return atomic_long_read(&nf->mem);
|
||||
return atomic_long_read(&fqdir->mem);
|
||||
}
|
||||
|
||||
static inline void sub_frag_mem_limit(struct netns_frags *nf, long val)
|
||||
static inline void sub_frag_mem_limit(struct fqdir *fqdir, long val)
|
||||
{
|
||||
atomic_long_sub(val, &nf->mem);
|
||||
atomic_long_sub(val, &fqdir->mem);
|
||||
}
|
||||
|
||||
static inline void add_frag_mem_limit(struct netns_frags *nf, long val)
|
||||
static inline void add_frag_mem_limit(struct fqdir *fqdir, long val)
|
||||
{
|
||||
atomic_long_add(val, &nf->mem);
|
||||
atomic_long_add(val, &fqdir->mem);
|
||||
}
|
||||
|
||||
/* RFC 3168 support :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue