From 30d3c128eafd2277ca2bb4b62845f25ad9295c12 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Thu, 20 Oct 2011 04:58:32 -0400 Subject: [PATCH] mm: add a "struct page_frag" type containing a page, offset and length A few network drivers currently use skb_frag_struct for this purpose but I have patches which add additional fields and semantics there which these other uses do not want. A structure for reference sub-page regions seems like a generally useful thing so do so instead of adding a network subsystem specific structure. Signed-off-by: Ian Campbell Acked-by: Jens Axboe Acked-by: David Rientjes Signed-off-by: David S. Miller --- include/linux/mm_types.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 774b8952deb..29971a589ff 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h @@ -135,6 +135,17 @@ struct page { #endif ; +struct page_frag { + struct page *page; +#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536) + __u32 offset; + __u32 size; +#else + __u16 offset; + __u16 size; +#endif +}; + typedef unsigned long __nocast vm_flags_t; /* -- 2.11.4.GIT