diff options
| author | Takashi Iwai <tiwai@suse.de> | 2018-07-18 18:42:34 +0300 |
|---|---|---|
| committer | Takashi Iwai <tiwai@suse.de> | 2018-07-18 18:42:40 +0300 |
| commit | 67ece13ffe862f9d17a144c6cd3feef88a57db13 (patch) | |
| tree | ec2036681d19a9c10b2fad941eb8f58f9eafcfc8 /include/linux/atmdev.h | |
| parent | fa84cf094ef9667e2b91c104b0a788fd1896f482 (diff) | |
| parent | 4aaf448fa9754e2d5ee188d32327b24ffc15ca4d (diff) | |
| download | linux-67ece13ffe862f9d17a144c6cd3feef88a57db13.tar.xz | |
Merge branch 'topic/vga_switcheroo' into for-next
Pull the vga_switcheroo audio client fix.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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 { struct atm_skb_data { struct atm_vcc *vcc; /* ATM VCC */ unsigned long atm_options; /* ATM layer options */ + unsigned int acct_truesize; /* truesize accounted to vcc */ }; #define VCC_HTABLE_SIZE 32 @@ -241,6 +242,20 @@ void vcc_insert_socket(struct sock *sk); void atm_dev_release_vccs(struct atm_dev *dev); +static inline void atm_account_tx(struct atm_vcc *vcc, struct sk_buff *skb) +{ + /* + * Because ATM skbs may not belong to a sock (and we don't + * necessarily want to), skb->truesize may be adjusted, + * escaping the hack in pskb_expand_head() which avoids + * doing so for some cases. So stash the value of truesize + * at the time we accounted it, and atm_pop_raw() can use + * that value later, in case it changes. + */ + refcount_add(skb->truesize, &sk_atm(vcc)->sk_wmem_alloc); + ATM_SKB(skb)->acct_truesize = skb->truesize; + ATM_SKB(skb)->atm_options = vcc->atm_options; +} static inline void atm_force_charge(struct atm_vcc *vcc,int truesize) { |
