SCCS-vsn: sys/nfs/nfs_bio.c 7.19
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)nfs_bio.c 7.18 (Berkeley) %G%
+ * @(#)nfs_bio.c 7.19 (Berkeley) %G%
*/
#include "param.h"
#include "proc.h"
#include "buf.h"
*/
#include "param.h"
#include "proc.h"
#include "buf.h"
+#include "uio.h"
+#include "namei.h"
#include "vnode.h"
#include "trace.h"
#include "mount.h"
#include "vnode.h"
#include "trace.h"
#include "mount.h"
#ifdef lint
ioflag = ioflag;
#endif /* lint */
#ifdef lint
ioflag = ioflag;
#endif /* lint */
if (uio->uio_rw != UIO_READ)
panic("nfs_read mode");
if (uio->uio_rw != UIO_READ)
panic("nfs_read mode");
if (uio->uio_resid == 0)
return (0);
if (uio->uio_offset < 0 && vp->v_type != VDIR)
if (uio->uio_resid == 0)
return (0);
if (uio->uio_offset < 0 && vp->v_type != VDIR)
vinvalbuf(vp, TRUE);
np->n_attrstamp = 0;
np->n_direofoffset = 0;
vinvalbuf(vp, TRUE);
np->n_attrstamp = 0;
np->n_direofoffset = 0;
- if (error = nfs_dogetattr(vp, &vattr, cred, 1))
+ if (error = nfs_dogetattr(vp, &vattr, cred, 1,
+ uio->uio_procp))
return (error);
np->n_mtime = vattr.va_mtime.tv_sec;
} else {
return (error);
np->n_mtime = vattr.va_mtime.tv_sec;
} else {
- if (error = nfs_dogetattr(vp, &vattr, cred, 1))
+ if (error = nfs_dogetattr(vp, &vattr, cred, 1,
+ uio->uio_procp))
return (error);
if (np->n_mtime != vattr.va_mtime.tv_sec) {
np->n_direofoffset = 0;
return (error);
if (np->n_mtime != vattr.va_mtime.tv_sec) {
np->n_direofoffset = 0;
case VDIR:
nfsstats.biocache_readdirs++;
on = 0;
case VDIR:
nfsstats.biocache_readdirs++;
on = 0;
- error = bread(vp, uio->uio_offset, DIRBLKSIZ, cred, &bp);
- n = MIN(uio->uio_resid, DIRBLKSIZ - bp->b_resid);
+ error = bread(vp, uio->uio_offset, NFS_DIRBLKSIZ, cred, &bp);
+ n = MIN(uio->uio_resid, NFS_DIRBLKSIZ - bp->b_resid);
int ioflag;
struct ucred *cred;
{
int ioflag;
struct ucred *cred;
{
- struct proc *p = curproc; /* XXX */
+ struct proc *p = uio->uio_procp;
register int biosize;
struct buf *bp;
struct nfsnode *np = VTONFS(vp);
register int biosize;
struct buf *bp;
struct nfsnode *np = VTONFS(vp);
daddr_t lbn, bn;
int n, on, error = 0;
daddr_t lbn, bn;
int n, on, error = 0;
if (uio->uio_rw != UIO_WRITE)
panic("nfs_write mode");
if (uio->uio_rw != UIO_WRITE)
panic("nfs_write mode");
+ if (uio->uio_segflg == UIO_USERSPACE && uio->uio_procp != curproc)
+ panic("nfs_write proc");
+#endif
if (vp->v_type != VREG)
return (EIO);
/* Should we try and do this ?? */
if (vp->v_type != VREG)
return (EIO);
/* Should we try and do this ?? */
}
if (ioflag & IO_APPEND) {
np->n_attrstamp = 0;
}
if (ioflag & IO_APPEND) {
np->n_attrstamp = 0;
- if (error = nfs_dogetattr(vp, &vattr, cred, 1))
+ if (error = nfs_dogetattr(vp, &vattr, cred, 1, p))
return (error);
uio->uio_offset = np->n_size;
}
return (error);
uio->uio_offset = np->n_size;
}
- return (nfs_writerpc(vp, uio, cred, p));
+ return (nfs_writerpc(vp, uio, cred));
}
#ifdef notdef
cnt = uio->uio_resid;
}
#ifdef notdef
cnt = uio->uio_resid;