This source file includes following definitions.
- ncp_kmalloc
- ncp_kfree_s
1
2
3
4
5
6
7
8 #ifndef _LINUX_NCP_FS_H
9 #define _LINUX_NCP_FS_H
10
11 #include <linux/fs.h>
12 #include <linux/in.h>
13 #include <linux/types.h>
14
15 #include <linux/ncp_mount.h>
16 #include <linux/ncp_fs_sb.h>
17 #include <linux/ncp_fs_i.h>
18
19
20
21
22
23 struct ncp_ioctl_request {
24 unsigned int function;
25 unsigned int size;
26 char *data;
27 };
28
29 struct ncp_fs_info {
30 int version;
31 struct sockaddr_ipx addr;
32 uid_t mounted_uid;
33 int connection;
34 int buffer_size;
35
36
37
38
39 int volume_number;
40 __u32 directory_id;
41 };
42
43 #define NCP_IOC_NCPREQUEST _IOR('n', 1, unsigned char *)
44 #define NCP_IOC_GETMOUNTUID _IOR('u', 1, uid_t)
45
46 #define NCP_GET_FS_INFO_VERSION (1)
47 #define NCP_IOC_GET_FS_INFO _IOWR('i', 1, unsigned char *)
48
49
50
51
52 #define NCP_PACKET_SIZE 4070
53
54 #define NCP_MAXPATHLEN 255
55 #define NCP_MAXNAMELEN 14
56
57 #define NCP_MSG_COMMAND "/sbin/nwmsg"
58
59 #ifdef __KERNEL__
60
61
62
63
64 #define NCP_READDIR_CACHE_SIZE 64
65
66
67 #define NCP_MAX_RPC_TIMEOUT (60)
68
69
70 #define NCP_SUPER_MAGIC 0x564c
71
72
73 #define NCP_SBP(sb) ((struct ncp_server *)((sb)->u.generic_sbp))
74 #define NCP_INOP(inode) ((struct ncp_inode_info *)((inode)->u.generic_ip))
75
76 #define NCP_SERVER(inode) NCP_SBP((inode)->i_sb)
77 #define NCP_FINFO(inode) (&(NCP_INOP(inode)->finfo))
78 #define NCP_ISTRUCT(inode) (&(NCP_FINFO(inode)->i))
79
80 #ifdef DEBUG_NCP_MALLOC
81
82 #include <linux/malloc.h>
83
84 extern int ncp_malloced;
85 extern int ncp_current_malloced;
86
87 static inline void *
88 ncp_kmalloc(unsigned int size, int priority)
89 {
90 ncp_malloced += 1;
91 ncp_current_malloced += 1;
92 return kmalloc(size, priority);
93 }
94
95 static inline void
96 ncp_kfree_s(void *obj, int size)
97 {
98 ncp_current_malloced -= 1;
99 kfree_s(obj, size);
100 }
101
102 #else
103
104 #define ncp_kmalloc(s,p) kmalloc(s,p)
105 #define ncp_kfree_s(o,s) kfree_s(o,s)
106
107 #endif
108
109 #if DEBUG_NCP > 0
110 #define DPRINTK(format, args...) printk(format , ## args)
111 #else
112 #define DPRINTK(format, args...)
113 #endif
114
115 #if DEBUG_NCP > 1
116 #define DDPRINTK(format, args...) printk(format , ## args)
117 #else
118 #define DDPRINTK(format, args...)
119 #endif
120
121
122
123 extern struct inode_operations ncp_file_inode_operations;
124 int ncp_make_open(struct inode *i, int right);
125
126
127 extern struct inode_operations ncp_dir_inode_operations;
128 void ncp_free_inode_info(struct ncp_inode_info *i);
129 void ncp_free_all_inodes(struct ncp_server *server);
130 void ncp_init_root(struct ncp_server *server);
131 int ncp_stat_root(struct ncp_server *server);
132 void ncp_init_dir_cache(void);
133 void ncp_invalid_dir_cache(unsigned long ino);
134 void ncp_invalidate_all_inodes(struct ncp_server *server);
135 void ncp_free_dir_cache(void);
136 int ncp_date_dos2unix(__u16 time, __u16 date);
137 void ncp_date_unix2dos(int unix_date, __u16 *time, __u16 *date);
138
139
140
141 int ncp_ioctl (struct inode * inode, struct file * filp,
142 unsigned int cmd, unsigned long arg);
143
144
145 struct super_block *ncp_read_super(struct super_block *sb,
146 void *raw_data, int silent);
147 extern int init_ncp_fs(void);
148 void ncp_invalidate_connection(struct ncp_server *server);
149 int ncp_conn_is_valid(struct ncp_server *server);
150 void ncp_trigger_message(struct ncp_server *server);
151
152
153 int ncp_request(struct ncp_server *server, int function);
154 int ncp_connect(struct ncp_server *server);
155 int ncp_disconnect(struct ncp_server *server);
156 int ncp_catch_watchdog(struct ncp_server *server);
157 int ncp_dont_catch_watchdog(struct ncp_server *server);
158 int ncp_catch_message(struct ncp_server *server);
159 void ncp_lock_server(struct ncp_server *server);
160 void ncp_unlock_server(struct ncp_server *server);
161
162
163 int ncp_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
164
165 #endif
166
167 #endif