1 #ifndef _LINUX_NFS_FS_H
2 #define _LINUX_NFS_FS_H
3
4
5
6
7
8
9
10
11
12 #include <linux/nfs.h>
13
14 #include <linux/in.h>
15 #include <linux/nfs_mount.h>
16
17
18
19
20
21
22
23 #define NFS_READDIR_CACHE_SIZE 64
24
25 #define NFS_MAX_FILE_IO_BUFFER_SIZE 16384
26 #define NFS_DEF_FILE_IO_BUFFER_SIZE 1024
27
28
29
30
31
32 #define NFS_MAX_RPC_TIMEOUT (6*HZ)
33
34
35
36
37
38
39
40 #define NFS_LOOKUP_CACHE_SIZE 64
41
42 #define NFS_SUPER_MAGIC 0x6969
43
44 #define NFS_SERVER(inode) (&(inode)->i_sb->u.nfs_sb.s_server)
45 #define NFS_FH(inode) (&(inode)->u.nfs_i.fhandle)
46 #define NFS_RENAMED_DIR(inode) ((inode)->u.nfs_i.silly_rename_dir)
47 #define NFS_READTIME(inode) ((inode)->u.nfs_i.read_cache_jiffies)
48 #define NFS_OLDMTIME(inode) ((inode)->u.nfs_i.read_cache_mtime)
49 #define NFS_CACHEINV(inode) \
50 do { \
51 NFS_READTIME(inode) = jiffies - 1000000; \
52 NFS_OLDMTIME(inode) = 0; \
53 } while (0)
54
55
56 #ifdef __KERNEL__
57
58
59
60 extern int nfs_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
61 struct nfs_fattr *fattr);
62 extern int nfs_proc_setattr(struct nfs_server *server, struct nfs_fh *fhandle,
63 struct nfs_sattr *sattr, struct nfs_fattr *fattr);
64 extern int nfs_proc_lookup(struct nfs_server *server, struct nfs_fh *dir,
65 const char *name, struct nfs_fh *fhandle,
66 struct nfs_fattr *fattr);
67 extern int nfs_proc_readlink(struct nfs_server *server, struct nfs_fh *fhandle,
68 int **p0, char **string, unsigned int *len,
69 unsigned int maxlen);
70 extern int nfs_proc_read(struct nfs_server *server, struct nfs_fh *fhandle,
71 int offset, int count, char *data,
72 struct nfs_fattr *fattr);
73 extern int nfs_proc_write(struct inode * inode, int offset,
74 int count, const char *data, struct nfs_fattr *fattr);
75 extern int nfs_proc_create(struct nfs_server *server, struct nfs_fh *dir,
76 const char *name, struct nfs_sattr *sattr,
77 struct nfs_fh *fhandle, struct nfs_fattr *fattr);
78 extern int nfs_proc_remove(struct nfs_server *server, struct nfs_fh *dir,
79 const char *name);
80 extern int nfs_proc_rename(struct nfs_server *server,
81 struct nfs_fh *old_dir, const char *old_name,
82 struct nfs_fh *new_dir, const char *new_name);
83 extern int nfs_proc_link(struct nfs_server *server, struct nfs_fh *fhandle,
84 struct nfs_fh *dir, const char *name);
85 extern int nfs_proc_symlink(struct nfs_server *server, struct nfs_fh *dir,
86 const char *name, const char *path, struct nfs_sattr *sattr);
87 extern int nfs_proc_mkdir(struct nfs_server *server, struct nfs_fh *dir,
88 const char *name, struct nfs_sattr *sattr,
89 struct nfs_fh *fhandle, struct nfs_fattr *fattr);
90 extern int nfs_proc_rmdir(struct nfs_server *server, struct nfs_fh *dir,
91 const char *name);
92 extern int nfs_proc_readdir(struct nfs_server *server, struct nfs_fh *fhandle,
93 int cookie, int count, struct nfs_entry *entry);
94 extern int nfs_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
95 struct nfs_fsinfo *res);
96 extern int nfs_proc_read_request(struct rpc_ioreq *, struct nfs_server *,
97 struct nfs_fh *, unsigned long offset,
98 unsigned long count, __u32 *buf);
99 extern int nfs_proc_read_reply(struct rpc_ioreq *);
100 extern int *rpc_header(int *p, int procedure, int program, int version,
101 int uid, int gid, int *groups);
102 extern int *rpc_verify(int *p);
103
104
105
106 extern int nfs_rpc_call(struct nfs_server *server, int *start,
107 int *end, int size);
108 extern int nfs_rpc_doio(struct nfs_server *server, struct rpc_ioreq *,
109 int async);
110
111
112
113 extern struct super_block *nfs_read_super(struct super_block *sb,
114 void *data,int);
115 extern int init_nfs_fs(void);
116 extern struct inode *nfs_fhget(struct super_block *sb, struct nfs_fh *fhandle,
117 struct nfs_fattr *fattr);
118 extern void nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr);
119
120
121
122 extern struct inode_operations nfs_file_inode_operations;
123
124
125
126 extern struct inode_operations nfs_dir_inode_operations;
127 extern void nfs_sillyrename_cleanup(struct inode *);
128 extern void nfs_kfree_cache(void);
129
130
131
132 extern struct inode_operations nfs_symlink_inode_operations;
133
134
135
136 extern int nfs_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
137
138
139
140 extern int nfs_readpage(struct inode *, struct page *);
141
142
143
144 #define NFS_ROOT "/tftpboot/%s"
145 #define NFS_ROOT_NAME_LEN 256
146 #define NFS_ROOT_ADDRS_LEN 128
147
148 extern int nfs_root_mount(struct super_block *sb);
149 extern int nfs_root_init(char *nfsname, char *nfsaddrs);
150 extern char nfs_root_name[];
151 extern char nfs_root_addrs[];
152
153 #endif
154
155 #endif