| 1 |
1633 |
jcastillo |
#ifndef _LINUX_NFS_FS_H
|
| 2 |
|
|
#define _LINUX_NFS_FS_H
|
| 3 |
|
|
|
| 4 |
|
|
/*
|
| 5 |
|
|
* linux/include/linux/nfs_fs.h
|
| 6 |
|
|
*
|
| 7 |
|
|
* Copyright (C) 1992 Rick Sladkey
|
| 8 |
|
|
*
|
| 9 |
|
|
* OS-specific nfs filesystem definitions and declarations
|
| 10 |
|
|
*/
|
| 11 |
|
|
|
| 12 |
|
|
#include <linux/nfs.h>
|
| 13 |
|
|
|
| 14 |
|
|
#include <linux/in.h>
|
| 15 |
|
|
#include <linux/nfs_mount.h>
|
| 16 |
|
|
|
| 17 |
|
|
/*
|
| 18 |
|
|
* The readdir cache size controls how many directory entries are cached.
|
| 19 |
|
|
* Its size is limited by the number of nfs_entry structures that can fit
|
| 20 |
|
|
* in one page, currently, the limit is 256 when using 4KB pages.
|
| 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 |
|
|
* The upper limit on timeouts for the exponential backoff algorithm.
|
| 30 |
|
|
*/
|
| 31 |
|
|
|
| 32 |
|
|
#define NFS_MAX_RPC_TIMEOUT (6*HZ)
|
| 33 |
|
|
|
| 34 |
|
|
/*
|
| 35 |
|
|
* Size of the lookup cache in units of number of entries cached.
|
| 36 |
|
|
* It is better not to make this too large although the optimum
|
| 37 |
|
|
* depends on a usage and environment.
|
| 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_ATTRTIMEO(inode) ((inode)->u.nfs_i.attrtimeo)
|
| 50 |
|
|
#define NFS_MINATTRTIMEO(inode) (S_ISREG((inode)->i_mode)? \
|
| 51 |
|
|
NFS_SERVER(inode)->acregmin : \
|
| 52 |
|
|
NFS_SERVER(inode)->acdirmin)
|
| 53 |
|
|
#define NFS_CACHEINV(inode) \
|
| 54 |
|
|
do { \
|
| 55 |
|
|
NFS_READTIME(inode) = jiffies - 1000000; \
|
| 56 |
|
|
NFS_OLDMTIME(inode) = 0; \
|
| 57 |
|
|
} while (0)
|
| 58 |
|
|
|
| 59 |
|
|
|
| 60 |
|
|
#ifdef __KERNEL__
|
| 61 |
|
|
|
| 62 |
|
|
/* linux/fs/nfs/proc.c */
|
| 63 |
|
|
|
| 64 |
|
|
extern int nfs_proc_getattr(struct nfs_server *server, struct nfs_fh *fhandle,
|
| 65 |
|
|
struct nfs_fattr *fattr);
|
| 66 |
|
|
extern int nfs_proc_setattr(struct nfs_server *server, struct nfs_fh *fhandle,
|
| 67 |
|
|
struct nfs_sattr *sattr, struct nfs_fattr *fattr);
|
| 68 |
|
|
extern int nfs_proc_lookup(struct nfs_server *server, struct nfs_fh *dir,
|
| 69 |
|
|
const char *name, struct nfs_fh *fhandle,
|
| 70 |
|
|
struct nfs_fattr *fattr);
|
| 71 |
|
|
extern int nfs_proc_readlink(struct nfs_server *server, struct nfs_fh *fhandle,
|
| 72 |
|
|
int **p0, char **string, unsigned int *len,
|
| 73 |
|
|
unsigned int maxlen);
|
| 74 |
|
|
extern int nfs_proc_read(struct nfs_server *server, struct nfs_fh *fhandle,
|
| 75 |
|
|
int offset, int count, char *data,
|
| 76 |
|
|
struct nfs_fattr *fattr);
|
| 77 |
|
|
extern int nfs_proc_write(struct inode * inode, int offset,
|
| 78 |
|
|
int count, const char *data, struct nfs_fattr *fattr);
|
| 79 |
|
|
extern int nfs_proc_create(struct nfs_server *server, struct nfs_fh *dir,
|
| 80 |
|
|
const char *name, struct nfs_sattr *sattr,
|
| 81 |
|
|
struct nfs_fh *fhandle, struct nfs_fattr *fattr);
|
| 82 |
|
|
extern int nfs_proc_remove(struct nfs_server *server, struct nfs_fh *dir,
|
| 83 |
|
|
const char *name);
|
| 84 |
|
|
extern int nfs_proc_rename(struct nfs_server *server,
|
| 85 |
|
|
struct nfs_fh *old_dir, const char *old_name,
|
| 86 |
|
|
struct nfs_fh *new_dir, const char *new_name,
|
| 87 |
|
|
int must_be_dir);
|
| 88 |
|
|
extern int nfs_proc_link(struct nfs_server *server, struct nfs_fh *fhandle,
|
| 89 |
|
|
struct nfs_fh *dir, const char *name);
|
| 90 |
|
|
extern int nfs_proc_symlink(struct nfs_server *server, struct nfs_fh *dir,
|
| 91 |
|
|
const char *name, const char *path, struct nfs_sattr *sattr);
|
| 92 |
|
|
extern int nfs_proc_mkdir(struct nfs_server *server, struct nfs_fh *dir,
|
| 93 |
|
|
const char *name, struct nfs_sattr *sattr,
|
| 94 |
|
|
struct nfs_fh *fhandle, struct nfs_fattr *fattr);
|
| 95 |
|
|
extern int nfs_proc_rmdir(struct nfs_server *server, struct nfs_fh *dir,
|
| 96 |
|
|
const char *name);
|
| 97 |
|
|
extern int nfs_proc_readdir(struct nfs_server *server, struct nfs_fh *fhandle,
|
| 98 |
|
|
int cookie, int count, struct nfs_entry *entry);
|
| 99 |
|
|
extern int nfs_proc_statfs(struct nfs_server *server, struct nfs_fh *fhandle,
|
| 100 |
|
|
struct nfs_fsinfo *res);
|
| 101 |
|
|
extern int nfs_proc_read_request(struct rpc_ioreq *, struct nfs_server *,
|
| 102 |
|
|
struct nfs_fh *, unsigned long offset,
|
| 103 |
|
|
unsigned long count, __u32 *buf);
|
| 104 |
|
|
extern int nfs_proc_read_reply(struct rpc_ioreq *, struct nfs_fattr *);
|
| 105 |
|
|
extern int *rpc_header(int *p, int procedure, int program, int version,
|
| 106 |
|
|
int uid, int gid, int *groups);
|
| 107 |
|
|
extern int *rpc_verify(int *p);
|
| 108 |
|
|
|
| 109 |
|
|
/* linux/fs/nfs/sock.c */
|
| 110 |
|
|
|
| 111 |
|
|
extern int nfs_rpc_call(struct nfs_server *server, int *start,
|
| 112 |
|
|
int *end, int size);
|
| 113 |
|
|
extern int nfs_rpc_doio(struct nfs_server *server, struct rpc_ioreq *,
|
| 114 |
|
|
int async);
|
| 115 |
|
|
|
| 116 |
|
|
/* linux/fs/nfs/inode.c */
|
| 117 |
|
|
|
| 118 |
|
|
extern struct super_block *nfs_read_super(struct super_block *sb,
|
| 119 |
|
|
void *data,int);
|
| 120 |
|
|
extern int init_nfs_fs(void);
|
| 121 |
|
|
extern struct inode *nfs_fhget(struct super_block *sb, struct nfs_fh *fhandle,
|
| 122 |
|
|
struct nfs_fattr *fattr);
|
| 123 |
|
|
extern void nfs_refresh_inode(struct inode *inode, struct nfs_fattr *fattr);
|
| 124 |
|
|
|
| 125 |
|
|
/* linux/fs/nfs/file.c */
|
| 126 |
|
|
|
| 127 |
|
|
extern struct inode_operations nfs_file_inode_operations;
|
| 128 |
|
|
|
| 129 |
|
|
/* linux/fs/nfs/dir.c */
|
| 130 |
|
|
|
| 131 |
|
|
extern struct inode_operations nfs_dir_inode_operations;
|
| 132 |
|
|
extern void nfs_sillyrename_cleanup(struct inode *);
|
| 133 |
|
|
extern void nfs_kfree_cache(void);
|
| 134 |
|
|
|
| 135 |
|
|
/* linux/fs/nfs/symlink.c */
|
| 136 |
|
|
|
| 137 |
|
|
extern struct inode_operations nfs_symlink_inode_operations;
|
| 138 |
|
|
|
| 139 |
|
|
/* linux/fs/nfs/mmap.c */
|
| 140 |
|
|
|
| 141 |
|
|
extern int nfs_mmap(struct inode * inode, struct file * file, struct vm_area_struct * vma);
|
| 142 |
|
|
|
| 143 |
|
|
/* linux/fs/nfs/bio.c */
|
| 144 |
|
|
|
| 145 |
|
|
extern int nfs_readpage(struct inode *, struct page *);
|
| 146 |
|
|
|
| 147 |
|
|
/* NFS root */
|
| 148 |
|
|
|
| 149 |
|
|
#define NFS_ROOT "/tftpboot/%s"
|
| 150 |
|
|
#define NFS_ROOT_NAME_LEN 256
|
| 151 |
|
|
#define NFS_ROOT_ADDRS_LEN 128
|
| 152 |
|
|
|
| 153 |
|
|
extern int nfs_root_mount(struct super_block *sb);
|
| 154 |
|
|
extern int nfs_root_init(char *nfsname, char *nfsaddrs);
|
| 155 |
|
|
extern char nfs_root_name[];
|
| 156 |
|
|
extern char nfs_root_addrs[];
|
| 157 |
|
|
|
| 158 |
|
|
#endif /* __KERNEL__ */
|
| 159 |
|
|
|
| 160 |
|
|
#endif
|