0001
0002 #ifndef PAGE_ACTOR_H
0003 #define PAGE_ACTOR_H
0004
0005
0006
0007
0008
0009 struct squashfs_page_actor {
0010 union {
0011 void **buffer;
0012 struct page **page;
0013 };
0014 void *pageaddr;
0015 void *tmp_buffer;
0016 void *(*squashfs_first_page)(struct squashfs_page_actor *);
0017 void *(*squashfs_next_page)(struct squashfs_page_actor *);
0018 void (*squashfs_finish_page)(struct squashfs_page_actor *);
0019 int pages;
0020 int length;
0021 int next_page;
0022 int alloc_buffer;
0023 int returned_pages;
0024 pgoff_t next_index;
0025 };
0026
0027 extern struct squashfs_page_actor *squashfs_page_actor_init(void **buffer,
0028 int pages, int length);
0029 extern struct squashfs_page_actor *squashfs_page_actor_init_special(
0030 struct squashfs_sb_info *msblk,
0031 struct page **page, int pages, int length);
0032 static inline void squashfs_page_actor_free(struct squashfs_page_actor *actor)
0033 {
0034 kfree(actor->tmp_buffer);
0035 kfree(actor);
0036 }
0037 static inline void *squashfs_first_page(struct squashfs_page_actor *actor)
0038 {
0039 return actor->squashfs_first_page(actor);
0040 }
0041 static inline void *squashfs_next_page(struct squashfs_page_actor *actor)
0042 {
0043 return actor->squashfs_next_page(actor);
0044 }
0045 static inline void squashfs_finish_page(struct squashfs_page_actor *actor)
0046 {
0047 actor->squashfs_finish_page(actor);
0048 }
0049 static inline void squashfs_actor_nobuff(struct squashfs_page_actor *actor)
0050 {
0051 actor->alloc_buffer = 0;
0052 }
0053 #endif