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 #ifdef __KERNEL__
58
59
60
61
62 #define NCP_READDIR_CACHE_SIZE 64
63
64
65 #define NCP_MAX_RPC_TIMEOUT (60)
66
67
68 #define NCP_SUPER_MAGIC 0x564c
69
70
71 #define NCP_SBP(sb) ((struct ncp_server *)((sb)->u.generic_sbp))
72 #define NCP_INOP(inode) ((struct ncp_inode_info *)((inode)->u.generic_ip))
73
74 #define NCP_SERVER(inode) NCP_SBP((inode)->i_sb)
75 #define NCP_FINFO(inode) (&(NCP_INOP(inode)->finfo))
76 #define NCP_ISTRUCT(inode) (&(NCP_FINFO(inode)->i))
77
78 #ifdef DEBUG_NCP_MALLOC
79
80 #include <linux/malloc.h>
81
82 extern int ncp_malloced;
83 extern int ncp_current_malloced;
84
85 static inline void *
86 ncp_kmalloc(unsigned int size, int priority)
87 {
88 ncp_malloced += 1;
89 ncp_current_malloced += 1;
90 return kmalloc(size, priority);
91 }
92
93 static inline void
94 ncp_kfree_s(void *obj, int size)
95 {
96 ncp_current_malloced -= 1;
97 kfree_s(obj, size);
98 }
99
100 #else
101
102 #define ncp_kmalloc(s,p) kmalloc(s,p)
103 #define ncp_kfree_s(o,s) kfree_s(o,s)
104
105 #endif
106
107 #if DEBUG_NCP > 0
108 #define DPRINTK(format, args...) printk(format , ## args)
109 #else
110 #define DPRINTK(format, args...)
111 #endif
112
113 #if DEBUG_NCP > 1
114 #define DDPRINTK(format, args...) printk(format , ## args)
115 #else
116 #define DDPRINTK(format, args...)
117 #endif
118
119
120
121 extern struct inode_operations ncp_file_inode_operations;
122 int ncp_make_open(struct inode *i, int right);
123
124
125 extern struct inode_operations ncp_dir_inode_operations;
126 void ncp_free_inode_info(struct ncp_inode_info *i);
127 void ncp_free_all_inodes(struct ncp_server *server);
128 void ncp_init_root(struct ncp_server *server);
129 int ncp_stat_root(struct ncp_server *server);
130 void ncp_init_dir_cache(void);
131 void ncp_invalid_dir_cache(unsigned long ino);
132 void ncp_invalidate_all_inodes(struct ncp_server *server);
133 void ncp_free_dir_cache(void);
134 int ncp_date_dos2unix(__u16 time, __u16 date);
135 void ncp_date_unix2dos(int unix_date, __u16 *time, __u16 *date);
136
137
138
139 int ncp_ioctl (struct inode * inode, struct file * filp,
140 unsigned int cmd, unsigned long arg);
141
142
143 struct super_block *ncp_read_super(struct super_block *sb,
144 void *raw_data, int silent);
145 extern int init_ncp_fs(void);
146 void ncp_invalidate_connection(struct ncp_server *server);
147 int ncp_conn_is_valid(struct ncp_server *server);
148
149
150 int ncp_request(struct ncp_server *server, int function);
151 int ncp_connect(struct ncp_server *server);
152 int ncp_disconnect(struct ncp_server *server);
153 int ncp_catch_watchdog(struct ncp_server *server);
154 int ncp_dont_catch_watchdog(struct ncp_server *server);
155 void ncp_lock_server(struct ncp_server *server);
156 void ncp_unlock_server(struct ncp_server *server);
157
158
159 int ncp_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
160
161 #endif
162
163 #endif