diff options
Diffstat (limited to 'include/linux/atmdev.h')
-rw-r--r-- | include/linux/atmdev.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h index 0c27515d2cf6..8124815eb121 100644 --- a/include/linux/atmdev.h +++ b/include/linux/atmdev.h | |||
@@ -214,6 +214,7 @@ struct atmphy_ops { | |||
214 | struct atm_skb_data { | 214 | struct atm_skb_data { |
215 | struct atm_vcc *vcc; /* ATM VCC */ | 215 | struct atm_vcc *vcc; /* ATM VCC */ |
216 | unsigned long atm_options; /* ATM layer options */ | 216 | unsigned long atm_options; /* ATM layer options */ |
217 | unsigned int acct_truesize; /* truesize accounted to vcc */ | ||
217 | }; | 218 | }; |
218 | 219 | ||
219 | #define VCC_HTABLE_SIZE 32 | 220 | #define VCC_HTABLE_SIZE 32 |
@@ -241,6 +242,20 @@ void vcc_insert_socket(struct sock *sk); | |||
241 | 242 | ||
242 | void atm_dev_release_vccs(struct atm_dev *dev); | 243 | void atm_dev_release_vccs(struct atm_dev *dev); |
243 | 244 | ||
245 | static inline void atm_account_tx(struct atm_vcc *vcc, struct sk_buff *skb) | ||
246 | { | ||
247 | /* | ||
248 | * Because ATM skbs may not belong to a sock (and we don't | ||
249 | * necessarily want to), skb->truesize may be adjusted, | ||
250 | * escaping the hack in pskb_expand_head() which avoids | ||
251 | * doing so for some cases. So stash the value of truesize | ||
252 | * at the time we accounted it, and atm_pop_raw() can use | ||
253 | * that value later, in case it changes. | ||
254 | */ | ||
255 | refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); | ||
256 | ATM_SKB(skb)->acct_truesize = skb->truesize; | ||
257 | ATM_SKB(skb)->atm_options = vcc->atm_options; | ||
258 | } | ||
244 | 259 | ||
245 | static inline void atm_force_charge(struct atm_vcc *vcc,int truesize) | 260 | static inline void atm_force_charge(struct atm_vcc *vcc,int truesize) |
246 | { | 261 | { |