Skip to content

Commit

Permalink
inet: Remove explicit write references to sk/inet in ip_append_data
Browse files Browse the repository at this point in the history
In order to allow simultaneous calls to ip_append_data on the same
socket, it must not modify any shared state in sk or inet (other
than those that are designed to allow that such as atomic counters).

This patch abstracts out write references to sk and inet_sk in
ip_append_data and its friends so that we may use the underlying
code in parallel.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Herbert Xu authored and David S. Miller committed Mar 1, 2011
1 parent 5a2ef92 commit 1470ddf
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 107 deletions.
23 changes: 14 additions & 9 deletions include/net/inet_sock.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk)
return (struct inet_request_sock *)sk;
}

struct inet_cork {
unsigned int flags;
unsigned int fragsize;
struct ip_options *opt;
struct dst_entry *dst;
int length; /* Total length of all frames */
__be32 addr;
struct flowi fl;
struct page *page;
u32 off;
u8 tx_flags;
};

struct ip_mc_socklist;
struct ipv6_pinfo;
struct rtable;
Expand Down Expand Up @@ -143,15 +156,7 @@ struct inet_sock {
int mc_index;
__be32 mc_addr;
struct ip_mc_socklist __rcu *mc_list;
struct {
unsigned int flags;
unsigned int fragsize;
struct ip_options *opt;
struct dst_entry *dst;
int length; /* Total length of all frames */
__be32 addr;
struct flowi fl;
} cork;
struct inet_cork cork;
};

#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */
Expand Down
Loading

0 comments on commit 1470ddf

Please sign in to comment.