diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2015-01-03 12:04:58 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2015-01-03 12:04:58 +0100 |
commit | 008d0be72b2f160382c6e880765e96b64a050c65 (patch) | |
tree | 36f48a98a3815a408e2ce1693dd182af90f80305 /release/src/linux/linux/include/linux/nfs_flushd.h | |
parent | 611becfb8726c60cb060368541ad98191d4532f5 (diff) | |
download | tomato-008d0be72b2f160382c6e880765e96b64a050c65.tar.gz tomato-008d0be72b2f160382c6e880765e96b64a050c65.tar.bz2 |
imported original firmware WRT54GL_v4.30.11_11_US
Diffstat (limited to 'release/src/linux/linux/include/linux/nfs_flushd.h')
-rw-r--r-- | release/src/linux/linux/include/linux/nfs_flushd.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/release/src/linux/linux/include/linux/nfs_flushd.h b/release/src/linux/linux/include/linux/nfs_flushd.h new file mode 100644 index 00000000..a06704f8 --- /dev/null +++ b/release/src/linux/linux/include/linux/nfs_flushd.h @@ -0,0 +1,60 @@ +#ifndef NFS_CLUSTER_H +#define NFS_CLUSTER_H + + + +#ifdef __KERNEL__ +#include <asm/atomic.h> +#include <linux/nfs_fs_sb.h> + +/* + * Counters of total number and pending number of requests. + * When the total number of requests exceeds the hard limit, we stall + * until it drops again. + */ +#define MAX_REQUEST_HARD 256 + +/* + * Maximum number of requests per write cluster. + * 32 requests per cluster account for 128K of data on an intel box. + * Note: it's a good idea to make this number smaller than MAX_REQUEST_SOFT. + * + * For 100Mbps Ethernet, 128 pages (i.e. 256K) per cluster gives much + * better performance. + */ +#define REQUEST_HASH_SIZE 16 +#define REQUEST_NR(off) ((off) >> PAGE_CACHE_SHIFT) +#define REQUEST_HASH(ino, off) (((ino) ^ REQUEST_NR(off)) & (REQUEST_HASH_SIZE - 1)) + + +/* + * Functions + */ +extern int nfs_reqlist_alloc(struct nfs_server *); +extern void nfs_reqlist_free(struct nfs_server *); +extern void nfs_reqlist_exit(struct nfs_server *); +extern void nfs_wake_flushd(void); + +/* + * This is the per-mount writeback cache. + */ +struct nfs_reqlist { + atomic_t nr_requests; + unsigned long runat; + wait_queue_head_t request_wait; + + /* The async RPC task that is responsible for scanning the + * requests. + */ + struct rpc_task *task; /* request flush task */ + + /* Authentication flavor handle for this NFS client */ + struct rpc_auth *auth; + + /* The list of all inodes with pending writebacks. */ + struct inode *inodes; +}; + +#endif + +#endif |