Changeset View
Changeset View
Standalone View
Standalone View
sys/fs/nfsserver/nfs_nfsdstate.c
Show First 20 Lines • Show All 8,498 Lines • ▼ Show 20 Lines | if (ret == 0) { | ||||
if (retacl != 0 && retacl != ENOATTR) | if (retacl != 0 && retacl != ENOATTR) | ||||
NFSD_DEBUG(1, "nfsrv_copymr: vop_getacl=%d\n", retacl); | NFSD_DEBUG(1, "nfsrv_copymr: vop_getacl=%d\n", retacl); | ||||
dat = malloc(PNFSDS_COPYSIZ, M_TEMP, M_WAITOK); | dat = malloc(PNFSDS_COPYSIZ, M_TEMP, M_WAITOK); | ||||
/* Malloc a block of 0s used to check for holes. */ | /* Malloc a block of 0s used to check for holes. */ | ||||
if (nfsrv_zeropnfsdat == NULL) | if (nfsrv_zeropnfsdat == NULL) | ||||
nfsrv_zeropnfsdat = malloc(PNFSDS_COPYSIZ, M_TEMP, | nfsrv_zeropnfsdat = malloc(PNFSDS_COPYSIZ, M_TEMP, | ||||
M_WAITOK | M_ZERO); | M_WAITOK | M_ZERO); | ||||
rdpos = wrpos = 0; | rdpos = wrpos = 0; | ||||
ret = VOP_GETATTR(fvp, &va, cred); | ret = VOP_GETATTR(fvp, 0, &va, cred); | ||||
aresid = 0; | aresid = 0; | ||||
while (ret == 0 && aresid == 0) { | while (ret == 0 && aresid == 0) { | ||||
ret = vn_rdwr(UIO_READ, fvp, dat, PNFSDS_COPYSIZ, | ret = vn_rdwr(UIO_READ, fvp, dat, PNFSDS_COPYSIZ, | ||||
rdpos, UIO_SYSSPACE, IO_NODELOCKED, cred, NULL, | rdpos, UIO_SYSSPACE, IO_NODELOCKED, cred, NULL, | ||||
&aresid, p); | &aresid, p); | ||||
xfer = PNFSDS_COPYSIZ - aresid; | xfer = PNFSDS_COPYSIZ - aresid; | ||||
if (ret == 0 && xfer > 0) { | if (ret == 0 && xfer > 0) { | ||||
rdpos += xfer; | rdpos += xfer; | ||||
Show All 28 Lines | if (ret == 0 && retacl == 0) { | ||||
ret = 0; | ret = 0; | ||||
} | } | ||||
if (ret == 0) | if (ret == 0) | ||||
ret = VOP_FSYNC(tvp, MNT_WAIT, p); | ret = VOP_FSYNC(tvp, MNT_WAIT, p); | ||||
/* Set the DS data file's modify time that of the MDS file. */ | /* Set the DS data file's modify time that of the MDS file. */ | ||||
if (ret == 0) | if (ret == 0) | ||||
ret = VOP_GETATTR(vp, &va, cred); | ret = VOP_GETATTR(vp, 0, &va, cred); | ||||
if (ret == 0) { | if (ret == 0) { | ||||
mtime = va.va_mtime; | mtime = va.va_mtime; | ||||
VATTR_NULL(&va); | VATTR_NULL(&va); | ||||
va.va_mtime = mtime; | va.va_mtime = mtime; | ||||
ret = VOP_SETATTR(tvp, &va, cred); | ret = VOP_SETATTR(tvp, &va, cred); | ||||
} | } | ||||
vput(tvp); | vput(tvp); | ||||
Show All 26 Lines | |||||
nfsrv_createdsfile(vnode_t vp, fhandle_t *fhp, struct pnfsdsfile *pf, | nfsrv_createdsfile(vnode_t vp, fhandle_t *fhp, struct pnfsdsfile *pf, | ||||
vnode_t dvp, struct nfsdevice *ds, struct ucred *cred, NFSPROC_T *p, | vnode_t dvp, struct nfsdevice *ds, struct ucred *cred, NFSPROC_T *p, | ||||
vnode_t *tvpp) | vnode_t *tvpp) | ||||
{ | { | ||||
struct vattr va, nva; | struct vattr va, nva; | ||||
int error; | int error; | ||||
/* Make data file name based on FH. */ | /* Make data file name based on FH. */ | ||||
error = VOP_GETATTR(vp, &va, cred); | error = VOP_GETATTR(vp, 0, &va, cred); | ||||
if (error == 0) { | if (error == 0) { | ||||
/* Set the attributes for "vp" to Setattr the DS vp. */ | /* Set the attributes for "vp" to Setattr the DS vp. */ | ||||
VATTR_NULL(&nva); | VATTR_NULL(&nva); | ||||
nva.va_uid = va.va_uid; | nva.va_uid = va.va_uid; | ||||
nva.va_gid = va.va_gid; | nva.va_gid = va.va_gid; | ||||
nva.va_mode = va.va_mode; | nva.va_mode = va.va_mode; | ||||
nva.va_size = 0; | nva.va_size = 0; | ||||
VATTR_NULL(&va); | VATTR_NULL(&va); | ||||
▲ Show 20 Lines • Show All 403 Lines • Show Last 20 Lines |