History

sunrpc: remove __KERNEL__ ifdefs

Remove the __KERNEL__ ifdefs from the non-UAPI sunrpc headers, as those can't be included from user space programs.

Christoph Hellwig committed 7 years ago

Commit d05a0201 parent 581ae6812 files · +0 −36Browse files

Showing the changes to include/linux (12 of 12 files). Show all

Unified · Split

12 files
  1. include/linux/sunrpc/auth.h +0 −3
  2. include/linux/sunrpc/auth_gss.h +0 −2
  3. include/linux/sunrpc/clnt.h +0 −3
  4. include/linux/sunrpc/gss_api.h +0 −2
  5. include/linux/sunrpc/gss_err.h +0 −3
  6. include/linux/sunrpc/msg_prot.h +0 −3
  7. include/linux/sunrpc/rpc_pipe_fs.h +0 −3
  8. include/linux/sunrpc/svcauth.h +0 −4
  9. include/linux/sunrpc/svcauth_gss.h +0 −2
  10. include/linux/sunrpc/xdr.h +0 −3
  11. include/linux/sunrpc/xprt.h +0 −4
  12. include/linux/sunrpc/xprtsock.h +0 −4
include/linux/sunrpc/auth.h+0−3
@@ -10,8 +10,6 @@ · 9 unmodified lines
10#ifndef _LINUX_SUNRPC_AUTH_H10#ifndef _LINUX_SUNRPC_AUTH_H
11#define _LINUX_SUNRPC_AUTH_H11#define _LINUX_SUNRPC_AUTH_H
12 12
13#ifdef __KERNEL__
14
15#include <linux/sunrpc/sched.h>13#include <linux/sunrpc/sched.h>
16#include <linux/sunrpc/msg_prot.h>14#include <linux/sunrpc/msg_prot.h>
17#include <linux/sunrpc/xdr.h>15#include <linux/sunrpc/xdr.h>
@@ -194,5 +192,4 @@ struct rpc_cred *get_rpccred(struct rpc_cred *cred) · 176 unmodified lines
194 return NULL;192 return NULL;
195}193}
196 194
197#endif /* __KERNEL__ */
198#endif /* _LINUX_SUNRPC_AUTH_H */195#endif /* _LINUX_SUNRPC_AUTH_H */
include/linux/sunrpc/auth_gss.h+0−2
@@ -13,7 +13,6 @@ · 12 unmodified lines
13#ifndef _LINUX_SUNRPC_AUTH_GSS_H13#ifndef _LINUX_SUNRPC_AUTH_GSS_H
14#define _LINUX_SUNRPC_AUTH_GSS_H14#define _LINUX_SUNRPC_AUTH_GSS_H
15 15
16#ifdef __KERNEL__
17#include <linux/refcount.h>16#include <linux/refcount.h>
18#include <linux/sunrpc/auth.h>17#include <linux/sunrpc/auth.h>
19#include <linux/sunrpc/svc.h>18#include <linux/sunrpc/svc.h>
@@ -90,6 +89,5 @@ struct gss_cred { · 70 unmodified lines
90 unsigned long gc_upcall_timestamp;89 unsigned long gc_upcall_timestamp;
91};90};
92 91
93#endif /* __KERNEL__ */
94#endif /* _LINUX_SUNRPC_AUTH_GSS_H */92#endif /* _LINUX_SUNRPC_AUTH_GSS_H */
95 93
include/linux/sunrpc/clnt.h+0−3
@@ -109,8 +109,6 @@ struct rpc_procinfo { · 108 unmodified lines
109 const char * p_name; /* name of procedure */109 const char * p_name; /* name of procedure */
110};110};
111 111
112#ifdef __KERNEL__
113
114struct rpc_create_args {112struct rpc_create_args {
115 struct net *net;113 struct net *net;
116 int protocol;114 int protocol;
@@ -237,5 +235,4 @@ static inline int rpc_reply_expected(struct rpc_task *task) · 120 unmodified lines
237 (task->tk_msg.rpc_proc->p_decode != NULL);235 (task->tk_msg.rpc_proc->p_decode != NULL);
238}236}
239 237
240#endif /* __KERNEL__ */
241#endif /* _LINUX_SUNRPC_CLNT_H */238#endif /* _LINUX_SUNRPC_CLNT_H */
include/linux/sunrpc/gss_api.h+0−2
@@ -13,7 +13,6 @@ · 12 unmodified lines
13#ifndef _LINUX_SUNRPC_GSS_API_H13#ifndef _LINUX_SUNRPC_GSS_API_H
14#define _LINUX_SUNRPC_GSS_API_H14#define _LINUX_SUNRPC_GSS_API_H
15 15
16#ifdef __KERNEL__
17#include <linux/sunrpc/xdr.h>16#include <linux/sunrpc/xdr.h>
18#include <linux/sunrpc/msg_prot.h>17#include <linux/sunrpc/msg_prot.h>
19#include <linux/uio.h>18#include <linux/uio.h>
@@ -160,6 +159,5 @@ struct gss_api_mech * gss_mech_get(struct gss_api_mech *); · 140 unmodified lines
160 * corresponding call to gss_mech_put. */159 * corresponding call to gss_mech_put. */
161void gss_mech_put(struct gss_api_mech *);160void gss_mech_put(struct gss_api_mech *);
162 161
163#endif /* __KERNEL__ */
164#endif /* _LINUX_SUNRPC_GSS_API_H */162#endif /* _LINUX_SUNRPC_GSS_API_H */
165 163
include/linux/sunrpc/gss_err.h+0−3
@@ -34,8 +34,6 @@ · 33 unmodified lines
34#ifndef _LINUX_SUNRPC_GSS_ERR_H34#ifndef _LINUX_SUNRPC_GSS_ERR_H
35#define _LINUX_SUNRPC_GSS_ERR_H35#define _LINUX_SUNRPC_GSS_ERR_H
36 36
37#ifdef __KERNEL__
38
39typedef unsigned int OM_uint32;37typedef unsigned int OM_uint32;
40 38
41/*39/*
@@ -163,5 +161,4 @@ typedef unsigned int OM_uint32; · 121 unmodified lines
163/* XXXX This is a necessary evil until the spec is fixed */161/* XXXX This is a necessary evil until the spec is fixed */
164#define GSS_S_CRED_UNAVAIL GSS_S_FAILURE162#define GSS_S_CRED_UNAVAIL GSS_S_FAILURE
165 163
166#endif /* __KERNEL__ */
167#endif /* __LINUX_SUNRPC_GSS_ERR_H */164#endif /* __LINUX_SUNRPC_GSS_ERR_H */
include/linux/sunrpc/msg_prot.h+0−3
@@ -8,8 +8,6 @@ · 7 unmodified lines
8#ifndef _LINUX_SUNRPC_MSGPROT_H_8#ifndef _LINUX_SUNRPC_MSGPROT_H_
9#define _LINUX_SUNRPC_MSGPROT_H_9#define _LINUX_SUNRPC_MSGPROT_H_
10 10
11#ifdef __KERNEL__ /* user programs should get these from the rpc header files */
12
13#define RPC_VERSION 211#define RPC_VERSION 2
14 12
15/* size of an XDR encoding unit in bytes, i.e. 32bit */13/* size of an XDR encoding unit in bytes, i.e. 32bit */
@@ -217,5 +215,4 @@ typedef __be32 rpc_fraghdr; · 201 unmodified lines
217/* Assume INET6_ADDRSTRLEN will always be larger than INET_ADDRSTRLEN... */215/* Assume INET6_ADDRSTRLEN will always be larger than INET_ADDRSTRLEN... */
218#define RPCBIND_MAXUADDRLEN RPCBIND_MAXUADDR6LEN216#define RPCBIND_MAXUADDRLEN RPCBIND_MAXUADDR6LEN
219 217
220#endif /* __KERNEL__ */
221#endif /* _LINUX_SUNRPC_MSGPROT_H_ */218#endif /* _LINUX_SUNRPC_MSGPROT_H_ */
include/linux/sunrpc/rpc_pipe_fs.h+0−3
@@ -2,8 +2,6 @@ · 1 unmodified line
2#ifndef _LINUX_SUNRPC_RPC_PIPE_FS_H2#ifndef _LINUX_SUNRPC_RPC_PIPE_FS_H
3#define _LINUX_SUNRPC_RPC_PIPE_FS_H3#define _LINUX_SUNRPC_RPC_PIPE_FS_H
4 4
5#ifdef __KERNEL__
6
7#include <linux/workqueue.h>5#include <linux/workqueue.h>
8 6
9struct rpc_pipe_dir_head {7struct rpc_pipe_dir_head {
@@ -133,4 +131,3 @@ extern void unregister_rpc_pipefs(void); · 123 unmodified lines
133extern bool gssd_running(struct net *net);131extern bool gssd_running(struct net *net);
134 132
135#endif133#endif
136#endif
include/linux/sunrpc/svcauth.h+0−4
@@ -10,8 +10,6 @@ · 9 unmodified lines
10#ifndef _LINUX_SUNRPC_SVCAUTH_H_10#ifndef _LINUX_SUNRPC_SVCAUTH_H_
11#define _LINUX_SUNRPC_SVCAUTH_H_11#define _LINUX_SUNRPC_SVCAUTH_H_
12 12
13#ifdef __KERNEL__
14
15#include <linux/string.h>13#include <linux/string.h>
16#include <linux/sunrpc/msg_prot.h>14#include <linux/sunrpc/msg_prot.h>
17#include <linux/sunrpc/cache.h>15#include <linux/sunrpc/cache.h>
@@ -185,6 +183,4 @@ static inline unsigned long hash_mem(char const *buf, int length, int bits) · 167 unmodified lines
185 return full_name_hash(NULL, buf, length) >> (32 - bits);183 return full_name_hash(NULL, buf, length) >> (32 - bits);
186}184}
187 185
188#endif /* __KERNEL__ */
189
190#endif /* _LINUX_SUNRPC_SVCAUTH_H_ */186#endif /* _LINUX_SUNRPC_SVCAUTH_H_ */
include/linux/sunrpc/svcauth_gss.h+0−2
@@ -9,7 +9,6 @@ · 8 unmodified lines
9#ifndef _LINUX_SUNRPC_SVCAUTH_GSS_H9#ifndef _LINUX_SUNRPC_SVCAUTH_GSS_H
10#define _LINUX_SUNRPC_SVCAUTH_GSS_H10#define _LINUX_SUNRPC_SVCAUTH_GSS_H
11 11
12#ifdef __KERNEL__
13#include <linux/sched.h>12#include <linux/sched.h>
14#include <linux/sunrpc/types.h>13#include <linux/sunrpc/types.h>
15#include <linux/sunrpc/xdr.h>14#include <linux/sunrpc/xdr.h>
@@ -24,5 +23,4 @@ void gss_svc_shutdown_net(struct net *net); · 8 unmodified lines
24int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name);23int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name);
25u32 svcauth_gss_flavor(struct auth_domain *dom);24u32 svcauth_gss_flavor(struct auth_domain *dom);
26 25
27#endif /* __KERNEL__ */
28#endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */26#endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */
include/linux/sunrpc/xdr.h+0−3
@@ -11,8 +11,6 @@ · 10 unmodified lines
11#ifndef _SUNRPC_XDR_H_11#ifndef _SUNRPC_XDR_H_
12#define _SUNRPC_XDR_H_12#define _SUNRPC_XDR_H_
13 13
14#ifdef __KERNEL__
15
16#include <linux/uio.h>14#include <linux/uio.h>
17#include <asm/byteorder.h>15#include <asm/byteorder.h>
18#include <asm/unaligned.h>16#include <asm/unaligned.h>
@@ -552,6 +550,5 @@ xdr_stream_decode_uint32_array(struct xdr_stream *xdr, · 533 unmodified lines
552 *array = be32_to_cpup(p);550 *array = be32_to_cpup(p);
553 return retval;551 return retval;
554}552}
555#endif /* __KERNEL__ */
556 553
557#endif /* _SUNRPC_XDR_H_ */554#endif /* _SUNRPC_XDR_H_ */
include/linux/sunrpc/xprt.h+0−4
@@ -19,8 +19,6 @@ · 18 unmodified lines
19#include <linux/sunrpc/xdr.h>19#include <linux/sunrpc/xdr.h>
20#include <linux/sunrpc/msg_prot.h>20#include <linux/sunrpc/msg_prot.h>
21 21
22#ifdef __KERNEL__
23
24#define RPC_MIN_SLOT_TABLE (2U)22#define RPC_MIN_SLOT_TABLE (2U)
25#define RPC_DEF_SLOT_TABLE (16U)23#define RPC_DEF_SLOT_TABLE (16U)
26#define RPC_MAX_SLOT_TABLE_LIMIT (65536U)24#define RPC_MAX_SLOT_TABLE_LIMIT (65536U)
@@ -505,6 +503,4 @@ static inline void xprt_inject_disconnect(struct rpc_xprt *xprt) · 478 unmodified lines
505}503}
506#endif504#endif
507 505
508#endif /* __KERNEL__*/
509
510#endif /* _LINUX_SUNRPC_XPRT_H */506#endif /* _LINUX_SUNRPC_XPRT_H */
include/linux/sunrpc/xprtsock.h+0−4
@@ -8,8 +8,6 @@ · 7 unmodified lines
8#ifndef _LINUX_SUNRPC_XPRTSOCK_H8#ifndef _LINUX_SUNRPC_XPRTSOCK_H
9#define _LINUX_SUNRPC_XPRTSOCK_H9#define _LINUX_SUNRPC_XPRTSOCK_H
10 10
11#ifdef __KERNEL__
12
13int init_socket_xprt(void);11int init_socket_xprt(void);
14void cleanup_socket_xprt(void);12void cleanup_socket_xprt(void);
15 13
@@ -90,6 +88,4 @@ struct sock_xprt { · 74 unmodified lines
90#define XPRT_SOCK_WAKE_PENDING (6)88#define XPRT_SOCK_WAKE_PENDING (6)
91#define XPRT_SOCK_WAKE_DISCONNECT (7)89#define XPRT_SOCK_WAKE_DISCONNECT (7)
92 90
93#endif /* __KERNEL__ */
94
95#endif /* _LINUX_SUNRPC_XPRTSOCK_H */91#endif /* _LINUX_SUNRPC_XPRTSOCK_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t