The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/compat/linuxkpi/common/include/linux/pagevec.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

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

Cache object: ccb16e0feffcf700a89e9b671c2dcc00


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.