linux-bk/include/linux/writeback.h
<<
>>
Prefs
   1/*
   2 * include/linux/writeback.h.
   3 *
   4 * These declarations are private to fs/ and mm/.
   5 * Declarations which are exported to filesystems do not
   6 * get placed here.
   7 */
   8#ifndef WRITEBACK_H
   9#define WRITEBACK_H
  10
  11struct backing_dev_info;
  12
  13extern spinlock_t inode_lock;
  14extern struct list_head inode_in_use;
  15extern struct list_head inode_unused;
  16
  17/*
  18 * Yes, writeback.h requires sched.h
  19 * No, sched.h is not included from here.
  20 */
  21static inline int current_is_pdflush(void)
  22{
  23        return current->flags & PF_FLUSHER;
  24}
  25
  26/*
  27 * fs/fs-writeback.c
  28 */
  29enum writeback_sync_modes {
  30        WB_SYNC_NONE =  0,      /* Don't wait on anything */
  31        WB_SYNC_LAST =  1,      /* Wait on the last-written mapping */
  32        WB_SYNC_ALL =   2,      /* Wait on every mapping */
  33        WB_SYNC_HOLD =  3,      /* Hold the inode on sb_dirty for sys_sync() */
  34};
  35
  36void writeback_unlocked_inodes(int *nr_to_write,
  37                               enum writeback_sync_modes sync_mode,
  38                               unsigned long *older_than_this);
  39void wake_up_inode(struct inode *inode);
  40void __wait_on_inode(struct inode * inode);
  41void sync_inodes_sb(struct super_block *, int wait);
  42void sync_inodes(int wait);
  43void writeback_backing_dev(struct backing_dev_info *bdi, int *nr_to_write,
  44                        enum writeback_sync_modes sync_mode,
  45                        unsigned long *older_than_this);
  46
  47/* writeback.h requires fs.h; it, too, is not included from here. */
  48static inline void wait_on_inode(struct inode *inode)
  49{
  50        if (inode->i_state & I_LOCK)
  51                __wait_on_inode(inode);
  52}
  53
  54/*
  55 * mm/page-writeback.c
  56 */
  57/* These 5 are exported to sysctl. */
  58extern int dirty_background_ratio;
  59extern int dirty_async_ratio;
  60extern int dirty_sync_ratio;
  61extern int dirty_writeback_centisecs;
  62extern int dirty_expire_centisecs;
  63
  64
  65void balance_dirty_pages(struct address_space *mapping);
  66void balance_dirty_pages_ratelimited(struct address_space *mapping);
  67int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0);
  68int do_writepages(struct address_space *mapping, int *nr_to_write);
  69
  70/* pdflush.c */
  71extern int nr_pdflush_threads;  /* Global so it can be exported to sysctl
  72                                   read-only. */
  73
  74
  75#endif          /* WRITEBACK_H */
  76
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.