summaryrefslogtreecommitdiffstats
path: root/sys/fs/nfsclient/nfs_clvfsops.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs/nfsclient/nfs_clvfsops.c')
-rw-r--r--sys/fs/nfsclient/nfs_clvfsops.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c
index d7245ee..b2d4864 100644
--- a/sys/fs/nfsclient/nfs_clvfsops.c
+++ b/sys/fs/nfsclient/nfs_clvfsops.c
@@ -102,7 +102,8 @@ static int mountnfs(struct nfs_args *, struct mount *,
struct sockaddr *, char *, u_char *, u_char *, u_char *,
struct vnode **, struct ucred *, struct thread *, int);
static void nfs_getnlminfo(struct vnode *, uint8_t *, size_t *,
- struct sockaddr_storage *, int *, off_t *);
+ struct sockaddr_storage *, int *, off_t *,
+ struct timeval *);
static vfs_mount_t nfs_mount;
static vfs_cmount_t nfs_cmount;
static vfs_unmount_t nfs_unmount;
@@ -451,10 +452,12 @@ ncl_mountroot(struct mount *mp)
sin.sin_family = AF_INET;
sin.sin_len = sizeof(sin);
/* XXX MRT use table 0 for this sort of thing */
+ CURVNET_SET(TD_TO_VNET(td));
error = rtrequest(RTM_ADD, (struct sockaddr *)&sin,
(struct sockaddr *)&nd->mygateway,
(struct sockaddr *)&mask,
RTF_UP | RTF_GATEWAY, NULL);
+ CURVNET_RESTORE();
if (error)
panic("nfs_mountroot: RTM_ADD: %d", error);
}
@@ -1123,6 +1126,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam,
mtx_init(&nmp->nm_sockreq.nr_mtx, "nfssock", NULL, MTX_DEF);
mp->mnt_data = nmp;
nmp->nm_getinfo = nfs_getnlminfo;
+ nmp->nm_vinvalbuf = ncl_vinvalbuf;
}
vfs_getnewfsid(mp);
nmp->nm_mountp = mp;
@@ -1465,7 +1469,8 @@ nfs_sysctl(struct mount *mp, fsctlop_t op, struct sysctl_req *req)
*/
static void
nfs_getnlminfo(struct vnode *vp, uint8_t *fhp, size_t *fhlenp,
- struct sockaddr_storage *sp, int *is_v3p, off_t *sizep)
+ struct sockaddr_storage *sp, int *is_v3p, off_t *sizep,
+ struct timeval *timeop)
{
struct nfsmount *nmp;
struct nfsnode *np = VTONFS(vp);
@@ -1481,5 +1486,9 @@ nfs_getnlminfo(struct vnode *vp, uint8_t *fhp, size_t *fhlenp,
*is_v3p = NFS_ISV3(vp);
if (sizep != NULL)
*sizep = np->n_size;
+ if (timeop != NULL) {
+ timeop->tv_sec = nmp->nm_timeo / NFS_HZ;
+ timeop->tv_usec = (nmp->nm_timeo % NFS_HZ) * (1000000 / NFS_HZ);
+ }
}
OpenPOWER on IntegriCloud