diff options
author | mohans <mohans@FreeBSD.org> | 2006-05-19 00:04:24 +0000 |
---|---|---|
committer | mohans <mohans@FreeBSD.org> | 2006-05-19 00:04:24 +0000 |
commit | 60ef6157336e266567b08916dee68af4c4f4d21e (patch) | |
tree | 02c7543fb7adb7dda8df6f0ad320769be2b28c31 /sys/nfsclient/nfsnode.h | |
parent | 876847ec5e682b076f7a4f80cf4918cfed7d4a06 (diff) | |
download | FreeBSD-src-60ef6157336e266567b08916dee68af4c4f4d21e.zip FreeBSD-src-60ef6157336e266567b08916dee68af4c4f4d21e.tar.gz |
Changes to make the NFS client MP safe.
Thanks to Kris Kennaway for testing and sending lots of bugs my way.
Diffstat (limited to 'sys/nfsclient/nfsnode.h')
-rw-r--r-- | sys/nfsclient/nfsnode.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/nfsclient/nfsnode.h b/sys/nfsclient/nfsnode.h index a0a2a88..e03e97c 100644 --- a/sys/nfsclient/nfsnode.h +++ b/sys/nfsclient/nfsnode.h @@ -88,6 +88,7 @@ struct nfsdmap { * be well aligned and, therefore, tightly packed. */ struct nfsnode { + struct mtx n_mtx; /* Protects all of these members */ 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 */ @@ -124,9 +125,8 @@ struct nfsnode { struct nfs4_fctx n_wfc; u_char *n_name; /* leaf name, for v4 OPEN op */ uint32_t n_namelen; - daddr_t ra_expect_lbn; int n_directio_opens; - int n_directio_asyncwr; + int n_directio_asyncwr; }; #define n_atim n_un1.nf_atim @@ -140,6 +140,8 @@ struct nfsnode { /* * Flags for n_flag */ +#define NFSYNCWAIT 0x0002 /* fsync waiting for all directio async writes + to drain */ #define NMODIFIED 0x0004 /* Might have a modified buffer in bio */ #define NWRITEERR 0x0008 /* Flag write errors so close will know */ /* 0x20, 0x40, 0x80 free */ @@ -150,8 +152,7 @@ struct nfsnode { #define NTRUNCATE 0x1000 /* Opened by nfs_setattr() */ #define NSIZECHANGED 0x2000 /* File size has changed: need cache inval */ #define NNONCACHE 0x4000 /* Node marked as noncacheable */ -#define NFSYNCWAIT 0x8000 /* fsync waiting for all directio async writes - to drain */ +#define NDIRCOOKIELK 0x8000 /* Lock to serialize access to directory cookies */ /* * Convert between nfsnode pointers and vnode pointers @@ -193,6 +194,12 @@ nfsuint64 *nfs_getcookie(struct nfsnode *, off_t, int); uint64_t *nfs4_getcookie(struct nfsnode *, off_t, int); void nfs_invaldir(struct vnode *); void nfs4_invaldir(struct vnode *); +int nfs_upgrade_vnlock(struct vnode *vp, struct thread *td); +void nfs_downgrade_vnlock(struct vnode *vp, struct thread *td, int old_lock); +void nfs_printf(const char *fmt, ...); + +void nfs_dircookie_lock(struct nfsnode *np); +void nfs_dircookie_unlock(struct nfsnode *np); #endif /* _KERNEL */ |