ia64/linux-2.6.18-xen.hg

view drivers/xen/blkback/blkback-pagemap.h @ 894:4e5cd2fc45a7

linux: fix blkback/blktap2 interaction

blkback's page map code needs to be accessible to both blkback and
blktap2, irrespective of whether either or both are modules. The
most immediate solution is to break it out into a separate, library-
like component that doesn't need building if either of the two
consumers is configured off, and that gets built as a module if both
consumers are modules.

Also fix the dummy implementation of blkback_pagemap_read(), since
using BUG() there doesn't compile.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 04 10:33:52 2009 +0100 (2009-06-04)
parents eba6fe6d8d53
children
line source
1 #ifndef _BLKBACK_PAGEMAP_H_
2 #define _BLKBACK_PAGEMAP_H_
4 #include <linux/mm.h>
5 #include <xen/interface/xen.h>
6 #include <xen/interface/grant_table.h>
8 typedef unsigned int busid_t;
10 struct blkback_pagemap {
11 domid_t domid;
12 busid_t busid;
13 grant_ref_t gref;
14 };
16 #if defined(CONFIG_XEN_BLKBACK_PAGEMAP) || defined(CONFIG_XEN_BLKBACK_PAGEMAP_MODULE)
18 int blkback_pagemap_init(int);
19 void blkback_pagemap_set(int, struct page *, domid_t, busid_t, grant_ref_t);
20 void blkback_pagemap_clear(struct page *);
21 struct blkback_pagemap blkback_pagemap_read(struct page *);
23 #else /* CONFIG_XEN_BLKBACK_PAGEMAP */
25 static inline int blkback_pagemap_init(int pages) { return 0; }
26 static inline void blkback_pagemap_set(int idx, struct page *page, domid_t dom,
27 busid_t bus, grant_ref_t gnt) {}
28 static inline void blkback_pagemap_clear(struct page *page) {}
29 static inline struct blkback_pagemap blkback_pagemap_read(struct page *page)
30 {
31 BUG();
32 return (struct blkback_pagemap){-1, -1, -1};
33 }
35 #endif /* CONFIG_XEN_BLKBACK_PAGEMAP */
37 #endif