blob: d52e7e6b5eedfed640904089eb6668dd4887f923 [file] [log] [blame]
Al Viro32c419d2011-01-12 17:37:47 -05001#include <linux/ncp_fs.h>
2#include "ncp_fs_i.h"
3#include "ncp_fs_sb.h"
4
5/* define because it is easy to change PRINTK to {*}PRINTK */
6#define PRINTK(format, args...) printk(KERN_DEBUG format , ## args)
7
8#undef NCPFS_PARANOIA
9#ifdef NCPFS_PARANOIA
Joe Perchese45ca8b2014-04-08 16:04:16 -070010#define ncp_vdbg(fmt, ...) \
11 pr_debug(fmt, ##__VA_ARGS__)
Al Viro32c419d2011-01-12 17:37:47 -050012#else
Joe Perchese45ca8b2014-04-08 16:04:16 -070013#define ncp_vdbg(fmt, ...) \
14do { \
15 if (0) \
16 pr_debug(fmt, ##__VA_ARGS__); \
17} while (0)
Al Viro32c419d2011-01-12 17:37:47 -050018#endif
19
20#ifndef DEBUG_NCP
21#define DEBUG_NCP 0
22#endif
Joe Perchesd3b73ca2014-04-08 16:04:15 -070023
24#if DEBUG_NCP > 0 && !defined(DEBUG)
25#define DEBUG
Al Viro32c419d2011-01-12 17:37:47 -050026#endif
Joe Perchesd3b73ca2014-04-08 16:04:15 -070027
28#define ncp_dbg(level, fmt, ...) \
29do { \
30 if (level <= DEBUG_NCP) \
31 pr_debug(fmt, ##__VA_ARGS__); \
32} while (0)
Al Viro32c419d2011-01-12 17:37:47 -050033
34#define NCP_MAX_RPC_TIMEOUT (6*HZ)
35
36
37struct ncp_entry_info {
38 struct nw_info_struct i;
39 ino_t ino;
40 int opened;
41 int access;
42 unsigned int volume;
43 __u8 file_handle[6];
44};
45
46static inline struct ncp_server *NCP_SBP(const struct super_block *sb)
47{
48 return sb->s_fs_info;
49}
50
51#define NCP_SERVER(inode) NCP_SBP((inode)->i_sb)
52static inline struct ncp_inode_info *NCP_FINFO(const struct inode *inode)
53{
54 return container_of(inode, struct ncp_inode_info, vfs_inode);
55}
56
57/* linux/fs/ncpfs/inode.c */
58int ncp_notify_change(struct dentry *, struct iattr *);
59struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *);
60void ncp_update_inode(struct inode *, struct ncp_entry_info *);
61void ncp_update_inode2(struct inode *, struct ncp_entry_info *);
62
63/* linux/fs/ncpfs/dir.c */
64extern const struct inode_operations ncp_dir_inode_operations;
65extern const struct file_operations ncp_dir_operations;
66extern const struct dentry_operations ncp_dentry_operations;
67int ncp_conn_logged_in(struct super_block *);
68int ncp_date_dos2unix(__le16 time, __le16 date);
69void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
70
71/* linux/fs/ncpfs/ioctl.c */
72long ncp_ioctl(struct file *, unsigned int, unsigned long);
73long ncp_compat_ioctl(struct file *, unsigned int, unsigned long);
74
75/* linux/fs/ncpfs/sock.c */
76int ncp_request2(struct ncp_server *server, int function,
77 void* reply, int max_reply_size);
78static inline int ncp_request(struct ncp_server *server, int function) {
79 return ncp_request2(server, function, server->packet, server->packet_size);
80}
81int ncp_connect(struct ncp_server *server);
82int ncp_disconnect(struct ncp_server *server);
83void ncp_lock_server(struct ncp_server *server);
84void ncp_unlock_server(struct ncp_server *server);
85
86/* linux/fs/ncpfs/symlink.c */
87#if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
88extern const struct address_space_operations ncp_symlink_aops;
89int ncp_symlink(struct inode*, struct dentry*, const char*);
90#endif
91
92/* linux/fs/ncpfs/file.c */
93extern const struct inode_operations ncp_file_inode_operations;
94extern const struct file_operations ncp_file_operations;
95int ncp_make_open(struct inode *, int);
96
97/* linux/fs/ncpfs/mmap.c */
98int ncp_mmap(struct file *, struct vm_area_struct *);
99
100/* linux/fs/ncpfs/ncplib_kernel.c */
101int ncp_make_closed(struct inode *);
102
103#include "ncplib_kernel.h"