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_READTIME(inode) ((inode)->u.nfs_i.read_cache_jiffies)
47 #define NFS_OLDMTIME(inode) ((inode)->u.nfs_i.read_cache_mtime)
48 #define NFS_CACHEINV(inode) \
49 do { \
50 NFS_READTIME(inode) = jiffies - 1000000; \
51 NFS_OLDMTIME(inode) = 0; \
52 } while (0)
53
54
55 #ifdef __KERNEL__
56
57
58
59 extern int nfs_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
60 struct nfs_fattr *fattr);
61 extern int nfs_proc_setattr(struct nfs_server *server, struct nfs_fh *fhandle,
62 struct nfs_sattr *sattr, struct nfs_fattr *fattr);
63 extern int nfs_proc_lookup(struct nfs_server *server, struct nfs_fh *dir,
64 const char *name, struct nfs_fh *fhandle,
65 struct nfs_fattr *fattr);
66 extern int nfs_proc_readlink(struct nfs_server *server, struct nfs_fh *fhandle,
67 int **p0, char **string, unsigned int *len,
68 unsigned int maxlen);
69 extern int nfs_proc_read(struct nfs_server *server, struct nfs_fh *fhandle,
70 int offset, int count, char *data,
71 struct nfs_fattr *fattr);
72 extern int nfs_proc_write(struct inode * inode, int offset,
73 int count, const char *data, struct nfs_fattr *fattr);
74 extern int nfs_proc_create(struct nfs_server *server, struct nfs_fh *dir,
75 const char *name, struct nfs_sattr *sattr,
76 struct nfs_fh *fhandle, struct nfs_fattr *fattr);
77 extern int nfs_proc_remove(struct nfs_server *server, struct nfs_fh *dir,
78 const char *name);
79 extern int nfs_proc_rename(struct nfs_server *server,
80 struct nfs_fh *old_dir, const char *old_name,
81 struct nfs_fh *new_dir, const char *new_name);
82 extern int nfs_proc_link(struct nfs_server *server, struct nfs_fh *fhandle,
83 struct nfs_fh *dir, const char *name);
84 extern int nfs_proc_symlink(struct nfs_server *server, struct nfs_fh *dir,
85 const char *name, const char *path, struct nfs_sattr *sattr);
86 extern int nfs_proc_mkdir(struct nfs_server *server, struct nfs_fh *dir,
87 const char *name, struct nfs_sattr *sattr,
88 struct nfs_fh *fhandle, struct nfs_fattr *fattr);
89 extern int nfs_proc_rmdir(struct nfs_server *server, struct nfs_fh *dir,
90 const char *name);
91 extern int nfs_proc_readdir(struct nfs_server *server, struct nfs_fh *fhandle,
92 int cookie, int count, struct nfs_entry *entry);
93 extern int nfs_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
94 struct nfs_fsinfo *res);
95 extern int *rpc_header(int *p, int procedure, int program, int version,
96 int uid, int gid, int *groups);
97 extern int *rpc_verify(int *p);
98
99
100
101 extern int nfs_rpc_call(struct nfs_server *server, int *start, int *end, int size);
102
103
104
105 extern struct super_block *nfs_read_super(struct super_block *sb,
106 void *data,int);
107 extern int init_nfs_fs(void);
108 extern struct inode *nfs_fhget(struct super_block *sb, struct nfs_fh *fhandle,
109 struct nfs_fattr *fattr);
110 extern void nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr);
111
112
113
114 extern struct inode_operations nfs_file_inode_operations;
115
116
117
118 extern struct inode_operations nfs_dir_inode_operations;
119 extern void nfs_kfree_cache(void);
120
121
122
123 extern struct inode_operations nfs_symlink_inode_operations;
124
125
126
127 extern int nfs_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
128
129 #endif
130
131 #endif