Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfsclient/nfs_clbio.c
Show First 20 Lines • Show All 377 Lines • ▼ Show 20 Lines | if (vp->v_type != VREG) { | ||||
panic("nfs: bioread, not dir"); | panic("nfs: bioread, not dir"); | ||||
ncl_invaldir(vp); | ncl_invaldir(vp); | ||||
error = ncl_vinvalbuf(vp, V_SAVE | V_ALLOWCLEAN, td, 1); | error = ncl_vinvalbuf(vp, V_SAVE | V_ALLOWCLEAN, td, 1); | ||||
if (error != 0) | if (error != 0) | ||||
goto out; | goto out; | ||||
} | } | ||||
np->n_attrstamp = 0; | np->n_attrstamp = 0; | ||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); | KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); | ||||
error = VOP_GETATTR(vp, &vattr, cred); | error = VOP_GETATTR(vp, 0, &vattr, cred); | ||||
if (error) | if (error) | ||||
goto out; | goto out; | ||||
NFSLOCKNODE(np); | NFSLOCKNODE(np); | ||||
np->n_mtime = vattr.va_mtime; | np->n_mtime = vattr.va_mtime; | ||||
NFSUNLOCKNODE(np); | NFSUNLOCKNODE(np); | ||||
} else { | } else { | ||||
NFSUNLOCKNODE(np); | NFSUNLOCKNODE(np); | ||||
error = VOP_GETATTR(vp, &vattr, cred); | error = VOP_GETATTR(vp, 0, &vattr, cred); | ||||
if (error) | if (error) | ||||
goto out; | goto out; | ||||
NFSLOCKNODE(np); | NFSLOCKNODE(np); | ||||
if ((np->n_flag & NSIZECHANGED) | if ((np->n_flag & NSIZECHANGED) | ||||
|| (NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime))) { | || (NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime))) { | ||||
NFSUNLOCKNODE(np); | NFSUNLOCKNODE(np); | ||||
if (vp->v_type == VDIR) | if (vp->v_type == VDIR) | ||||
ncl_invaldir(vp); | ncl_invaldir(vp); | ||||
▲ Show 20 Lines • Show All 513 Lines • ▼ Show 20 Lines | if (ioflag & IO_APPEND) { | ||||
* write will then be retried, using the file size returned | * write will then be retried, using the file size returned | ||||
* by the AppendWrite. However, for NFSv2 and NFSv3, the | * by the AppendWrite. However, for NFSv2 and NFSv3, the | ||||
* size must be acquired here via a Getattr RPC. | * size must be acquired here via a Getattr RPC. | ||||
* The AppendWrite is not done for a pNFS mount. | * The AppendWrite is not done for a pNFS mount. | ||||
*/ | */ | ||||
if (!NFSHASNFSV4(nmp) || NFSHASPNFS(nmp)) { | if (!NFSHASNFSV4(nmp) || NFSHASPNFS(nmp)) { | ||||
np->n_attrstamp = 0; | np->n_attrstamp = 0; | ||||
KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); | KDTRACE_NFS_ATTRCACHE_FLUSH_DONE(vp); | ||||
error = VOP_GETATTR(vp, &vattr, cred); | error = VOP_GETATTR(vp, 0, &vattr, cred); | ||||
if (error) | if (error) | ||||
return (error); | return (error); | ||||
} | } | ||||
NFSLOCKNODE(np); | NFSLOCKNODE(np); | ||||
uio->uio_offset = np->n_size; | uio->uio_offset = np->n_size; | ||||
NFSUNLOCKNODE(np); | NFSUNLOCKNODE(np); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 909 Lines • Show Last 20 Lines |