- Stephen Rothwell: APM updates
[davej-history.git] / include / linux / nfs_flushd.h
blobff235df973ea2caad0dfda97a1b9f1cbaea70f2a
1 #ifndef NFS_CLUSTER_H
2 #define NFS_CLUSTER_H
6 #ifdef __KERNEL__
7 #include <asm/atomic.h>
8 #include <linux/nfs_fs_sb.h>
11 * Counters of total number and pending number of requests.
12 * When the total number of requests exceeds the soft limit, we start
13 * flushing out requests. If it exceeds the hard limit, we stall until
14 * it drops again.
16 #define MAX_REQUEST_SOFT 192
17 #define MAX_REQUEST_HARD 256
20 * Maximum number of requests per write cluster.
21 * 32 requests per cluster account for 128K of data on an intel box.
22 * Note: it's a good idea to make this number smaller than MAX_REQUEST_SOFT.
24 * For 100Mbps Ethernet, 128 pages (i.e. 256K) per cluster gives much
25 * better performance.
27 #define REQUEST_HASH_SIZE 16
28 #define REQUEST_NR(off) ((off) >> PAGE_CACHE_SHIFT)
29 #define REQUEST_HASH(ino, off) (((ino) ^ REQUEST_NR(off)) & (REQUEST_HASH_SIZE - 1))
33 * Functions
35 extern int nfs_reqlist_alloc(struct nfs_server *);
36 extern void nfs_reqlist_free(struct nfs_server *);
37 extern int nfs_reqlist_init(struct nfs_server *);
38 extern void nfs_reqlist_exit(struct nfs_server *);
39 extern void inode_schedule_scan(struct inode *, unsigned long);
40 extern void inode_remove_flushd(struct inode *);
41 extern void nfs_wake_flushd(void);
44 * This is the per-mount writeback cache.
46 struct nfs_reqlist {
47 atomic_t nr_requests;
48 unsigned long runat;
49 wait_queue_head_t request_wait;
51 /* The async RPC task that is responsible for scanning the
52 * requests.
54 struct rpc_task *task; /* request flush task */
56 /* Authentication flavor handle for this NFS client */
57 struct rpc_auth *auth;
59 /* The list of all inodes with pending writebacks. */
60 struct inode *inodes;
63 #endif
65 #endif