📄 nfsd.h
字号:
/* * linux/include/linux/nfsd/nfsd.h * * Hodge-podge collection of knfsd-related stuff. * I will sort this out later. * * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> */#define LINUX_NFSD_NFSD_H#include <linux/types.h>#include <linux/unistd.h>#include <linux/dirent.h>#include <linux/fs.h>#include <linux/posix_acl.h>#include <linux/mount.h>#include <linux/nfsd/debug.h>#include <linux/nfsd/nfsfh.h>#include <linux/nfsd/export.h>#include <linux/nfsd/auth.h>#include <linux/nfsd/stats.h>#include <linux/nfsd/interface.h>/* * nfsd version */#define NFSD_VERSION "0.5"#define NFSD_SUPPORTED_MINOR_VERSION 0/* * Special flags for nfsd_permission. These must be different from MAY_READ, * MAY_WRITE, and MAY_EXEC. */#define MAY_NOP 0#define MAY_SATTR 8#define MAY_TRUNC 16#define MAY_LOCK 32#define MAY_OWNER_OVERRIDE 64#define MAY_LOCAL_ACCESS 128 /* IRIX doing local access check on device special file*/#define MAY_CREATE (MAY_EXEC|MAY_WRITE)#define MAY_REMOVE (MAY_EXEC|MAY_WRITE|MAY_TRUNC)/* * Callback function for readdir */struct readdir_cd { __be32 err; /* 0, nfserr, or nfserr_eof */};typedef int (*nfsd_dirop_t)(struct inode *, struct dentry *, int, int);extern struct svc_program nfsd_program;extern struct svc_version nfsd_version2, nfsd_version3, nfsd_version4;extern struct svc_serv *nfsd_serv;/* * Function prototypes. */int nfsd_svc(unsigned short port, int nrservs);int nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp);/* nfsd/vfs.c */int fh_lock_parent(struct svc_fh *, struct dentry *);int nfsd_racache_init(int);void nfsd_racache_shutdown(void);int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, struct svc_export **expp);__be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, const char *, int, struct svc_fh *);__be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, struct iattr *, int, time_t);__be32 nfsd_create(struct svc_rqst *, struct svc_fh *, char *name, int len, struct iattr *attrs, int type, dev_t rdev, struct svc_fh *res);__be32 nfsd_open(struct svc_rqst *, struct svc_fh *, int, int, struct file **);void nfsd_close(struct file *);__be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *, loff_t, struct kvec *, int, unsigned long *);__be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *, loff_t, struct kvec *,int, unsigned long, int *);__be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *, char *, int *);__be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *, char *name, int len, char *path, int plen, struct svc_fh *res, struct iattr *);__be32 nfsd_link(struct svc_rqst *, struct svc_fh *, char *, int, struct svc_fh *);__be32 nfsd_rename(struct svc_rqst *, struct svc_fh *, char *, int, struct svc_fh *, char *, int);__be32 nfsd_remove(struct svc_rqst *, struct svc_fh *, char *, int);__be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type, char *name, int len);int nfsd_truncate(struct svc_rqst *, struct svc_fh *, unsigned long size);__be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *, loff_t *, struct readdir_cd *, filldir_t);__be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *, struct kstatfs *);int nfsd_notify_change(struct inode *, struct iattr *);__be32 nfsd_permission(struct svc_export *, struct dentry *, int);int nfsd_sync_dir(struct dentry *dp);enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL };int nfsd_vers(int vers, enum vers_op change);void nfsd_reset_versions(void);int nfsd_create_serv(void);extern int nfsd_max_blksize;/* * NFSv4 State */static inline void nfs4_state_init(void){};static inline int nfs4_state_start(void){return 0;}static inline void nfs4_state_shutdown(void){}static inline time_t nfs4_lease_time(void){return 0;}static inline void nfs4_reset_lease(time_t leasetime){}static inline int nfs4_reset_recoverydir(char *recdir) {return 0;}/* * lockd binding */void nfsd_lockd_init(void);void nfsd_lockd_shutdown(void);/* * These macros provide pre-xdr'ed values for faster operation. */#define nfs_ok __constant_htonl(NFS_OK)#define nfserr_perm __constant_htonl(NFSERR_PERM)#define nfserr_noent __constant_htonl(NFSERR_NOENT)#define nfserr_io __constant_htonl(NFSERR_IO)#define nfserr_nxio __constant_htonl(NFSERR_NXIO)#define nfserr_eagain __constant_htonl(NFSERR_EAGAIN)#define nfserr_acces __constant_htonl(NFSERR_ACCES)#define nfserr_exist __constant_htonl(NFSERR_EXIST)#define nfserr_xdev __constant_htonl(NFSERR_XDEV)#define nfserr_nodev __constant_htonl(NFSERR_NODEV)#define nfserr_notdir __constant_htonl(NFSERR_NOTDIR)#define nfserr_isdir __constant_htonl(NFSERR_ISDIR)#define nfserr_inval __constant_htonl(NFSERR_INVAL)#define nfserr_fbig __constant_htonl(NFSERR_FBIG)#define nfserr_nospc __constant_htonl(NFSERR_NOSPC)#define nfserr_rofs __constant_htonl(NFSERR_ROFS)#define nfserr_mlink __constant_htonl(NFSERR_MLINK)#define nfserr_opnotsupp __constant_htonl(NFSERR_OPNOTSUPP)#define nfserr_nametoolong __constant_htonl(NFSERR_NAMETOOLONG)#define nfserr_notempty __constant_htonl(NFSERR_NOTEMPTY)#define nfserr_dquot __constant_htonl(NFSERR_DQUOT)#define nfserr_stale __constant_htonl(NFSERR_STALE)#define nfserr_remote __constant_htonl(NFSERR_REMOTE)#define nfserr_wflush __constant_htonl(NFSERR_WFLUSH)#define nfserr_badhandle __constant_htonl(NFSERR_BADHANDLE)#define nfserr_notsync __constant_htonl(NFSERR_NOT_SYNC)#define nfserr_badcookie __constant_htonl(NFSERR_BAD_COOKIE)#define nfserr_notsupp __constant_htonl(NFSERR_NOTSUPP)#define nfserr_toosmall __constant_htonl(NFSERR_TOOSMALL)#define nfserr_serverfault __constant_htonl(NFSERR_SERVERFAULT)#define nfserr_badtype __constant_htonl(NFSERR_BADTYPE)#define nfserr_jukebox __constant_htonl(NFSERR_JUKEBOX)#define nfserr_denied __constant_htonl(NFSERR_DENIED)#define nfserr_deadlock __constant_htonl(NFSERR_DEADLOCK)#define nfserr_expired __constant_htonl(NFSERR_EXPIRED)#define nfserr_bad_cookie __constant_htonl(NFSERR_BAD_COOKIE)#define nfserr_same __constant_htonl(NFSERR_SAME)#define nfserr_clid_inuse __constant_htonl(NFSERR_CLID_INUSE)#define nfserr_stale_clientid __constant_htonl(NFSERR_STALE_CLIENTID)#define nfserr_resource __constant_htonl(NFSERR_RESOURCE)#define nfserr_moved __constant_htonl(NFSERR_MOVED)#define nfserr_nofilehandle __constant_htonl(NFSERR_NOFILEHANDLE)#define nfserr_minor_vers_mismatch __constant_htonl(NFSERR_MINOR_VERS_MISMATCH)#define nfserr_share_denied __constant_htonl(NFSERR_SHARE_DENIED)#define nfserr_stale_stateid __constant_htonl(NFSERR_STALE_STATEID)#define nfserr_old_stateid __constant_htonl(NFSERR_OLD_STATEID)#define nfserr_bad_stateid __constant_htonl(NFSERR_BAD_STATEID)#define nfserr_bad_seqid __constant_htonl(NFSERR_BAD_SEQID)#define nfserr_symlink __constant_htonl(NFSERR_SYMLINK)#define nfserr_not_same __constant_htonl(NFSERR_NOT_SAME)#define nfserr_restorefh __constant_htonl(NFSERR_RESTOREFH)#define nfserr_attrnotsupp __constant_htonl(NFSERR_ATTRNOTSUPP)#define nfserr_bad_xdr __constant_htonl(NFSERR_BAD_XDR)#define nfserr_openmode __constant_htonl(NFSERR_OPENMODE)#define nfserr_locks_held __constant_htonl(NFSERR_LOCKS_HELD)#define nfserr_op_illegal __constant_htonl(NFSERR_OP_ILLEGAL)#define nfserr_grace __constant_htonl(NFSERR_GRACE)#define nfserr_no_grace __constant_htonl(NFSERR_NO_GRACE)#define nfserr_reclaim_bad __constant_htonl(NFSERR_RECLAIM_BAD)#define nfserr_badname __constant_htonl(NFSERR_BADNAME)#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN)#define nfserr_locked __constant_htonl(NFSERR_LOCKED)#define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME)/* error codes for internal use *//* if a request fails due to kmalloc failure, it gets dropped. * Client should resend eventually */#define nfserr_dropit __constant_htonl(30000)/* end-of-file indicator in readdir */#define nfserr_eof __constant_htonl(30001)/* Check for dir entries '.' and '..' */#define isdotent(n, l) (l < 3 && n[0] == '.' && (l == 1 || n[1] == '.'))/* * Time of server startup */extern struct timeval nfssvc_boot;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -