Subversion Repositories shark

Rev

Rev 422 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
422 giacomo 1
/*
2
 * include/linux/writeback.h.
3
 */
4
#ifndef WRITEBACK_H
5
#define WRITEBACK_H
6
 
7
struct backing_dev_info;
8
 
9
extern spinlock_t inode_lock;
10
extern struct list_head inode_in_use;
11
extern struct list_head inode_unused;
12
 
13
/*
14
 * Yes, writeback.h requires sched.h
15
 * No, sched.h is not included from here.
16
 */
17
static inline int current_is_pdflush(void)
18
{
19
        return current->flags & PF_FLUSHER;
20
}
21
 
22
/*
23
 * fs/fs-writeback.c
24
 */
25
enum writeback_sync_modes {
26
        WB_SYNC_NONE,   /* Don't wait on anything */
27
        WB_SYNC_ALL,    /* Wait on every mapping */
28
        WB_SYNC_HOLD,   /* Hold the inode on sb_dirty for sys_sync() */
29
};
30
 
31
/*
32
 * A control structure which tells the writeback code what to do
33
 */
34
struct writeback_control {
35
        struct backing_dev_info *bdi;   /* If !NULL, only write back this
36
                                           queue */
37
        enum writeback_sync_modes sync_mode;
38
        unsigned long *older_than_this; /* If !NULL, only write back inodes
39
                                           older than this */
40
        long nr_to_write;               /* Write this many pages, and decrement
41
                                           this for each page written */
42
        int nonblocking;                /* Don't get stuck on request queues */
43
        int encountered_congestion;     /* An output: a queue is full */
44
        int for_kupdate;                /* A kupdate writeback */
45
        int for_reclaim;                /* Invoked from the page allocator */
46
};
47
 
48
/*
49
 * ->writepage() return values (make these much larger than a pagesize, in
50
 * case some fs is returning number-of-bytes-written from writepage)
51
 */
52
#define WRITEPAGE_ACTIVATE      0x80000 /* IO was not started: activate page */
53
 
54
/*
55
 * fs/fs-writeback.c
56
 */    
57
void writeback_inodes(struct writeback_control *wbc);
58
void wake_up_inode(struct inode *inode);
59
void __wait_on_inode(struct inode * inode);
60
void sync_inodes_sb(struct super_block *, int wait);
61
void sync_inodes(int wait);
62
 
63
/* writeback.h requires fs.h; it, too, is not included from here. */
64
static inline void wait_on_inode(struct inode *inode)
65
{
66
        if (inode->i_state & I_LOCK)
67
                __wait_on_inode(inode);
68
}
69
 
70
/*
71
 * mm/page-writeback.c
72
 */
73
int wakeup_bdflush(long nr_pages);
74
 
75
/* These 5 are exported to sysctl. */
76
extern int dirty_background_ratio;
77
extern int vm_dirty_ratio;
78
extern int dirty_writeback_centisecs;
79
extern int dirty_expire_centisecs;
80
 
81
struct ctl_table;
82
struct file;
83
int dirty_writeback_centisecs_handler(struct ctl_table *, int, struct file *,
84
                                      void __user *, size_t *);
85
 
86
void page_writeback_init(void);
87
void balance_dirty_pages_ratelimited(struct address_space *mapping);
88
int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0);
89
int do_writepages(struct address_space *mapping, struct writeback_control *wbc);
90
 
91
/* pdflush.c */
92
extern int nr_pdflush_threads;  /* Global so it can be exported to sysctl
93
                                   read-only. */
94
 
95
 
96
#endif          /* WRITEBACK_H */