diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-12 00:11:24 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-05-12 00:11:24 +0000 |
commit | e88d1ff1f09ba0ea6999ab2e5e2d55dc88434646 (patch) | |
tree | 6f24b585409bf50441d746766fd87118a4f3b2d7 /nuttx/fs/nfs/nfs_vfsops.c | |
parent | 4ddf48475760e7d5b22e391573a940fd604847f8 (diff) | |
download | px4-nuttx-e88d1ff1f09ba0ea6999ab2e5e2d55dc88434646.tar.gz px4-nuttx-e88d1ff1f09ba0ea6999ab2e5e2d55dc88434646.tar.bz2 px4-nuttx-e88d1ff1f09ba0ea6999ab2e5e2d55dc88434646.zip |
NFS update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4724 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/fs/nfs/nfs_vfsops.c')
-rw-r--r-- | nuttx/fs/nfs/nfs_vfsops.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/nuttx/fs/nfs/nfs_vfsops.c b/nuttx/fs/nfs/nfs_vfsops.c index bfdc2e955..879c21ed2 100644 --- a/nuttx/fs/nfs/nfs_vfsops.c +++ b/nuttx/fs/nfs/nfs_vfsops.c @@ -995,7 +995,7 @@ int mountnfs(struct nfs_args *argp, void **handle) { struct nfsmount *nmp; struct nfsnode *np; - int error; + int error = 0; /* Create an instance of the mountpt state structure */ @@ -1031,6 +1031,7 @@ int mountnfs(struct nfs_args *argp, void **handle) //strncpy(&mp->mnt_stat.f_fstypename[0], mp->mnt_vfc->vfc_name, MFSNAMELEN); //memmove(hst, mp->mnt_stat.f_mntfromname, MNAMELEN); //bcopy(pth, nmp->nm_mntonname, 90); + nmp->nm_path = argp->path; //memmove(argp, &mp->mnt_stat.mount_info.nfs_args, sizeof(*argp)); nmp->nm_nam = argp->addr; nfs_decode_args(nmp, argp); @@ -1064,6 +1065,7 @@ int mountnfs(struct nfs_args *argp, void **handle) /* Mounted! */ nmp->nm_mounted = true; + nmp->nm_fh = nmp->nm_rpcclnt->rc_fh; nmp->nm_so = nmp->nm_rpcclnt->rc_so; *handle = (void*)nmp; nfs_semgive(nmp); @@ -1130,7 +1132,8 @@ static int nfs_bind(struct inode *blkdriver, const void *data, void **handle) int nfs_unbind(void *handle, struct inode **blkdriver) { - struct nfsmount *nmp = (struct nfsmount *) handle ; + struct nfsmount *nmp = (struct nfsmount *)handle; + int error; fvdbg("Entry\n"); @@ -1140,6 +1143,14 @@ int nfs_unbind(void *handle, struct inode **blkdriver) } nfs_semtake(nmp); + + error = rpcclnt_umount(nmp->nm_rpcclnt); + if (error) + { + dbg("Umounting fails %d\n", error); + goto bad; + } + nfs_disconnect(nmp); sem_destroy(&nmp->nm_sem); kfree(nmp->nm_head); @@ -1148,6 +1159,10 @@ int nfs_unbind(void *handle, struct inode **blkdriver) kfree(nmp); return 0; + +bad: + nfs_disconnect(nmp); + return(error); } /**************************************************************************** |