Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/smbfs set mntfromname in a less creative and historic...
details: https://anonhg.NetBSD.org/src/rev/b2342870ae80
branches: trunk
changeset: 747254:b2342870ae80
user: pooka <pooka%NetBSD.org@localhost>
date: Mon Sep 07 12:52:53 2009 +0000
description:
set mntfromname in a less creative and historic fashion
diffstat:
sys/fs/smbfs/smbfs_vfsops.c | 27 ++++++++++++++++-----------
1 files changed, 16 insertions(+), 11 deletions(-)
diffs (68 lines):
diff -r c83822bcabae -r b2342870ae80 sys/fs/smbfs/smbfs_vfsops.c
--- a/sys/fs/smbfs/smbfs_vfsops.c Mon Sep 07 12:44:29 2009 +0000
+++ b/sys/fs/smbfs/smbfs_vfsops.c Mon Sep 07 12:52:53 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbfs_vfsops.c,v 1.88 2009/07/02 16:17:52 njoly Exp $ */
+/* $NetBSD: smbfs_vfsops.c,v 1.89 2009/09/07 12:52:53 pooka Exp $ */
/*
* Copyright (c) 2000-2001, Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.88 2009/07/02 16:17:52 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_vfsops.c,v 1.89 2009/09/07 12:52:53 pooka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -161,6 +161,7 @@
struct smb_share *ssp = NULL;
struct smb_cred scred;
struct proc *p;
+ char *fromname;
int error;
if (*data_len < sizeof *args)
@@ -185,17 +186,25 @@
return EINVAL;
}
- error = set_statvfs_info(path, UIO_USERSPACE, NULL, UIO_USERSPACE,
- mp->mnt_op->vfs_name, mp, l);
- if (error)
- return error;
-
smb_makescred(&scred, l, l->l_cred);
error = smb_dev2share(args->dev_fd, SMBM_EXEC, &scred, &ssp);
if (error)
return error;
smb_share_unlock(ssp); /* keep ref, but unlock */
vcp = SSTOVC(ssp);
+
+ fromname = kmem_zalloc(MNAMELEN, KM_SLEEP);
+ snprintf(fromname, MNAMELEN,
+ "//%s@%s/%s", vcp->vc_username, vcp->vc_srvname, ssp->ss_name);
+ error = set_statvfs_info(path, UIO_USERSPACE, fromname, UIO_USERSPACE,
+ mp->mnt_op->vfs_name, mp, l);
+ kmem_free(fromname, MNAMELEN);
+ if (error) {
+ smb_share_lock(ssp);
+ smb_share_put(ssp, &scred);
+ return error;
+ }
+
mp->mnt_stat.f_iosize = vcp->vc_txmax;
mp->mnt_stat.f_namemax =
(vcp->vc_hflags2 & SMB_FLAGS2_KNOWS_LONG_NAMES) ? 255 : 12;
@@ -216,10 +225,6 @@
smp->sm_args.dir_mode = (smp->sm_args.dir_mode &
(S_IRWXU|S_IRWXG|S_IRWXO)) | S_IFDIR;
- memset(mp->mnt_stat.f_mntfromname, 0, MNAMELEN);
- snprintf(mp->mnt_stat.f_mntfromname, MNAMELEN,
- "//%s@%s/%s", vcp->vc_username, vcp->vc_srvname, ssp->ss_name);
-
vfs_getnewfsid(mp);
return (0);
}
Home |
Main Index |
Thread Index |
Old Index