blob: 81e1ed7c838396e9e18a772447304284dbe81d5a [file] [log] [blame]
Al Viroa1f8e7f2006-10-19 16:08:53 -04001#include <linux/highmem.h>
2
3static 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
Ian Campbellea2ab692011-08-22 23:44:58 +000010 return kmap_atomic(skb_frag_page(frag), KM_SKB_DATA_SOFTIRQ);
Al Viroa1f8e7f2006-10-19 16:08:53 -040011}
12
13static 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}