Home | History | Annotate | Download | only in linux
      1 /****************************************************************************
      2  ****************************************************************************
      3  ***
      4  ***   This header was automatically generated from a Linux kernel header
      5  ***   of the same name, to make information necessary for userspace to
      6  ***   call into the kernel available to libc.  It contains only constants,
      7  ***   structures, and macros generated from the original header, and thus,
      8  ***   contains no copyrightable information.
      9  ***
     10  ****************************************************************************
     11  ****************************************************************************/
     12 #ifndef _LINUX_BACKING_DEV_H
     13 #define _LINUX_BACKING_DEV_H
     14 
     15 #include <asm/atomic.h>
     16 
     17 enum bdi_state {
     18  BDI_pdflush,
     19  BDI_write_congested,
     20  BDI_read_congested,
     21  BDI_unused,
     22 };
     23 
     24 typedef int (congested_fn)(void *, int);
     25 
     26 struct backing_dev_info {
     27  unsigned long ra_pages;
     28  unsigned long state;
     29  unsigned int capabilities;
     30  congested_fn *congested_fn;
     31  void *congested_data;
     32  void (*unplug_io_fn)(struct backing_dev_info *, struct page *);
     33  void *unplug_io_data;
     34 };
     35 
     36 #define BDI_CAP_NO_ACCT_DIRTY 0x00000001
     37 #define BDI_CAP_NO_WRITEBACK 0x00000002
     38 #define BDI_CAP_MAP_COPY 0x00000004
     39 #define BDI_CAP_MAP_DIRECT 0x00000008
     40 #define BDI_CAP_READ_MAP 0x00000010
     41 #define BDI_CAP_WRITE_MAP 0x00000020
     42 #define BDI_CAP_EXEC_MAP 0x00000040
     43 #define BDI_CAP_VMFLAGS   (BDI_CAP_READ_MAP | BDI_CAP_WRITE_MAP | BDI_CAP_EXEC_MAP)
     44 
     45 #if defined(VM_MAYREAD) && BDI_CAP_READ_MAP != (VM_MAYREAD || BDI_CAP_WRITE_MAP != (VM_MAYWRITE || BDI_CAP_EXEC_MAP != VM_MAYEXEC))
     46 #error please change backing_dev_info::capabilities flags
     47 #endif
     48 
     49 #define bdi_cap_writeback_dirty(bdi)   (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK))
     50 #define bdi_cap_account_dirty(bdi)   (!((bdi)->capabilities & BDI_CAP_NO_ACCT_DIRTY))
     51 #define mapping_cap_writeback_dirty(mapping)   bdi_cap_writeback_dirty((mapping)->backing_dev_info)
     52 #define mapping_cap_account_dirty(mapping)   bdi_cap_account_dirty((mapping)->backing_dev_info)
     53 #endif
     54