Skip to content

Commit 32c419d

Browse files
author
Al Viro
committed
move internal-only parts of ncpfs headers to fs/ncpfs
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 0378c40 commit 32c419d

16 files changed

Lines changed: 126 additions & 150 deletions

‎fs/ncpfs/dir.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
#include <asm/uaccess.h>
2222
#include <asm/byteorder.h>
2323

24-
#include <linux/ncp_fs.h>
25-
26-
#include "ncplib_kernel.h"
24+
#include "ncp_fs.h"
2725

2826
static void ncp_read_volume_list(struct file *, void *, filldir_t,
2927
struct ncp_cache_control *);

‎fs/ncpfs/file.c‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
#include <linux/vmalloc.h>
1919
#include <linux/sched.h>
2020

21-
#include <linux/ncp_fs.h>
22-
#include "ncplib_kernel.h"
21+
#include "ncp_fs.h"
2322

2423
static int ncp_fsync(struct file *file, int datasync)
2524
{

‎fs/ncpfs/inode.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,9 @@
3131
#include <linux/seq_file.h>
3232
#include <linux/namei.h>
3333

34-
#include <linux/ncp_fs.h>
35-
3634
#include <net/sock.h>
3735

38-
#include "ncplib_kernel.h"
36+
#include "ncp_fs.h"
3937
#include "getopt.h"
4038

4139
#define NCP_DEFAULT_FILE_MODE 0600

‎fs/ncpfs/ioctl.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,9 @@
2020
#include <linux/vmalloc.h>
2121
#include <linux/sched.h>
2222

23-
#include <linux/ncp_fs.h>
24-
2523
#include <asm/uaccess.h>
2624

27-
#include "ncplib_kernel.h"
25+
#include "ncp_fs.h"
2826

2927
/* maximum limit for ncp_objectname_ioctl */
3028
#define NCP_OBJECT_NAME_MAX_LEN 4096

‎fs/ncpfs/mmap.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
#include <linux/mman.h>
1717
#include <linux/string.h>
1818
#include <linux/fcntl.h>
19-
#include <linux/ncp_fs.h>
2019

21-
#include "ncplib_kernel.h"
2220
#include <asm/uaccess.h>
2321
#include <asm/system.h>
2422

23+
#include "ncp_fs.h"
24+
2525
/*
2626
* Fill in the supplied page for mmap
2727
* XXX: how are we excluding truncate/invalidate here? Maybe need to lock

‎fs/ncpfs/ncp_fs.h‎

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#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
10+
#define PPRINTK(format, args...) PRINTK(format , ## args)
11+
#else
12+
#define PPRINTK(format, args...)
13+
#endif
14+
15+
#ifndef DEBUG_NCP
16+
#define DEBUG_NCP 0
17+
#endif
18+
#if DEBUG_NCP > 0
19+
#define DPRINTK(format, args...) PRINTK(format , ## args)
20+
#else
21+
#define DPRINTK(format, args...)
22+
#endif
23+
#if DEBUG_NCP > 1
24+
#define DDPRINTK(format, args...) PRINTK(format , ## args)
25+
#else
26+
#define DDPRINTK(format, args...)
27+
#endif
28+
29+
#define NCP_MAX_RPC_TIMEOUT (6*HZ)
30+
31+
32+
struct ncp_entry_info {
33+
struct nw_info_struct i;
34+
ino_t ino;
35+
int opened;
36+
int access;
37+
unsigned int volume;
38+
__u8 file_handle[6];
39+
};
40+
41+
static inline struct ncp_server *NCP_SBP(const struct super_block *sb)
42+
{
43+
return sb->s_fs_info;
44+
}
45+
46+
#define NCP_SERVER(inode) NCP_SBP((inode)->i_sb)
47+
static inline struct ncp_inode_info *NCP_FINFO(const struct inode *inode)
48+
{
49+
return container_of(inode, struct ncp_inode_info, vfs_inode);
50+
}
51+
52+
/* linux/fs/ncpfs/inode.c */
53+
int ncp_notify_change(struct dentry *, struct iattr *);
54+
struct inode *ncp_iget(struct super_block *, struct ncp_entry_info *);
55+
void ncp_update_inode(struct inode *, struct ncp_entry_info *);
56+
void ncp_update_inode2(struct inode *, struct ncp_entry_info *);
57+
58+
/* linux/fs/ncpfs/dir.c */
59+
extern const struct inode_operations ncp_dir_inode_operations;
60+
extern const struct file_operations ncp_dir_operations;
61+
extern const struct dentry_operations ncp_dentry_operations;
62+
int ncp_conn_logged_in(struct super_block *);
63+
int ncp_date_dos2unix(__le16 time, __le16 date);
64+
void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
65+
66+
/* linux/fs/ncpfs/ioctl.c */
67+
long ncp_ioctl(struct file *, unsigned int, unsigned long);
68+
long ncp_compat_ioctl(struct file *, unsigned int, unsigned long);
69+
70+
/* linux/fs/ncpfs/sock.c */
71+
int ncp_request2(struct ncp_server *server, int function,
72+
void* reply, int max_reply_size);
73+
static inline int ncp_request(struct ncp_server *server, int function) {
74+
return ncp_request2(server, function, server->packet, server->packet_size);
75+
}
76+
int ncp_connect(struct ncp_server *server);
77+
int ncp_disconnect(struct ncp_server *server);
78+
void ncp_lock_server(struct ncp_server *server);
79+
void ncp_unlock_server(struct ncp_server *server);
80+
81+
/* linux/fs/ncpfs/symlink.c */
82+
#if defined(CONFIG_NCPFS_EXTRAS) || defined(CONFIG_NCPFS_NFS_NS)
83+
extern const struct address_space_operations ncp_symlink_aops;
84+
int ncp_symlink(struct inode*, struct dentry*, const char*);
85+
#endif
86+
87+
/* linux/fs/ncpfs/file.c */
88+
extern const struct inode_operations ncp_file_inode_operations;
89+
extern const struct file_operations ncp_file_operations;
90+
int ncp_make_open(struct inode *, int);
91+
92+
/* linux/fs/ncpfs/mmap.c */
93+
int ncp_mmap(struct file *, struct vm_area_struct *);
94+
95+
/* linux/fs/ncpfs/ncplib_kernel.c */
96+
int ncp_make_closed(struct inode *);
97+
98+
#include "ncplib_kernel.h"
Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,30 @@
1313
#include <linux/net.h>
1414
#include <linux/mutex.h>
1515
#include <linux/backing-dev.h>
16-
17-
#ifdef __KERNEL__
18-
1916
#include <linux/workqueue.h>
2017

2118
#define NCP_DEFAULT_OPTIONS 0 /* 2 for packet signatures */
2219

2320
struct sock;
2421

22+
struct ncp_mount_data_kernel {
23+
unsigned long flags; /* NCP_MOUNT_* flags */
24+
unsigned int int_flags; /* internal flags */
25+
#define NCP_IMOUNT_LOGGEDIN_POSSIBLE 0x0001
26+
__kernel_uid32_t mounted_uid; /* Who may umount() this filesystem? */
27+
struct pid *wdog_pid; /* Who cares for our watchdog packets? */
28+
unsigned int ncp_fd; /* The socket to the ncp port */
29+
unsigned int time_out; /* How long should I wait after
30+
sending a NCP request? */
31+
unsigned int retry_count; /* And how often should I retry? */
32+
unsigned char mounted_vol[NCP_VOLNAME_LEN + 1];
33+
__kernel_uid32_t uid;
34+
__kernel_gid32_t gid;
35+
__kernel_mode_t file_mode;
36+
__kernel_mode_t dir_mode;
37+
int info_fd;
38+
};
39+
2540
struct ncp_server {
2641

2742
struct ncp_mount_data_kernel m; /* Nearly all of the mount data is of
@@ -158,7 +173,4 @@ static inline void ncp_invalidate_conn(struct ncp_server *server)
158173
server->conn_status |= 0x01;
159174
}
160175

161-
#endif /* __KERNEL__ */
162-
163176
#endif
164-

‎fs/ncpfs/ncplib_kernel.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313

14-
#include "ncplib_kernel.h"
14+
#include "ncp_fs.h"
1515

1616
static inline void assert_server_locked(struct ncp_server *server)
1717
{

‎fs/ncpfs/ncplib_kernel.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
#include <linux/ctype.h>
3333
#endif /* CONFIG_NCPFS_NLS */
3434

35-
#include <linux/ncp_fs.h>
36-
3735
#define NCP_MIN_SYMLINK_SIZE 8
3836
#define NCP_MAX_SYMLINK_SIZE 512
3937

0 commit comments

Comments
 (0)