kmap_skb.h 360 B

1234567891011121314151617181920
  1. #include <linux/highmem.h>
  2. static inline void *kmap_skb_frag(const skb_frag_t *frag)
  3. {
  4. #ifdef CONFIG_HIGHMEM
  5. BUG_ON(in_irq());
  6. local_bh_disable();
  7. #endif
  8. return kmap_atomic(frag->page, KM_SKB_DATA_SOFTIRQ);
  9. }
  10. static inline void kunmap_skb_frag(void *vaddr)
  11. {
  12. kunmap_atomic(vaddr, KM_SKB_DATA_SOFTIRQ);
  13. #ifdef CONFIG_HIGHMEM
  14. local_bh_enable();
  15. #endif
  16. }