patch-2.3.99-pre3 linux/include/linux/nfs_flushd.h
Next file: linux/include/linux/nfs_fs.h
Previous file: linux/include/linux/nfs.h
Back to the patch index
Back to the overall index
- Lines: 65
- Date:
Thu Mar 23 15:36:44 2000
- Orig file:
v2.3.99-pre2/linux/include/linux/nfs_flushd.h
- Orig date:
Wed Dec 31 16:00:00 1969
diff -u --recursive --new-file v2.3.99-pre2/linux/include/linux/nfs_flushd.h linux/include/linux/nfs_flushd.h
@@ -0,0 +1,64 @@
+#ifndef NFS_CLUSTER_H
+#define NFS_CLUSTER_H
+
+
+
+#ifdef __KERNEL__
+#include <linux/nfs_fs_sb.h>
+
+/*
+ * Counters of total number and pending number of requests.
+ * When the total number of requests exceeds the soft limit, we start
+ * flushing out requests. If it exceeds the hard limit, we stall until
+ * it drops again.
+ */
+#define MAX_REQUEST_SOFT 192
+#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 int nfs_reqlist_init(struct nfs_server *);
+extern void nfs_reqlist_exit(struct nfs_server *);
+extern void inode_schedule_scan(struct inode *, unsigned long);
+extern void inode_remove_flushd(struct inode *);
+extern void nfs_wake_flushd(void);
+
+/*
+ * This is the per-mount writeback cache.
+ */
+struct nfs_reqlist {
+ unsigned int 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
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)