Lines 906-911
ncl_write(struct vop_write_args *ap)
Link Here
|
906 |
int bp_cached, n, on, error = 0, error1, save2, wouldcommit; |
906 |
int bp_cached, n, on, error = 0, error1, save2, wouldcommit; |
907 |
size_t orig_resid, local_resid; |
907 |
size_t orig_resid, local_resid; |
908 |
off_t orig_size, tmp_off; |
908 |
off_t orig_size, tmp_off; |
|
|
909 |
struct timespec ts; |
909 |
|
910 |
|
910 |
KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); |
911 |
KASSERT(uio->uio_rw == UIO_WRITE, ("ncl_write mode")); |
911 |
KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, |
912 |
KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, |
Lines 1283-1289
again:
Link Here
|
1283 |
break; |
1284 |
break; |
1284 |
} while (uio->uio_resid > 0 && n > 0); |
1285 |
} while (uio->uio_resid > 0 && n > 0); |
1285 |
|
1286 |
|
1286 |
if (error != 0) { |
1287 |
if (error == 0) { |
|
|
1288 |
nanouptime(&ts); |
1289 |
NFSLOCKNODE(np); |
1290 |
np->n_localmodtime = ts; |
1291 |
NFSUNLOCKNODE(np); |
1292 |
} else { |
1287 |
if (ioflag & IO_UNIT) { |
1293 |
if (ioflag & IO_UNIT) { |
1288 |
VATTR_NULL(&vattr); |
1294 |
VATTR_NULL(&vattr); |
1289 |
vattr.va_size = orig_size; |
1295 |
vattr.va_size = orig_size; |
Lines 1355-1360
ncl_vinvalbuf(struct vnode *vp, int flags, struct thre
Link Here
|
1355 |
struct nfsmount *nmp = VFSTONFS(vp->v_mount); |
1361 |
struct nfsmount *nmp = VFSTONFS(vp->v_mount); |
1356 |
int error = 0, slpflag, slptimeo; |
1362 |
int error = 0, slpflag, slptimeo; |
1357 |
bool old_lock; |
1363 |
bool old_lock; |
|
|
1364 |
struct timespec ts; |
1358 |
|
1365 |
|
1359 |
ASSERT_VOP_LOCKED(vp, "ncl_vinvalbuf"); |
1366 |
ASSERT_VOP_LOCKED(vp, "ncl_vinvalbuf"); |
1360 |
|
1367 |
|
Lines 1399-1414
ncl_vinvalbuf(struct vnode *vp, int flags, struct thre
Link Here
|
1399 |
} |
1406 |
} |
1400 |
if (NFSHASPNFS(nmp)) { |
1407 |
if (NFSHASPNFS(nmp)) { |
1401 |
nfscl_layoutcommit(vp, td); |
1408 |
nfscl_layoutcommit(vp, td); |
|
|
1409 |
nanouptime(&ts); |
1402 |
/* |
1410 |
/* |
1403 |
* Invalidate the attribute cache, since writes to a DS |
1411 |
* Invalidate the attribute cache, since writes to a DS |
1404 |
* won't update the size attribute. |
1412 |
* won't update the size attribute. |
1405 |
*/ |
1413 |
*/ |
1406 |
NFSLOCKNODE(np); |
1414 |
NFSLOCKNODE(np); |
1407 |
np->n_attrstamp = 0; |
1415 |
np->n_attrstamp = 0; |
1408 |
} else |
1416 |
} else { |
|
|
1417 |
nanouptime(&ts); |
1409 |
NFSLOCKNODE(np); |
1418 |
NFSLOCKNODE(np); |
1410 |
if (np->n_directio_asyncwr == 0) |
1419 |
} |
|
|
1420 |
if (np->n_directio_asyncwr == 0 && (np->n_flag & NMODIFIED) != 0) { |
1421 |
np->n_localmodtime = ts; |
1411 |
np->n_flag &= ~NMODIFIED; |
1422 |
np->n_flag &= ~NMODIFIED; |
|
|
1423 |
} |
1412 |
NFSUNLOCKNODE(np); |
1424 |
NFSUNLOCKNODE(np); |
1413 |
out: |
1425 |
out: |
1414 |
ncl_excl_finish(vp, old_lock); |
1426 |
ncl_excl_finish(vp, old_lock); |