diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2013-04-15 15:32:20 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2013-04-15 15:32:20 +0000 |
commit | fe915cc6dc03f86ee7339daa4ac45c90980b5481 (patch) | |
tree | 8fb04d8fb16c2c63fcefd0cfd0a04d80c0af3ad8 /sys/ntfs/ntfs_vfsops.c | |
parent | f85d6054d53f84d310202c4342c2f64d0107d0a5 (diff) |
Add an f_mntfromspec member to struct statfs, which specifies the name of
the special provided when the mount was requested. This may be the same as
the special that was actually used for the mount (e.g. in the case of a
device node) or it may be different (e.g. in the case of a DUID).
Whilst here, change f_ctime to a 64 bit type and remove the pointless
f_spare members.
Compatibility goo courtesy of guenther@
ok krw@ millert@
Diffstat (limited to 'sys/ntfs/ntfs_vfsops.c')
-rw-r--r-- | sys/ntfs/ntfs_vfsops.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c index fd08a45c480..120a400fe12 100644 --- a/sys/ntfs/ntfs_vfsops.c +++ b/sys/ntfs/ntfs_vfsops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntfs_vfsops.c,v 1.33 2013/01/18 05:09:21 jsing Exp $ */ +/* $OpenBSD: ntfs_vfsops.c,v 1.34 2013/04/15 15:32:19 jsing Exp $ */ /* $NetBSD: ntfs_vfsops.c,v 1.7 2003/04/24 07:50:19 christos Exp $ */ /*- @@ -125,6 +125,7 @@ ntfs_mount(struct mount *mp, const char *path, void *data, int err = 0; struct vnode *devvp; struct ntfs_args args; + char fname[MNAMELEN]; char fspec[MNAMELEN]; mode_t amode; @@ -167,9 +168,11 @@ ntfs_mount(struct mount *mp, const char *path, void *data, err = copyinstr(args.fspec, fspec, sizeof(fspec), NULL); if (err) goto error_1; - disk_map(fspec, fspec, MNAMELEN, DM_OPENBLCK); - NDINIT(ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, fspec, p); + if (disk_map(fspec, fname, sizeof(fname), DM_OPENBLCK) == -1) + bcopy(fspec, fname, sizeof(fname)); + + NDINIT(ndp, LOOKUP, FOLLOW, UIO_SYSSPACE, fname, p); err = namei(ndp); if (err) { /* can't get devvp!*/ @@ -238,7 +241,9 @@ ntfs_mount(struct mount *mp, const char *path, void *data, bzero(mp->mnt_stat.f_mntonname, MNAMELEN); strlcpy(mp->mnt_stat.f_mntonname, path, MNAMELEN); bzero(mp->mnt_stat.f_mntfromname, MNAMELEN); - strlcpy(mp->mnt_stat.f_mntfromname, fspec, MNAMELEN); + strlcpy(mp->mnt_stat.f_mntfromname, fname, MNAMELEN); + bzero(mp->mnt_stat.f_mntfromspec, MNAMELEN); + strlcpy(mp->mnt_stat.f_mntfromspec, fspec, MNAMELEN); bcopy(&args, &mp->mnt_stat.mount_info.ntfs_args, sizeof(args)); if ( !err) { err = ntfs_mountfs(devvp, mp, &args, p); |