1 /* Copyright 2003 by Hans Reiser, licensing governed by reiser4/README */
11 #include <linux/completion.h>
12 #include <linux/wait.h>
13 #include <linux/spinlock.h>
14 #include <linux/sched.h> /* for struct task_struct */
16 #define WBQ_MAGIC 0x7876dc76
18 /* write-back request. */
21 struct list_head link
; /* list head of this list is in entd context */
22 struct writeback_control
*wbc
;
24 struct address_space
*mapping
;
25 struct completion completion
;
26 jnode
*node
; /* set if ent thread captured requested page */
27 int written
; /* set if ent thread wrote requested page */
30 /* ent-thread context. This is used to synchronize starting/stopping ent
32 typedef struct entd_context
{
33 /* wait queue that ent thread waits on for more work. It's
34 * signaled by write_page_by_ent(). */
35 wait_queue_head_t wait
;
36 /* spinlock protecting other fields */
39 struct task_struct
*tsk
;
40 /* set to indicate that ent thread should leave. */
42 /* counter of active flushers */
45 * when reiser4_writepage asks entd to write a page - it adds struct
48 struct list_head todo_list
;
49 /* number of elements on the above list */
52 struct wbq
*cur_request
;
54 * when entd writes a page it moves write-back request from todo_list
55 * to done_list. This list is used at the end of entd iteration to
56 * wakeup requestors and iput inodes.
58 struct list_head done_list
;
59 /* number of elements on the above list */
63 /* list of all active flushers */
64 struct list_head flushers_list
;
68 extern int reiser4_init_entd(struct super_block
*);
69 extern void reiser4_done_entd(struct super_block
*);
71 extern void reiser4_enter_flush(struct super_block
*);
72 extern void reiser4_leave_flush(struct super_block
*);
74 extern int write_page_by_ent(struct page
*, struct writeback_control
*);
75 extern int wbq_available(void);
76 extern void ent_writes_page(struct super_block
*, struct page
*);
78 extern jnode
*get_jnode_by_wbq(struct super_block
*, struct wbq
*);
84 c-indentation-style: "K&R"