diff options
Diffstat (limited to 'sys/nfs/nfsnode.h')
-rw-r--r-- | sys/nfs/nfsnode.h | 120 |
1 files changed, 87 insertions, 33 deletions
diff --git a/sys/nfs/nfsnode.h b/sys/nfs/nfsnode.h index f5fee5b..06107d5 100644 --- a/sys/nfs/nfsnode.h +++ b/sys/nfs/nfsnode.h @@ -33,9 +33,17 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)nfsnode.h 8.4 (Berkeley) 2/13/94 + * @(#)nfsnode.h 8.9 (Berkeley) 5/14/95 */ + +#ifndef _NFS_NFSNODE_H_ +#define _NFS_NFSNODE_H_ + +#ifndef _NFS_NFS_H_ +#include <nfs/nfs.h> +#endif + /* * Silly rename structure that hangs off the nfsnode until the name * can be removed by nfs_inactive() @@ -48,38 +56,73 @@ struct sillyrename { }; /* + * This structure is used to save the logical directory offset to + * NFS cookie mappings. + * The mappings are stored in a list headed + * by n_cookies, as required. + * There is one mapping for each NFS_DIRBLKSIZ bytes of directory information + * stored in increasing logical offset byte order. + */ +#define NFSNUMCOOKIES 31 + +struct nfsdmap { + LIST_ENTRY(nfsdmap) ndm_list; + int ndm_eocookie; + nfsuint64 ndm_cookies[NFSNUMCOOKIES]; +}; + +/* * The nfsnode is the nfs equivalent to ufs's inode. Any similarity * is purely coincidental. * There is a unique nfsnode allocated for each active file, * each current directory, each mounted-on file, text file, and the root. * An nfsnode is 'named' by its file handle. (nget/nfs_node.c) + * If this structure exceeds 256 bytes (it is currently 256 using 4.4BSD-Lite + * type definitions), file handles of > 32 bytes should probably be split out + * into a separate MALLOC()'d data structure. (Reduce the size of nfsfh_t by + * changing the definition in sys/mount.h of NFS_SMALLFH.) + * NB: Hopefully the current order of the fields is such that everything will + * be well aligned and, therefore, tightly packed. */ - struct nfsnode { - struct nfsnode *n_forw; /* hash, forward */ - struct nfsnode **n_back; /* hash, backward */ - nfsv2fh_t n_fh; /* NFS File Handle */ - long n_flag; /* Flag for locking.. */ - struct vnode *n_vnode; /* vnode associated with this node */ - struct vattr n_vattr; /* Vnode attribute cache */ - time_t n_attrstamp; /* Time stamp for cached attributes */ - struct sillyrename *n_sillyrename; /* Ptr to silly rename struct */ - u_quad_t n_size; /* Current size of file */ - int n_error; /* Save write error value */ - u_long n_direofoffset; /* Dir. EOF offset cache */ - time_t n_mtime; /* Prev modify time. */ - time_t n_ctime; /* Prev create time. */ - u_quad_t n_brev; /* Modify rev when cached */ - u_quad_t n_lrev; /* Modify rev for lease */ - time_t n_expiry; /* Lease expiry time */ - struct nfsnode *n_tnext; /* Nqnfs timer chain */ - struct nfsnode *n_tprev; - long spare1; /* To 8 byte boundary */ - struct sillyrename n_silly; /* Silly rename struct */ - struct timeval n_atim; /* Special file times */ - struct timeval n_mtim; + LIST_ENTRY(nfsnode) n_hash; /* Hash chain */ + CIRCLEQ_ENTRY(nfsnode) n_timer; /* Nqnfs timer chain */ + u_quad_t n_size; /* Current size of file */ + u_quad_t n_brev; /* Modify rev when cached */ + u_quad_t n_lrev; /* Modify rev for lease */ + struct vattr n_vattr; /* Vnode attribute cache */ + time_t n_attrstamp; /* Attr. cache timestamp */ + time_t n_mtime; /* Prev modify time. */ + time_t n_ctime; /* Prev create time. */ + time_t n_expiry; /* Lease expiry time */ + nfsfh_t *n_fhp; /* NFS File Handle */ + struct vnode *n_vnode; /* associated vnode */ + struct lockf *n_lockf; /* Locking record of file */ + int n_error; /* Save write error value */ + union { + struct timespec nf_atim; /* Special file times */ + nfsuint64 nd_cookieverf; /* Cookie verifier (dir only) */ + } n_un1; + union { + struct timespec nf_mtim; + off_t nd_direof; /* Dir. EOF offset cache */ + } n_un2; + union { + struct sillyrename *nf_silly; /* Ptr to silly rename struct */ + LIST_HEAD(, nfsdmap) nd_cook; /* cookies */ + } n_un3; + short n_fhsize; /* size in bytes, of fh */ + short n_flag; /* Flag for locking.. */ + nfsfh_t n_fh; /* Small File Handle */ }; +#define n_atim n_un1.nf_atim +#define n_mtim n_un2.nf_mtim +#define n_sillyrename n_un3.nf_silly +#define n_cookieverf n_un1.nd_cookieverf +#define n_direofoffset n_un2.nd_direof +#define n_cookies n_un3.nd_cook + /* * Flags for n_flag */ @@ -103,7 +146,7 @@ struct nfsnode { /* * Queue head for nfsiod's */ -TAILQ_HEAD(nfsbufs, buf) nfs_bufq; +TAILQ_HEAD(, buf) nfs_bufq; #ifdef KERNEL /* @@ -115,23 +158,22 @@ int nfs_mknod __P((struct vop_mknod_args *)); int nfs_open __P((struct vop_open_args *)); int nfs_close __P((struct vop_close_args *)); int nfsspec_close __P((struct vop_close_args *)); -#ifdef FIFO int nfsfifo_close __P((struct vop_close_args *)); -#endif int nfs_access __P((struct vop_access_args *)); int nfsspec_access __P((struct vop_access_args *)); int nfs_getattr __P((struct vop_getattr_args *)); int nfs_setattr __P((struct vop_setattr_args *)); int nfs_read __P((struct vop_read_args *)); int nfs_write __P((struct vop_write_args *)); +#define nfs_lease_check ((int (*) __P((struct vop_lease_args *)))nullop) +#define nqnfs_vop_lease_check lease_check int nfsspec_read __P((struct vop_read_args *)); int nfsspec_write __P((struct vop_write_args *)); -#ifdef FIFO int nfsfifo_read __P((struct vop_read_args *)); int nfsfifo_write __P((struct vop_write_args *)); -#endif #define nfs_ioctl ((int (*) __P((struct vop_ioctl_args *)))enoioctl) #define nfs_select ((int (*) __P((struct vop_select_args *)))seltrue) +#define nfs_revoke vop_revoke int nfs_mmap __P((struct vop_mmap_args *)); int nfs_fsync __P((struct vop_fsync_args *)); #define nfs_seek ((int (*) __P((struct vop_seek_args *)))nullop) @@ -146,15 +188,16 @@ int nfs_readlink __P((struct vop_readlink_args *)); int nfs_abortop __P((struct vop_abortop_args *)); int nfs_inactive __P((struct vop_inactive_args *)); int nfs_reclaim __P((struct vop_reclaim_args *)); -int nfs_lock __P((struct vop_lock_args *)); -int nfs_unlock __P((struct vop_unlock_args *)); +#define nfs_lock ((int (*) __P((struct vop_lock_args *)))vop_nolock) +#define nfs_unlock ((int (*) __P((struct vop_unlock_args *)))vop_nounlock) +#define nfs_islocked ((int (*) __P((struct vop_islocked_args *)))vop_noislocked) int nfs_bmap __P((struct vop_bmap_args *)); int nfs_strategy __P((struct vop_strategy_args *)); int nfs_print __P((struct vop_print_args *)); -int nfs_islocked __P((struct vop_islocked_args *)); int nfs_pathconf __P((struct vop_pathconf_args *)); int nfs_advlock __P((struct vop_advlock_args *)); int nfs_blkatoff __P((struct vop_blkatoff_args *)); +int nfs_bwrite __P((struct vop_bwrite_args *)); int nfs_vget __P((struct mount *, ino_t, struct vnode **)); int nfs_valloc __P((struct vop_valloc_args *)); #define nfs_reallocblks \ @@ -162,5 +205,16 @@ int nfs_valloc __P((struct vop_valloc_args *)); int nfs_vfree __P((struct vop_vfree_args *)); int nfs_truncate __P((struct vop_truncate_args *)); int nfs_update __P((struct vop_update_args *)); -int nfs_bwrite __P((struct vop_bwrite_args *)); + +/* other stuff */ +int nfs_removeit __P((struct sillyrename *)); +int nfs_nget __P((struct mount *,nfsfh_t *,int,struct nfsnode **)); +int nfs_lookitup __P((struct vnode *,char *,int,struct ucred *,struct proc *,struct nfsnode **)); +int nfs_sillyrename __P((struct vnode *,struct vnode *,struct componentname *)); +nfsuint64 *nfs_getcookie __P((struct nfsnode *, off_t, int)); +void nfs_invaldir __P((struct vnode *)); +#define nqnfs_lease_updatetime lease_updatetime + #endif /* KERNEL */ + +#endif |