1 /* Public domain. */ 2 3 #ifndef _LINUX_PAGEVEC_H 4 #define _LINUX_PAGEVEC_H 5 6 #include <sys/types.h> 7 #include <sys/systm.h> 8 #include <sys/errno.h> 9 10 #define PAGEVEC_SIZE 15 11 12 struct folio_batch { 13 }; 14 15 struct pagevec { 16 uint8_t nr; 17 struct vm_page *pages[PAGEVEC_SIZE]; 18 }; 19 20 void __pagevec_release(struct pagevec *); 21 22 static inline unsigned int pagevec_space(struct pagevec * pvec)23pagevec_space(struct pagevec *pvec) 24 { 25 return PAGEVEC_SIZE - pvec->nr; 26 } 27 28 static inline void pagevec_init(struct pagevec * pvec)29pagevec_init(struct pagevec *pvec) 30 { 31 pvec->nr = 0; 32 } 33 34 static inline void pagevec_reinit(struct pagevec * pvec)35pagevec_reinit(struct pagevec *pvec) 36 { 37 pvec->nr = 0; 38 } 39 40 static inline unsigned int pagevec_count(struct pagevec * pvec)41pagevec_count(struct pagevec *pvec) 42 { 43 return pvec->nr; 44 } 45 46 static inline unsigned int pagevec_add(struct pagevec * pvec,struct vm_page * page)47pagevec_add(struct pagevec *pvec, struct vm_page *page) 48 { 49 pvec->pages[pvec->nr++] = page; 50 return PAGEVEC_SIZE - pvec->nr; 51 } 52 53 #endif 54