diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-12 17:37:47 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-01-12 20:03:43 -0500 |
commit | 32c419d95f3d1da891ab9bd032a214ee05b94ed4 (patch) | |
tree | 632076181909966044e4b1e14a7f5031b868195d /include/linux | |
parent | 0378c4051a621303ae919f1cee832206a4c1aa68 (diff) |
move internal-only parts of ncpfs headers to fs/ncpfs
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ncp_fs.h | 100 | ||||
-rw-r--r-- | include/linux/ncp_fs_i.h | 29 | ||||
-rw-r--r-- | include/linux/ncp_fs_sb.h | 164 | ||||
-rw-r--r-- | include/linux/ncp_mount.h | 22 |
4 files changed, 0 insertions, 315 deletions
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index 2d79c8a58598..e13eefef0653 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
@@ -143,104 +143,4 @@ struct ncp_nls_ioctl | |||
143 | #define NCP_MAXPATHLEN 255 | 143 | #define NCP_MAXPATHLEN 255 |
144 | #define NCP_MAXNAMELEN 14 | 144 | #define NCP_MAXNAMELEN 14 |
145 | 145 | ||
146 | #ifdef __KERNEL__ | ||
147 | |||
148 | #include <linux/ncp_fs_i.h> | ||
149 | #include <linux/ncp_fs_sb.h> | ||
150 | |||
151 | /* define because it is easy to change PRINTK to {*}PRINTK */ | ||
152 | #define PRINTK(format, args...) printk(KERN_DEBUG format , ## args) | ||
153 | |||
154 | #undef NCPFS_PARANOIA | ||
155 | #ifdef NCPFS_PARANOIA | ||
156 | #define PPRINTK(format, args...) PRINTK(format , ## args) | ||
157 | #else | ||
158 | #define PPRINTK(format, args...) | ||
159 | #endif | ||
160 | |||
161 | #ifndef DEBUG_NCP | ||
162 | #define DEBUG_NCP 0 | ||
163 | #endif | ||
164 | #if DEBUG_NCP > 0 | ||
165 | #define DPRINTK(format, args...) PRINTK(format , ## args) | ||
166 | #else | ||
167 | #define DPRINTK(format, args...) | ||
168 | #endif | ||
169 | #if DEBUG_NCP > 1 | ||
170 | #define DDPRINTK(format, args...) PRINTK(format , ## args) | ||
171 | #else | ||
172 | #define DDPRINTK(format, args...) | ||
173 | #endif | ||
174 | |||
175 | #define NCP_MAX_RPC_TIMEOUT (6*HZ) | ||
176 | |||
177 | |||
178 | struct ncp_entry_info { | ||
179 | struct nw_info_struct i; | ||
180 | ino_t ino; | ||
181 | int opened; | ||
182 | int access; | ||
183 | unsigned int volume; | ||
184 | __u8 file_handle[6]; | ||
185 | }; | ||
186 | |||
187 | static inline struct ncp_server *NCP_SBP(const struct super_block *sb) | ||
188 | { | ||
189 | return sb->s_fs_info; | ||
190 | } | ||
191 | |||
192 | #define NCP_SERVER(inode) NCP_SBP((inode)->i_sb) | ||
193 | static inline struct ncp_inode_info *NCP_FINFO(const struct inode *inode) | ||
194 | { | ||
195 | return container_of(inode, struct ncp_inode_info, vfs_inode); | ||
196 | } | ||
197 | |||
198 | /* linux/fs/ncpfs/inode.c */ | ||
199 | int ncp_notify_change(struct dentry *, struct iattr *); | ||
200 | struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *); | ||
201 | void ncp_update_inode(struct inode *, struct ncp_entry_info *); | ||
202 | void ncp_update_inode2(struct inode *, struct ncp_entry_info *); | ||
203 | |||
204 | /* linux/fs/ncpfs/dir.c */ | ||
205 | extern const struct inode_operations ncp_dir_inode_operations; | ||
206 | extern const struct file_operations ncp_dir_operations; | ||
207 | extern const struct dentry_operations ncp_dentry_operations; | ||
208 | int ncp_conn_logged_in(struct super_block *); | ||
209 | int ncp_date_dos2unix(__le16 time, __le16 date); | ||
210 | void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); | ||
211 | |||
212 | /* linux/fs/ncpfs/ioctl.c */ | ||
213 | long ncp_ioctl(struct file *, unsigned int, unsigned long); | ||
214 | long ncp_compat_ioctl(struct file *, unsigned int, unsigned long); | ||
215 | |||
216 | /* linux/fs/ncpfs/sock.c */ | ||
217 | int ncp_request2(struct ncp_server *server, int function, | ||
218 | void* reply, int max_reply_size); | ||
219 | static inline int ncp_request(struct ncp_server *server, int function) { | ||
220 | return ncp_request2(server, function, server->packet, server->packet_size); | ||
221 | } | ||
222 | int ncp_connect(struct ncp_server *server); | ||
223 | int ncp_disconnect(struct ncp_server *server); | ||
224 | void ncp_lock_server(struct ncp_server *server); | ||
225 | void ncp_unlock_server(struct ncp_server *server); | ||
226 | |||
227 | /* linux/fs/ncpfs/symlink.c */ | ||
228 | #if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS) | ||
229 | extern const struct address_space_operations ncp_symlink_aops; | ||
230 | int ncp_symlink(struct inode*, struct dentry*, const char*); | ||
231 | #endif | ||
232 | |||
233 | /* linux/fs/ncpfs/file.c */ | ||
234 | extern const struct inode_operations ncp_file_inode_operations; | ||
235 | extern const struct file_operations ncp_file_operations; | ||
236 | int ncp_make_open(struct inode *, int); | ||
237 | |||
238 | /* linux/fs/ncpfs/mmap.c */ | ||
239 | int ncp_mmap(struct file *, struct vm_area_struct *); | ||
240 | |||
241 | /* linux/fs/ncpfs/ncplib_kernel.c */ | ||
242 | int ncp_make_closed(struct inode *); | ||
243 | |||
244 | #endif /* __KERNEL__ */ | ||
245 | |||
246 | #endif /* _LINUX_NCP_FS_H */ | 146 | #endif /* _LINUX_NCP_FS_H */ |
diff --git a/include/linux/ncp_fs_i.h b/include/linux/ncp_fs_i.h deleted file mode 100644 index 4b0bec477846..000000000000 --- a/include/linux/ncp_fs_i.h +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | /* | ||
2 | * ncp_fs_i.h | ||
3 | * | ||
4 | * Copyright (C) 1995 Volker Lendecke | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef _LINUX_NCP_FS_I | ||
9 | #define _LINUX_NCP_FS_I | ||
10 | |||
11 | /* | ||
12 | * This is the ncpfs part of the inode structure. This must contain | ||
13 | * all the information we need to work with an inode after creation. | ||
14 | */ | ||
15 | struct ncp_inode_info { | ||
16 | __le32 dirEntNum; | ||
17 | __le32 DosDirNum; | ||
18 | __u8 volNumber; | ||
19 | __le32 nwattr; | ||
20 | struct mutex open_mutex; | ||
21 | atomic_t opened; | ||
22 | int access; | ||
23 | int flags; | ||
24 | #define NCPI_KLUDGE_SYMLINK 0x0001 | ||
25 | __u8 file_handle[6]; | ||
26 | struct inode vfs_inode; | ||
27 | }; | ||
28 | |||
29 | #endif /* _LINUX_NCP_FS_I */ | ||
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h deleted file mode 100644 index d64b0e894336..000000000000 --- a/include/linux/ncp_fs_sb.h +++ /dev/null | |||
@@ -1,164 +0,0 @@ | |||
1 | /* | ||
2 | * ncp_fs_sb.h | ||
3 | * | ||
4 | * Copyright (C) 1995, 1996 by Volker Lendecke | ||
5 | * | ||
6 | */ | ||
7 | |||
8 | #ifndef _NCP_FS_SB | ||
9 | #define _NCP_FS_SB | ||
10 | |||
11 | #include <linux/types.h> | ||
12 | #include <linux/ncp_mount.h> | ||
13 | #include <linux/net.h> | ||
14 | #include <linux/mutex.h> | ||
15 | #include <linux/backing-dev.h> | ||
16 | |||
17 | #ifdef __KERNEL__ | ||
18 | |||
19 | #include <linux/workqueue.h> | ||
20 | |||
21 | #define NCP_DEFAULT_OPTIONS 0 /* 2 for packet signatures */ | ||
22 | |||
23 | struct sock; | ||
24 | |||
25 | struct ncp_server { | ||
26 | |||
27 | struct ncp_mount_data_kernel m; /* Nearly all of the mount data is of | ||
28 | interest for us later, so we store | ||
29 | it completely. */ | ||
30 | |||
31 | __u8 name_space[NCP_NUMBER_OF_VOLUMES + 2]; | ||
32 | |||
33 | struct file *ncp_filp; /* File pointer to ncp socket */ | ||
34 | struct socket *ncp_sock;/* ncp socket */ | ||
35 | struct file *info_filp; | ||
36 | struct socket *info_sock; | ||
37 | |||
38 | u8 sequence; | ||
39 | u8 task; | ||
40 | u16 connection; /* Remote connection number */ | ||
41 | |||
42 | u8 completion; /* Status message from server */ | ||
43 | u8 conn_status; /* Bit 4 = 1 ==> Server going down, no | ||
44 | requests allowed anymore. | ||
45 | Bit 0 = 1 ==> Server is down. */ | ||
46 | |||
47 | int buffer_size; /* Negotiated bufsize */ | ||
48 | |||
49 | int reply_size; /* Size of last reply */ | ||
50 | |||
51 | int packet_size; | ||
52 | unsigned char *packet; /* Here we prepare requests and | ||
53 | receive replies */ | ||
54 | unsigned char *txbuf; /* Storage for current request */ | ||
55 | unsigned char *rxbuf; /* Storage for reply to current request */ | ||
56 | |||
57 | int lock; /* To prevent mismatch in protocols. */ | ||
58 | struct mutex mutex; | ||
59 | |||
60 | int current_size; /* for packet preparation */ | ||
61 | int has_subfunction; | ||
62 | int ncp_reply_size; | ||
63 | |||
64 | int root_setuped; | ||
65 | struct mutex root_setup_lock; | ||
66 | |||
67 | /* info for packet signing */ | ||
68 | int sign_wanted; /* 1=Server needs signed packets */ | ||
69 | int sign_active; /* 0=don't do signing, 1=do */ | ||
70 | char sign_root[8]; /* generated from password and encr. key */ | ||
71 | char sign_last[16]; | ||
72 | |||
73 | /* Authentication info: NDS or BINDERY, username */ | ||
74 | struct { | ||
75 | int auth_type; | ||
76 | size_t object_name_len; | ||
77 | void* object_name; | ||
78 | int object_type; | ||
79 | } auth; | ||
80 | /* Password info */ | ||
81 | struct { | ||
82 | size_t len; | ||
83 | void* data; | ||
84 | } priv; | ||
85 | struct rw_semaphore auth_rwsem; | ||
86 | |||
87 | /* nls info: codepage for volume and charset for I/O */ | ||
88 | struct nls_table *nls_vol; | ||
89 | struct nls_table *nls_io; | ||
90 | |||
91 | /* maximum age in jiffies */ | ||
92 | atomic_t dentry_ttl; | ||
93 | |||
94 | /* miscellaneous */ | ||
95 | unsigned int flags; | ||
96 | |||
97 | spinlock_t requests_lock; /* Lock accesses to tx.requests, tx.creq and rcv.creq when STREAM mode */ | ||
98 | |||
99 | void (*data_ready)(struct sock* sk, int len); | ||
100 | void (*error_report)(struct sock* sk); | ||
101 | void (*write_space)(struct sock* sk); /* STREAM mode only */ | ||
102 | struct { | ||
103 | struct work_struct tq; /* STREAM/DGRAM: data/error ready */ | ||
104 | struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */ | ||
105 | struct mutex creq_mutex; /* DGRAM only: lock accesses to rcv.creq */ | ||
106 | |||
107 | unsigned int state; /* STREAM only: receiver state */ | ||
108 | struct { | ||
109 | __u32 magic __packed; | ||
110 | __u32 len __packed; | ||
111 | __u16 type __packed; | ||
112 | __u16 p1 __packed; | ||
113 | __u16 p2 __packed; | ||
114 | __u16 p3 __packed; | ||
115 | __u16 type2 __packed; | ||
116 | } buf; /* STREAM only: temporary buffer */ | ||
117 | unsigned char* ptr; /* STREAM only: pointer to data */ | ||
118 | size_t len; /* STREAM only: length of data to receive */ | ||
119 | } rcv; | ||
120 | struct { | ||
121 | struct list_head requests; /* STREAM only: queued requests */ | ||
122 | struct work_struct tq; /* STREAM only: transmitter ready */ | ||
123 | struct ncp_request_reply* creq; /* STREAM only: currently transmitted entry */ | ||
124 | } tx; | ||
125 | struct timer_list timeout_tm; /* DGRAM only: timeout timer */ | ||
126 | struct work_struct timeout_tq; /* DGRAM only: associated queue, we run timers from process context */ | ||
127 | int timeout_last; /* DGRAM only: current timeout length */ | ||
128 | int timeout_retries; /* DGRAM only: retries left */ | ||
129 | struct { | ||
130 | size_t len; | ||
131 | __u8 data[128]; | ||
132 | } unexpected_packet; | ||
133 | struct backing_dev_info bdi; | ||
134 | }; | ||
135 | |||
136 | extern void ncp_tcp_rcv_proc(struct work_struct *work); | ||
137 | extern void ncp_tcp_tx_proc(struct work_struct *work); | ||
138 | extern void ncpdgram_rcv_proc(struct work_struct *work); | ||
139 | extern void ncpdgram_timeout_proc(struct work_struct *work); | ||
140 | extern void ncpdgram_timeout_call(unsigned long server); | ||
141 | extern void ncp_tcp_data_ready(struct sock* sk, int len); | ||
142 | extern void ncp_tcp_write_space(struct sock* sk); | ||
143 | extern void ncp_tcp_error_report(struct sock* sk); | ||
144 | |||
145 | #define NCP_FLAG_UTF8 1 | ||
146 | |||
147 | #define NCP_CLR_FLAG(server, flag) ((server)->flags &= ~(flag)) | ||
148 | #define NCP_SET_FLAG(server, flag) ((server)->flags |= (flag)) | ||
149 | #define NCP_IS_FLAG(server, flag) ((server)->flags & (flag)) | ||
150 | |||
151 | static inline int ncp_conn_valid(struct ncp_server *server) | ||
152 | { | ||
153 | return ((server->conn_status & 0x11) == 0); | ||
154 | } | ||
155 | |||
156 | static inline void ncp_invalidate_conn(struct ncp_server *server) | ||
157 | { | ||
158 | server->conn_status |= 0x01; | ||
159 | } | ||
160 | |||
161 | #endif /* __KERNEL__ */ | ||
162 | |||
163 | #endif | ||
164 | |||
diff --git a/include/linux/ncp_mount.h b/include/linux/ncp_mount.h index a2b549eb1eca..dfcbea2d889f 100644 --- a/include/linux/ncp_mount.h +++ b/include/linux/ncp_mount.h | |||
@@ -68,26 +68,4 @@ struct ncp_mount_data_v4 { | |||
68 | 68 | ||
69 | #define NCP_MOUNT_VERSION_V5 (5) /* Text only */ | 69 | #define NCP_MOUNT_VERSION_V5 (5) /* Text only */ |
70 | 70 | ||
71 | #ifdef __KERNEL__ | ||
72 | |||
73 | struct ncp_mount_data_kernel { | ||
74 | unsigned long flags; /* NCP_MOUNT_* flags */ | ||
75 | unsigned int int_flags; /* internal flags */ | ||
76 | #define NCP_IMOUNT_LOGGEDIN_POSSIBLE 0x0001 | ||
77 | __kernel_uid32_t mounted_uid; /* Who may umount() this filesystem? */ | ||
78 | struct pid *wdog_pid; /* Who cares for our watchdog packets? */ | ||
79 | unsigned int ncp_fd; /* The socket to the ncp port */ | ||
80 | unsigned int time_out; /* How long should I wait after | ||
81 | sending a NCP request? */ | ||
82 | unsigned int retry_count; /* And how often should I retry? */ | ||
83 | unsigned char mounted_vol[NCP_VOLNAME_LEN + 1]; | ||
84 | __kernel_uid32_t uid; | ||
85 | __kernel_gid32_t gid; | ||
86 | __kernel_mode_t file_mode; | ||
87 | __kernel_mode_t dir_mode; | ||
88 | int info_fd; | ||
89 | }; | ||
90 | |||
91 | #endif /* __KERNEL__ */ | ||
92 | |||
93 | #endif | 71 | #endif |