diff options
| author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
|---|---|---|
| committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
| commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
| tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /net/core | |
| parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) | |
Diffstat (limited to 'net/core')
| -rw-r--r-- | net/core/kmap_skb.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/core/kmap_skb.h b/net/core/kmap_skb.h new file mode 100644 index 00000000000..283c2b993fb --- /dev/null +++ b/net/core/kmap_skb.h | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | #include <linux/highmem.h> | ||
| 2 | |||
| 3 | static inline void *kmap_skb_frag(const skb_frag_t *frag) | ||
| 4 | { | ||
| 5 | #ifdef CONFIG_HIGHMEM | ||
| 6 | BUG_ON(in_irq()); | ||
| 7 | |||
| 8 | local_bh_disable(); | ||
| 9 | #endif | ||
| 10 | return kmap_atomic(frag->page, KM_SKB_DATA_SOFTIRQ); | ||
| 11 | } | ||
| 12 | |||
| 13 | static inline void kunmap_skb_frag(void *vaddr) | ||
| 14 | { | ||
| 15 | kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ); | ||
| 16 | #ifdef CONFIG_HIGHMEM | ||
| 17 | local_bh_enable(); | ||
| 18 | #endif | ||
| 19 | } | ||
