diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/inet.h | 7 | ||||
| -rw-r--r-- | include/linux/nfs_fs.h | 10 | ||||
| -rw-r--r-- | include/linux/nfs_iostat.h | 119 | ||||
| -rw-r--r-- | include/linux/nfs_page.h | 9 | ||||
| -rw-r--r-- | include/linux/nfs_xdr.h | 3 | ||||
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 7 | ||||
| -rw-r--r-- | include/linux/sunrpc/sched.h | 1 |
7 files changed, 149 insertions, 7 deletions
diff --git a/include/linux/inet.h b/include/linux/inet.h index 1354080cf8cf..4cca05c9678e 100644 --- a/include/linux/inet.h +++ b/include/linux/inet.h | |||
| @@ -44,6 +44,13 @@ | |||
| 44 | 44 | ||
| 45 | #include <linux/types.h> | 45 | #include <linux/types.h> |
| 46 | 46 | ||
| 47 | /* | ||
| 48 | * These mimic similar macros defined in user-space for inet_ntop(3). | ||
| 49 | * See /usr/include/netinet/in.h . | ||
| 50 | */ | ||
| 51 | #define INET_ADDRSTRLEN (16) | ||
| 52 | #define INET6_ADDRSTRLEN (48) | ||
| 53 | |||
| 47 | extern __be32 in_aton(const char *str); | 54 | extern __be32 in_aton(const char *str); |
| 48 | extern int in4_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); | 55 | extern int in4_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); |
| 49 | extern int in6_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); | 56 | extern int in6_pton(const char *src, int srclen, u8 *dst, int delim, const char **end); |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 27d6a8d98cef..29d261918734 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
| @@ -12,9 +12,19 @@ | |||
| 12 | #include <linux/magic.h> | 12 | #include <linux/magic.h> |
| 13 | 13 | ||
| 14 | /* Default timeout values */ | 14 | /* Default timeout values */ |
| 15 | #define NFS_DEF_UDP_TIMEO (11) | ||
| 16 | #define NFS_DEF_UDP_RETRANS (3) | ||
| 17 | #define NFS_DEF_TCP_TIMEO (600) | ||
| 18 | #define NFS_DEF_TCP_RETRANS (2) | ||
| 19 | |||
| 15 | #define NFS_MAX_UDP_TIMEOUT (60*HZ) | 20 | #define NFS_MAX_UDP_TIMEOUT (60*HZ) |
| 16 | #define NFS_MAX_TCP_TIMEOUT (600*HZ) | 21 | #define NFS_MAX_TCP_TIMEOUT (600*HZ) |
| 17 | 22 | ||
| 23 | #define NFS_DEF_ACREGMIN (3) | ||
| 24 | #define NFS_DEF_ACREGMAX (60) | ||
| 25 | #define NFS_DEF_ACDIRMIN (30) | ||
| 26 | #define NFS_DEF_ACDIRMAX (60) | ||
| 27 | |||
| 18 | /* | 28 | /* |
| 19 | * When flushing a cluster of dirty pages, there can be different | 29 | * When flushing a cluster of dirty pages, there can be different |
| 20 | * strategies: | 30 | * strategies: |
diff --git a/include/linux/nfs_iostat.h b/include/linux/nfs_iostat.h new file mode 100644 index 000000000000..1cb9a3fed2b3 --- /dev/null +++ b/include/linux/nfs_iostat.h | |||
| @@ -0,0 +1,119 @@ | |||
| 1 | /* | ||
| 2 | * User-space visible declarations for NFS client per-mount | ||
| 3 | * point statistics | ||
| 4 | * | ||
| 5 | * Copyright (C) 2005, 2006 Chuck Lever <cel@netapp.com> | ||
| 6 | * | ||
| 7 | * NFS client per-mount statistics provide information about the | ||
| 8 | * health of the NFS client and the health of each NFS mount point. | ||
| 9 | * Generally these are not for detailed problem diagnosis, but | ||
| 10 | * simply to indicate that there is a problem. | ||
| 11 | * | ||
| 12 | * These counters are not meant to be human-readable, but are meant | ||
| 13 | * to be integrated into system monitoring tools such as "sar" and | ||
| 14 | * "iostat". As such, the counters are sampled by the tools over | ||
| 15 | * time, and are never zeroed after a file system is mounted. | ||
| 16 | * Moving averages can be computed by the tools by taking the | ||
| 17 | * difference between two instantaneous samples and dividing that | ||
| 18 | * by the time between the samples. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef _LINUX_NFS_IOSTAT | ||
| 22 | #define _LINUX_NFS_IOSTAT | ||
| 23 | |||
| 24 | #define NFS_IOSTAT_VERS "1.0" | ||
| 25 | |||
| 26 | /* | ||
| 27 | * NFS byte counters | ||
| 28 | * | ||
| 29 | * 1. SERVER - the number of payload bytes read from or written | ||
| 30 | * to the server by the NFS client via an NFS READ or WRITE | ||
| 31 | * request. | ||
| 32 | * | ||
| 33 | * 2. NORMAL - the number of bytes read or written by applications | ||
| 34 | * via the read(2) and write(2) system call interfaces. | ||
| 35 | * | ||
| 36 | * 3. DIRECT - the number of bytes read or written from files | ||
| 37 | * opened with the O_DIRECT flag. | ||
| 38 | * | ||
| 39 | * These counters give a view of the data throughput into and out | ||
| 40 | * of the NFS client. Comparing the number of bytes requested by | ||
| 41 | * an application with the number of bytes the client requests from | ||
| 42 | * the server can provide an indication of client efficiency | ||
| 43 | * (per-op, cache hits, etc). | ||
| 44 | * | ||
| 45 | * These counters can also help characterize which access methods | ||
| 46 | * are in use. DIRECT by itself shows whether there is any O_DIRECT | ||
| 47 | * traffic. NORMAL + DIRECT shows how much data is going through | ||
| 48 | * the system call interface. A large amount of SERVER traffic | ||
| 49 | * without much NORMAL or DIRECT traffic shows that applications | ||
| 50 | * are using mapped files. | ||
| 51 | * | ||
| 52 | * NFS page counters | ||
| 53 | * | ||
| 54 | * These count the number of pages read or written via nfs_readpage(), | ||
| 55 | * nfs_readpages(), or their write equivalents. | ||
| 56 | * | ||
| 57 | * NB: When adding new byte counters, please include the measured | ||
| 58 | * units in the name of each byte counter to help users of this | ||
| 59 | * interface determine what exactly is being counted. | ||
| 60 | */ | ||
| 61 | enum nfs_stat_bytecounters { | ||
| 62 | NFSIOS_NORMALREADBYTES = 0, | ||
| 63 | NFSIOS_NORMALWRITTENBYTES, | ||
| 64 | NFSIOS_DIRECTREADBYTES, | ||
| 65 | NFSIOS_DIRECTWRITTENBYTES, | ||
| 66 | NFSIOS_SERVERREADBYTES, | ||
| 67 | NFSIOS_SERVERWRITTENBYTES, | ||
| 68 | NFSIOS_READPAGES, | ||
| 69 | NFSIOS_WRITEPAGES, | ||
| 70 | __NFSIOS_BYTESMAX, | ||
| 71 | }; | ||
| 72 | |||
| 73 | /* | ||
| 74 | * NFS event counters | ||
| 75 | * | ||
| 76 | * These counters provide a low-overhead way of monitoring client | ||
| 77 | * activity without enabling NFS trace debugging. The counters | ||
| 78 | * show the rate at which VFS requests are made, and how often the | ||
| 79 | * client invalidates its data and attribute caches. This allows | ||
| 80 | * system administrators to monitor such things as how close-to-open | ||
| 81 | * is working, and answer questions such as "why are there so many | ||
| 82 | * GETATTR requests on the wire?" | ||
| 83 | * | ||
| 84 | * They also count anamolous events such as short reads and writes, | ||
| 85 | * silly renames due to close-after-delete, and operations that | ||
| 86 | * change the size of a file (such operations can often be the | ||
| 87 | * source of data corruption if applications aren't using file | ||
| 88 | * locking properly). | ||
| 89 | */ | ||
| 90 | enum nfs_stat_eventcounters { | ||
| 91 | NFSIOS_INODEREVALIDATE = 0, | ||
| 92 | NFSIOS_DENTRYREVALIDATE, | ||
| 93 | NFSIOS_DATAINVALIDATE, | ||
| 94 | NFSIOS_ATTRINVALIDATE, | ||
| 95 | NFSIOS_VFSOPEN, | ||
| 96 | NFSIOS_VFSLOOKUP, | ||
| 97 | NFSIOS_VFSACCESS, | ||
| 98 | NFSIOS_VFSUPDATEPAGE, | ||
| 99 | NFSIOS_VFSREADPAGE, | ||
| 100 | NFSIOS_VFSREADPAGES, | ||
| 101 | NFSIOS_VFSWRITEPAGE, | ||
| 102 | NFSIOS_VFSWRITEPAGES, | ||
| 103 | NFSIOS_VFSGETDENTS, | ||
| 104 | NFSIOS_VFSSETATTR, | ||
| 105 | NFSIOS_VFSFLUSH, | ||
| 106 | NFSIOS_VFSFSYNC, | ||
| 107 | NFSIOS_VFSLOCK, | ||
| 108 | NFSIOS_VFSRELEASE, | ||
| 109 | NFSIOS_CONGESTIONWAIT, | ||
| 110 | NFSIOS_SETATTRTRUNC, | ||
| 111 | NFSIOS_EXTENDWRITE, | ||
| 112 | NFSIOS_SILLYRENAME, | ||
| 113 | NFSIOS_SHORTREAD, | ||
| 114 | NFSIOS_SHORTWRITE, | ||
| 115 | NFSIOS_DELAY, | ||
| 116 | __NFSIOS_COUNTSMAX, | ||
| 117 | }; | ||
| 118 | |||
| 119 | #endif /* _LINUX_NFS_IOSTAT */ | ||
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index a1676e19e491..3c60685d972b 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
| @@ -27,9 +27,12 @@ | |||
| 27 | /* | 27 | /* |
| 28 | * Valid flags for a dirty buffer | 28 | * Valid flags for a dirty buffer |
| 29 | */ | 29 | */ |
| 30 | #define PG_BUSY 0 | 30 | enum { |
| 31 | #define PG_NEED_COMMIT 1 | 31 | PG_BUSY = 0, |
| 32 | #define PG_NEED_RESCHED 2 | 32 | PG_CLEAN, |
| 33 | PG_NEED_COMMIT, | ||
| 34 | PG_NEED_RESCHED, | ||
| 35 | }; | ||
| 33 | 36 | ||
| 34 | struct nfs_inode; | 37 | struct nfs_inode; |
| 35 | struct nfs_page { | 38 | struct nfs_page { |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index 24263bb8e0be..8c77c11224d1 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
| @@ -829,9 +829,8 @@ struct nfs_rpc_ops { | |||
| 829 | int (*write_done) (struct rpc_task *, struct nfs_write_data *); | 829 | int (*write_done) (struct rpc_task *, struct nfs_write_data *); |
| 830 | void (*commit_setup) (struct nfs_write_data *, struct rpc_message *); | 830 | void (*commit_setup) (struct nfs_write_data *, struct rpc_message *); |
| 831 | int (*commit_done) (struct rpc_task *, struct nfs_write_data *); | 831 | int (*commit_done) (struct rpc_task *, struct nfs_write_data *); |
| 832 | int (*file_open) (struct inode *, struct file *); | ||
| 833 | int (*file_release) (struct inode *, struct file *); | ||
| 834 | int (*lock)(struct file *, int, struct file_lock *); | 832 | int (*lock)(struct file *, int, struct file_lock *); |
| 833 | int (*lock_check_bounds)(const struct file_lock *); | ||
| 835 | void (*clear_acl_cache)(struct inode *); | 834 | void (*clear_acl_cache)(struct inode *); |
| 836 | }; | 835 | }; |
| 837 | 836 | ||
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 6fff7f82ef12..e5bfe01ee305 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -42,7 +42,8 @@ struct rpc_clnt { | |||
| 42 | 42 | ||
| 43 | unsigned int cl_softrtry : 1,/* soft timeouts */ | 43 | unsigned int cl_softrtry : 1,/* soft timeouts */ |
| 44 | cl_discrtry : 1,/* disconnect before retry */ | 44 | cl_discrtry : 1,/* disconnect before retry */ |
| 45 | cl_autobind : 1;/* use getport() */ | 45 | cl_autobind : 1,/* use getport() */ |
| 46 | cl_chatty : 1;/* be verbose */ | ||
| 46 | 47 | ||
| 47 | struct rpc_rtt * cl_rtt; /* RTO estimator data */ | 48 | struct rpc_rtt * cl_rtt; /* RTO estimator data */ |
| 48 | const struct rpc_timeout *cl_timeout; /* Timeout strategy */ | 49 | const struct rpc_timeout *cl_timeout; /* Timeout strategy */ |
| @@ -114,6 +115,7 @@ struct rpc_create_args { | |||
| 114 | #define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 3) | 115 | #define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 3) |
| 115 | #define RPC_CLNT_CREATE_NOPING (1UL << 4) | 116 | #define RPC_CLNT_CREATE_NOPING (1UL << 4) |
| 116 | #define RPC_CLNT_CREATE_DISCRTRY (1UL << 5) | 117 | #define RPC_CLNT_CREATE_DISCRTRY (1UL << 5) |
| 118 | #define RPC_CLNT_CREATE_QUIET (1UL << 6) | ||
| 117 | 119 | ||
| 118 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); | 120 | struct rpc_clnt *rpc_create(struct rpc_create_args *args); |
| 119 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, | 121 | struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, |
| @@ -123,6 +125,9 @@ void rpc_shutdown_client(struct rpc_clnt *); | |||
| 123 | void rpc_release_client(struct rpc_clnt *); | 125 | void rpc_release_client(struct rpc_clnt *); |
| 124 | 126 | ||
| 125 | int rpcb_register(u32, u32, int, unsigned short, int *); | 127 | int rpcb_register(u32, u32, int, unsigned short, int *); |
| 128 | int rpcb_v4_register(const u32 program, const u32 version, | ||
| 129 | const struct sockaddr *address, | ||
| 130 | const char *netid, int *result); | ||
| 126 | int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int); | 131 | int rpcb_getport_sync(struct sockaddr_in *, u32, u32, int); |
| 127 | void rpcb_getport_async(struct rpc_task *); | 132 | void rpcb_getport_async(struct rpc_task *); |
| 128 | 133 | ||
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index d1a5c8c1a0f1..64981a2f1cae 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
| @@ -135,7 +135,6 @@ struct rpc_task_setup { | |||
| 135 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) | 135 | #define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) |
| 136 | #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) | 136 | #define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) |
| 137 | #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) | 137 | #define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) |
| 138 | #define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL) | ||
| 139 | #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) | 138 | #define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) |
| 140 | 139 | ||
| 141 | #define RPC_TASK_RUNNING 0 | 140 | #define RPC_TASK_RUNNING 0 |
