diff options
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/nfs4.h | 1 | ||||
| -rw-r--r-- | include/linux/nfs_fs_sb.h | 9 | ||||
| -rw-r--r-- | include/linux/sunrpc/cache.h | 40 | ||||
| -rw-r--r-- | include/linux/sunrpc/clnt.h | 43 | ||||
| -rw-r--r-- | include/linux/sunrpc/msg_prot.h | 17 | ||||
| -rw-r--r-- | include/linux/sunrpc/rpc_pipe_fs.h | 20 | ||||
| -rw-r--r-- | include/linux/sunrpc/xdr.h | 10 | ||||
| -rw-r--r-- | include/linux/sunrpc/xprt.h | 2 |
8 files changed, 120 insertions, 22 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index bd2eba530667..33b283601f62 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
| @@ -472,6 +472,7 @@ enum lock_type4 { | |||
| 472 | 472 | ||
| 473 | #define NFSPROC4_NULL 0 | 473 | #define NFSPROC4_NULL 0 |
| 474 | #define NFSPROC4_COMPOUND 1 | 474 | #define NFSPROC4_COMPOUND 1 |
| 475 | #define NFS4_VERSION 4 | ||
| 475 | #define NFS4_MINOR_VERSION 0 | 476 | #define NFS4_MINOR_VERSION 0 |
| 476 | 477 | ||
| 477 | #if defined(CONFIG_NFS_V4_1) | 478 | #if defined(CONFIG_NFS_V4_1) |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 19fe15d12042..320569eabe3b 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
| @@ -167,6 +167,15 @@ struct nfs_server { | |||
| 167 | #define NFS_CAP_SYMLINKS (1U << 2) | 167 | #define NFS_CAP_SYMLINKS (1U << 2) |
| 168 | #define NFS_CAP_ACLS (1U << 3) | 168 | #define NFS_CAP_ACLS (1U << 3) |
| 169 | #define NFS_CAP_ATOMIC_OPEN (1U << 4) | 169 | #define NFS_CAP_ATOMIC_OPEN (1U << 4) |
| 170 | #define NFS_CAP_CHANGE_ATTR (1U << 5) | ||
| 171 | #define NFS_CAP_FILEID (1U << 6) | ||
| 172 | #define NFS_CAP_MODE (1U << 7) | ||
| 173 | #define NFS_CAP_NLINK (1U << 8) | ||
| 174 | #define NFS_CAP_OWNER (1U << 9) | ||
| 175 | #define NFS_CAP_OWNER_GROUP (1U << 10) | ||
| 176 | #define NFS_CAP_ATIME (1U << 11) | ||
| 177 | #define NFS_CAP_CTIME (1U << 12) | ||
| 178 | #define NFS_CAP_MTIME (1U << 13) | ||
| 170 | 179 | ||
| 171 | 180 | ||
| 172 | /* maximum number of slots to use */ | 181 | /* maximum number of slots to use */ |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 2d8b211b9324..6f52b4d7c447 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
| @@ -59,6 +59,15 @@ struct cache_head { | |||
| 59 | 59 | ||
| 60 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ | 60 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ |
| 61 | 61 | ||
| 62 | struct cache_detail_procfs { | ||
| 63 | struct proc_dir_entry *proc_ent; | ||
| 64 | struct proc_dir_entry *flush_ent, *channel_ent, *content_ent; | ||
| 65 | }; | ||
| 66 | |||
| 67 | struct cache_detail_pipefs { | ||
| 68 | struct dentry *dir; | ||
| 69 | }; | ||
| 70 | |||
| 62 | struct cache_detail { | 71 | struct cache_detail { |
| 63 | struct module * owner; | 72 | struct module * owner; |
| 64 | int hash_size; | 73 | int hash_size; |
| @@ -70,15 +79,17 @@ struct cache_detail { | |||
| 70 | char *name; | 79 | char *name; |
| 71 | void (*cache_put)(struct kref *); | 80 | void (*cache_put)(struct kref *); |
| 72 | 81 | ||
| 73 | void (*cache_request)(struct cache_detail *cd, | 82 | int (*cache_upcall)(struct cache_detail *, |
| 74 | struct cache_head *h, | 83 | struct cache_head *); |
| 75 | char **bpp, int *blen); | 84 | |
| 76 | int (*cache_parse)(struct cache_detail *, | 85 | int (*cache_parse)(struct cache_detail *, |
| 77 | char *buf, int len); | 86 | char *buf, int len); |
| 78 | 87 | ||
| 79 | int (*cache_show)(struct seq_file *m, | 88 | int (*cache_show)(struct seq_file *m, |
| 80 | struct cache_detail *cd, | 89 | struct cache_detail *cd, |
| 81 | struct cache_head *h); | 90 | struct cache_head *h); |
| 91 | void (*warn_no_listener)(struct cache_detail *cd, | ||
| 92 | int has_died); | ||
| 82 | 93 | ||
| 83 | struct cache_head * (*alloc)(void); | 94 | struct cache_head * (*alloc)(void); |
| 84 | int (*match)(struct cache_head *orig, struct cache_head *new); | 95 | int (*match)(struct cache_head *orig, struct cache_head *new); |
| @@ -96,13 +107,15 @@ struct cache_detail { | |||
| 96 | 107 | ||
| 97 | /* fields for communication over channel */ | 108 | /* fields for communication over channel */ |
| 98 | struct list_head queue; | 109 | struct list_head queue; |
| 99 | struct proc_dir_entry *proc_ent; | ||
| 100 | struct proc_dir_entry *flush_ent, *channel_ent, *content_ent; | ||
| 101 | 110 | ||
| 102 | atomic_t readers; /* how many time is /chennel open */ | 111 | atomic_t readers; /* how many time is /chennel open */ |
| 103 | time_t last_close; /* if no readers, when did last close */ | 112 | time_t last_close; /* if no readers, when did last close */ |
| 104 | time_t last_warn; /* when we last warned about no readers */ | 113 | time_t last_warn; /* when we last warned about no readers */ |
| 105 | void (*warn_no_listener)(struct cache_detail *cd); | 114 | |
| 115 | union { | ||
| 116 | struct cache_detail_procfs procfs; | ||
| 117 | struct cache_detail_pipefs pipefs; | ||
| 118 | } u; | ||
| 106 | }; | 119 | }; |
| 107 | 120 | ||
| 108 | 121 | ||
| @@ -127,6 +140,10 @@ struct cache_deferred_req { | |||
| 127 | }; | 140 | }; |
| 128 | 141 | ||
| 129 | 142 | ||
| 143 | extern const struct file_operations cache_file_operations_pipefs; | ||
| 144 | extern const struct file_operations content_file_operations_pipefs; | ||
| 145 | extern const struct file_operations cache_flush_operations_pipefs; | ||
| 146 | |||
| 130 | extern struct cache_head * | 147 | extern struct cache_head * |
| 131 | sunrpc_cache_lookup(struct cache_detail *detail, | 148 | sunrpc_cache_lookup(struct cache_detail *detail, |
| 132 | struct cache_head *key, int hash); | 149 | struct cache_head *key, int hash); |
| @@ -134,6 +151,13 @@ extern struct cache_head * | |||
| 134 | sunrpc_cache_update(struct cache_detail *detail, | 151 | sunrpc_cache_update(struct cache_detail *detail, |
| 135 | struct cache_head *new, struct cache_head *old, int hash); | 152 | struct cache_head *new, struct cache_head *old, int hash); |
| 136 | 153 | ||
| 154 | extern int | ||
| 155 | sunrpc_cache_pipe_upcall(struct cache_detail *detail, struct cache_head *h, | ||
| 156 | void (*cache_request)(struct cache_detail *, | ||
| 157 | struct cache_head *, | ||
| 158 | char **, | ||
| 159 | int *)); | ||
| 160 | |||
| 137 | 161 | ||
| 138 | extern void cache_clean_deferred(void *owner); | 162 | extern void cache_clean_deferred(void *owner); |
| 139 | 163 | ||
| @@ -171,6 +195,10 @@ extern void cache_purge(struct cache_detail *detail); | |||
| 171 | extern int cache_register(struct cache_detail *cd); | 195 | extern int cache_register(struct cache_detail *cd); |
| 172 | extern void cache_unregister(struct cache_detail *cd); | 196 | extern void cache_unregister(struct cache_detail *cd); |
| 173 | 197 | ||
| 198 | extern int sunrpc_cache_register_pipefs(struct dentry *parent, const char *, | ||
| 199 | mode_t, struct cache_detail *); | ||
| 200 | extern void sunrpc_cache_unregister_pipefs(struct cache_detail *); | ||
| 201 | |||
| 174 | extern void qword_add(char **bpp, int *lp, char *str); | 202 | extern void qword_add(char **bpp, int *lp, char *str); |
| 175 | extern void qword_addhex(char **bpp, int *lp, char *buf, int blen); | 203 | extern void qword_addhex(char **bpp, int *lp, char *buf, int blen); |
| 176 | extern int qword_get(char **bpp, char *dest, int bufsize); | 204 | extern int qword_get(char **bpp, char *dest, int bufsize); |
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index 37881f1a0bd7..ab3f6e90caa5 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
| @@ -9,6 +9,10 @@ | |||
| 9 | #ifndef _LINUX_SUNRPC_CLNT_H | 9 | #ifndef _LINUX_SUNRPC_CLNT_H |
| 10 | #define _LINUX_SUNRPC_CLNT_H | 10 | #define _LINUX_SUNRPC_CLNT_H |
| 11 | 11 | ||
| 12 | #include <linux/socket.h> | ||
| 13 | #include <linux/in.h> | ||
| 14 | #include <linux/in6.h> | ||
| 15 | |||
| 12 | #include <linux/sunrpc/msg_prot.h> | 16 | #include <linux/sunrpc/msg_prot.h> |
| 13 | #include <linux/sunrpc/sched.h> | 17 | #include <linux/sunrpc/sched.h> |
| 14 | #include <linux/sunrpc/xprt.h> | 18 | #include <linux/sunrpc/xprt.h> |
| @@ -17,6 +21,7 @@ | |||
| 17 | #include <linux/sunrpc/xdr.h> | 21 | #include <linux/sunrpc/xdr.h> |
| 18 | #include <linux/sunrpc/timer.h> | 22 | #include <linux/sunrpc/timer.h> |
| 19 | #include <asm/signal.h> | 23 | #include <asm/signal.h> |
| 24 | #include <linux/path.h> | ||
| 20 | 25 | ||
| 21 | struct rpc_inode; | 26 | struct rpc_inode; |
| 22 | 27 | ||
| @@ -50,9 +55,7 @@ struct rpc_clnt { | |||
| 50 | 55 | ||
| 51 | int cl_nodelen; /* nodename length */ | 56 | int cl_nodelen; /* nodename length */ |
| 52 | char cl_nodename[UNX_MAXNODENAME]; | 57 | char cl_nodename[UNX_MAXNODENAME]; |
| 53 | char cl_pathname[30];/* Path in rpc_pipe_fs */ | 58 | struct path cl_path; |
| 54 | struct vfsmount * cl_vfsmnt; | ||
| 55 | struct dentry * cl_dentry; /* inode */ | ||
| 56 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ | 59 | struct rpc_clnt * cl_parent; /* Points to parent of clones */ |
| 57 | struct rpc_rtt cl_rtt_default; | 60 | struct rpc_rtt cl_rtt_default; |
| 58 | struct rpc_timeout cl_timeout_default; | 61 | struct rpc_timeout cl_timeout_default; |
| @@ -151,5 +154,39 @@ void rpc_force_rebind(struct rpc_clnt *); | |||
| 151 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); | 154 | size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); |
| 152 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); | 155 | const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); |
| 153 | 156 | ||
| 157 | size_t rpc_ntop(const struct sockaddr *, char *, const size_t); | ||
| 158 | size_t rpc_pton(const char *, const size_t, | ||
| 159 | struct sockaddr *, const size_t); | ||
| 160 | char * rpc_sockaddr2uaddr(const struct sockaddr *); | ||
| 161 | size_t rpc_uaddr2sockaddr(const char *, const size_t, | ||
| 162 | struct sockaddr *, const size_t); | ||
| 163 | |||
| 164 | static inline unsigned short rpc_get_port(const struct sockaddr *sap) | ||
| 165 | { | ||
| 166 | switch (sap->sa_family) { | ||
| 167 | case AF_INET: | ||
| 168 | return ntohs(((struct sockaddr_in *)sap)->sin_port); | ||
| 169 | case AF_INET6: | ||
| 170 | return ntohs(((struct sockaddr_in6 *)sap)->sin6_port); | ||
| 171 | } | ||
| 172 | return 0; | ||
| 173 | } | ||
| 174 | |||
| 175 | static inline void rpc_set_port(struct sockaddr *sap, | ||
| 176 | const unsigned short port) | ||
| 177 | { | ||
| 178 | switch (sap->sa_family) { | ||
| 179 | case AF_INET: | ||
| 180 | ((struct sockaddr_in *)sap)->sin_port = htons(port); | ||
| 181 | break; | ||
| 182 | case AF_INET6: | ||
| 183 | ((struct sockaddr_in6 *)sap)->sin6_port = htons(port); | ||
| 184 | break; | ||
| 185 | } | ||
| 186 | } | ||
| 187 | |||
| 188 | #define IPV6_SCOPE_DELIMITER '%' | ||
| 189 | #define IPV6_SCOPE_ID_LEN sizeof("%nnnnnnnnnn") | ||
| 190 | |||
| 154 | #endif /* __KERNEL__ */ | 191 | #endif /* __KERNEL__ */ |
| 155 | #endif /* _LINUX_SUNRPC_CLNT_H */ | 192 | #endif /* _LINUX_SUNRPC_CLNT_H */ |
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index 70df4f1d8847..77e624883393 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
| @@ -189,7 +189,22 @@ typedef __be32 rpc_fraghdr; | |||
| 189 | * Additionally, the two alternative forms specified in Section 2.2 of | 189 | * Additionally, the two alternative forms specified in Section 2.2 of |
| 190 | * [RFC2373] are also acceptable. | 190 | * [RFC2373] are also acceptable. |
| 191 | */ | 191 | */ |
| 192 | #define RPCBIND_MAXUADDRLEN (56u) | 192 | |
| 193 | #include <linux/inet.h> | ||
| 194 | |||
| 195 | /* Maximum size of the port number part of a universal address */ | ||
| 196 | #define RPCBIND_MAXUADDRPLEN sizeof(".255.255") | ||
| 197 | |||
| 198 | /* Maximum size of an IPv4 universal address */ | ||
| 199 | #define RPCBIND_MAXUADDR4LEN \ | ||
| 200 | (INET_ADDRSTRLEN + RPCBIND_MAXUADDRPLEN) | ||
| 201 | |||
| 202 | /* Maximum size of an IPv6 universal address */ | ||
| 203 | #define RPCBIND_MAXUADDR6LEN \ | ||
| 204 | (INET6_ADDRSTRLEN + RPCBIND_MAXUADDRPLEN) | ||
| 205 | |||
| 206 | /* Assume INET6_ADDRSTRLEN will always be larger than INET_ADDRSTRLEN... */ | ||
| 207 | #define RPCBIND_MAXUADDRLEN RPCBIND_MAXUADDR6LEN | ||
| 193 | 208 | ||
| 194 | #endif /* __KERNEL__ */ | 209 | #endif /* __KERNEL__ */ |
| 195 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ | 210 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ |
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h index cea764c2359f..cf14db975da0 100644 --- a/include/linux/sunrpc/rpc_pipe_fs.h +++ b/include/linux/sunrpc/rpc_pipe_fs.h | |||
| @@ -3,6 +3,8 @@ | |||
| 3 | 3 | ||
| 4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
| 5 | 5 | ||
| 6 | #include <linux/workqueue.h> | ||
| 7 | |||
| 6 | struct rpc_pipe_msg { | 8 | struct rpc_pipe_msg { |
| 7 | struct list_head list; | 9 | struct list_head list; |
| 8 | void *data; | 10 | void *data; |
| @@ -32,8 +34,8 @@ struct rpc_inode { | |||
| 32 | wait_queue_head_t waitq; | 34 | wait_queue_head_t waitq; |
| 33 | #define RPC_PIPE_WAIT_FOR_OPEN 1 | 35 | #define RPC_PIPE_WAIT_FOR_OPEN 1 |
| 34 | int flags; | 36 | int flags; |
| 35 | struct rpc_pipe_ops *ops; | ||
| 36 | struct delayed_work queue_timeout; | 37 | struct delayed_work queue_timeout; |
| 38 | const struct rpc_pipe_ops *ops; | ||
| 37 | }; | 39 | }; |
| 38 | 40 | ||
| 39 | static inline struct rpc_inode * | 41 | static inline struct rpc_inode * |
| @@ -44,9 +46,19 @@ RPC_I(struct inode *inode) | |||
| 44 | 46 | ||
| 45 | extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); | 47 | extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); |
| 46 | 48 | ||
| 47 | extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); | 49 | struct rpc_clnt; |
| 48 | extern int rpc_rmdir(struct dentry *); | 50 | extern struct dentry *rpc_create_client_dir(struct dentry *, struct qstr *, struct rpc_clnt *); |
| 49 | extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, struct rpc_pipe_ops *, int flags); | 51 | extern int rpc_remove_client_dir(struct dentry *); |
| 52 | |||
| 53 | struct cache_detail; | ||
| 54 | extern struct dentry *rpc_create_cache_dir(struct dentry *, | ||
| 55 | struct qstr *, | ||
| 56 | mode_t umode, | ||
| 57 | struct cache_detail *); | ||
| 58 | extern void rpc_remove_cache_dir(struct dentry *); | ||
| 59 | |||
| 60 | extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, | ||
| 61 | const struct rpc_pipe_ops *, int flags); | ||
| 50 | extern int rpc_unlink(struct dentry *); | 62 | extern int rpc_unlink(struct dentry *); |
| 51 | extern struct vfsmount *rpc_get_mount(void); | 63 | extern struct vfsmount *rpc_get_mount(void); |
| 52 | extern void rpc_put_mount(void); | 64 | extern void rpc_put_mount(void); |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index b99c625fddfe..7da466ba4b0d 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
| @@ -117,17 +117,15 @@ static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int le | |||
| 117 | static inline __be32 * | 117 | static inline __be32 * |
| 118 | xdr_encode_hyper(__be32 *p, __u64 val) | 118 | xdr_encode_hyper(__be32 *p, __u64 val) |
| 119 | { | 119 | { |
| 120 | *p++ = htonl(val >> 32); | 120 | *(__be64 *)p = cpu_to_be64(val); |
| 121 | *p++ = htonl(val & 0xFFFFFFFF); | 121 | return p + 2; |
| 122 | return p; | ||
| 123 | } | 122 | } |
| 124 | 123 | ||
| 125 | static inline __be32 * | 124 | static inline __be32 * |
| 126 | xdr_decode_hyper(__be32 *p, __u64 *valp) | 125 | xdr_decode_hyper(__be32 *p, __u64 *valp) |
| 127 | { | 126 | { |
| 128 | *valp = ((__u64) ntohl(*p++)) << 32; | 127 | *valp = be64_to_cpup((__be64 *)p); |
| 129 | *valp |= ntohl(*p++); | 128 | return p + 2; |
| 130 | return p; | ||
| 131 | } | 129 | } |
| 132 | 130 | ||
| 133 | /* | 131 | /* |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 1175d58efc2e..c090df442572 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
| @@ -38,10 +38,8 @@ enum rpc_display_format_t { | |||
| 38 | RPC_DISPLAY_ADDR = 0, | 38 | RPC_DISPLAY_ADDR = 0, |
| 39 | RPC_DISPLAY_PORT, | 39 | RPC_DISPLAY_PORT, |
| 40 | RPC_DISPLAY_PROTO, | 40 | RPC_DISPLAY_PROTO, |
| 41 | RPC_DISPLAY_ALL, | ||
| 42 | RPC_DISPLAY_HEX_ADDR, | 41 | RPC_DISPLAY_HEX_ADDR, |
| 43 | RPC_DISPLAY_HEX_PORT, | 42 | RPC_DISPLAY_HEX_PORT, |
| 44 | RPC_DISPLAY_UNIVERSAL_ADDR, | ||
| 45 | RPC_DISPLAY_NETID, | 43 | RPC_DISPLAY_NETID, |
| 46 | RPC_DISPLAY_MAX, | 44 | RPC_DISPLAY_MAX, |
| 47 | }; | 45 | }; |
