Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/sys Pull up following revision(s) (requested by nakayama ...
details: https://anonhg.NetBSD.org/src/rev/d69592157855
branches: netbsd-6
changeset: 775560:d69592157855
user: riz <riz%NetBSD.org@localhost>
date: Mon Dec 10 21:16:25 2012 +0000
description:
Pull up following revision(s) (requested by nakayama in ticket #732):
sys/netsmb/smb.h: revision 1.20
sys/fs/smbfs/smbfs_vnops.c: revision 1.85
sys/fs/smbfs/smbfs_subr.c: revision 1.16
sys/fs/smbfs/smbfs_smb.c: revision 1.44
sys/fs/smbfs/smbfs_subr.h: revision 1.21
Improve smbfs timestamp handling.
Don't round timestamp to 2 seconds resolution if the server
supports the CAP_INFOLEVEL_PASSTHRU capability.
diffstat:
sys/fs/smbfs/smbfs_smb.c | 27 +++++++++++++++++----------
sys/fs/smbfs/smbfs_subr.c | 6 +++---
sys/fs/smbfs/smbfs_subr.h | 4 +---
sys/fs/smbfs/smbfs_vnops.c | 7 +++----
sys/netsmb/smb.h | 3 ++-
5 files changed, 26 insertions(+), 21 deletions(-)
diffs (171 lines):
diff -r 6490b62e98a6 -r d69592157855 sys/fs/smbfs/smbfs_smb.c
--- a/sys/fs/smbfs/smbfs_smb.c Mon Dec 10 21:12:51 2012 +0000
+++ b/sys/fs/smbfs/smbfs_smb.c Mon Dec 10 21:16:25 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbfs_smb.c,v 1.42.8.1 2012/11/29 00:04:37 riz Exp $ */
+/* $NetBSD: smbfs_smb.c,v 1.42.8.2 2012/12/10 21:16:25 riz Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbfs_smb.c,v 1.42.8.1 2012/11/29 00:04:37 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_smb.c,v 1.42.8.2 2012/12/10 21:16:25 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -430,7 +430,6 @@
/*
* NT level. Specially for win9x
*/
-#if 0
int
smbfs_smb_setpattrNT(struct smbnode *np, u_short attr, struct timespec *mtime,
struct timespec *atime, struct smb_cred *scred)
@@ -442,13 +441,22 @@
int64_t tm;
int error, tzoff;
+ /*
+ * SMB_SET_FILE_BASIC_INFO isn't supported for
+ * SMB_TRANS2_SET_PATH_INFORMATION,
+ * so use SMB_SET_FILE_BASIC_INFORMATION instead,
+ * but it requires SMB_CAP_INFOLEVEL_PASSTHRU capability.
+ */
+ if ((SMB_CAPS(vcp) & SMB_CAP_INFOLEVEL_PASSTHRU) == 0)
+ return smbfs_smb_setptime2(np, mtime, atime, attr, scred);
+
error = smb_t2_alloc(SSTOCP(ssp), SMB_TRANS2_SET_PATH_INFORMATION,
scred, &t2p);
if (error)
return error;
mbp = &t2p->t2_tparam;
mb_init(mbp);
- mb_put_uint16le(mbp, SMB_SET_FILE_BASIC_INFO);
+ mb_put_uint16le(mbp, SMB_SET_FILE_BASIC_INFORMATION);
mb_put_uint32le(mbp, 0); /* MBZ */
error = smbfs_fullpath(mbp, vcp, np, NULL, 0);
if (error) {
@@ -471,13 +479,13 @@
mb_put_int64le(mbp, tm);
mb_put_int64le(mbp, tm); /* change time */
mb_put_uint32le(mbp, attr); /* attr */
- t2p->t2_maxpcount = 24;
- t2p->t2_maxdcount = 56;
+ mb_put_uint32le(mbp, 0); /* padding */
+ t2p->t2_maxpcount = 2;
+ t2p->t2_maxdcount = 0;
error = smb_t2_request(t2p);
smb_t2_done(t2p);
return error;
}
-#endif
/*
* Set file atime and mtime. Doesn't supported by core dialect.
@@ -560,9 +568,8 @@
tm = 0;
mb_put_int64le(mbp, tm);
mb_put_int64le(mbp, tm); /* change time */
- mb_put_uint16le(mbp, attr);
- mb_put_uint32le(mbp, 0); /* padding */
- mb_put_uint16le(mbp, 0);
+ mb_put_uint32le(mbp, attr); /* attr */
+ mb_put_uint32le(mbp, 0); /* padding */
t2p->t2_maxpcount = 2;
t2p->t2_maxdcount = 0;
error = smb_t2_request(t2p);
diff -r 6490b62e98a6 -r d69592157855 sys/fs/smbfs/smbfs_subr.c
--- a/sys/fs/smbfs/smbfs_subr.c Mon Dec 10 21:12:51 2012 +0000
+++ b/sys/fs/smbfs/smbfs_subr.c Mon Dec 10 21:16:25 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbfs_subr.c,v 1.15 2011/06/09 02:59:22 rmind Exp $ */
+/* $NetBSD: smbfs_subr.c,v 1.15.8.1 2012/12/10 21:16:25 riz Exp $ */
/*
* Copyright (c) 2000-2001, Boris Popov
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbfs_subr.c,v 1.15 2011/06/09 02:59:22 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_subr.c,v 1.15.8.1 2012/12/10 21:16:25 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -145,7 +145,7 @@
u_long seconds;
smb_time_local2server(tsp, 0, &seconds);
- *nsec = (((int64_t)(seconds) & ~1) + DIFF1970TO1601) * (int64_t)10000000;
+ *nsec = ((int64_t)seconds + DIFF1970TO1601) * (int64_t)10000000;
}
void
diff -r 6490b62e98a6 -r d69592157855 sys/fs/smbfs/smbfs_subr.h
--- a/sys/fs/smbfs/smbfs_subr.h Mon Dec 10 21:12:51 2012 +0000
+++ b/sys/fs/smbfs/smbfs_subr.h Mon Dec 10 21:16:25 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbfs_subr.h,v 1.20 2009/10/20 20:55:01 tron Exp $ */
+/* $NetBSD: smbfs_subr.h,v 1.20.18.1 2012/12/10 21:16:25 riz Exp $ */
/*
* Copyright (c) 2000-2001, Boris Popov
@@ -142,10 +142,8 @@
struct timespec *mtime, struct smb_cred *scred);
int smbfs_smb_setptime2(struct smbnode *np, struct timespec *mtime,
struct timespec *atime, int attr, struct smb_cred *scred);
-#if 0
int smbfs_smb_setpattrNT(struct smbnode *np, u_int16_t attr,
struct timespec *mtime, struct timespec *atime, struct smb_cred *scred);
-#endif
int smbfs_smb_setftime(struct smbnode *np, struct timespec *mtime,
struct timespec *atime, struct smb_cred *scred);
diff -r 6490b62e98a6 -r d69592157855 sys/fs/smbfs/smbfs_vnops.c
--- a/sys/fs/smbfs/smbfs_vnops.c Mon Dec 10 21:12:51 2012 +0000
+++ b/sys/fs/smbfs/smbfs_vnops.c Mon Dec 10 21:16:25 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smbfs_vnops.c,v 1.78.2.2 2012/12/10 21:12:51 riz Exp $ */
+/* $NetBSD: smbfs_vnops.c,v 1.78.2.3 2012/12/10 21:16:25 riz Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: smbfs_vnops.c,v 1.78.2.2 2012/12/10 21:12:51 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: smbfs_vnops.c,v 1.78.2.3 2012/12/10 21:16:25 riz Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -493,8 +493,7 @@
VOP_CLOSE(vp, FWRITE, ap->a_cred);
}
} else if (SMB_CAPS(vcp) & SMB_CAP_NT_SMBS) {
- error = smbfs_smb_setptime2(np, mtime, atime, 0, &scred);
-/* error = smbfs_smb_setpattrNT(np, 0, mtime, atime, &scred);*/
+ error = smbfs_smb_setpattrNT(np, 0, mtime, atime, &scred);
} else if (SMB_DIALECT(vcp) >= SMB_DIALECT_LANMAN2_0) {
error = smbfs_smb_setptime2(np, mtime, atime, 0, &scred);
} else {
diff -r 6490b62e98a6 -r d69592157855 sys/netsmb/smb.h
--- a/sys/netsmb/smb.h Mon Dec 10 21:12:51 2012 +0000
+++ b/sys/netsmb/smb.h Mon Dec 10 21:16:25 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: smb.h,v 1.19 2011/09/27 02:05:10 christos Exp $ */
+/* $NetBSD: smb.h,v 1.19.8.1 2012/12/10 21:16:25 riz Exp $ */
/*
* Copyright (c) 2000-2001 Boris Popov
@@ -374,6 +374,7 @@
*/
#define SMB_SET_FILE_BASIC_INFO 0x101
#define SMB_SET_FILE_END_OF_FILE_INFO 0x104
+#define SMB_SET_FILE_BASIC_INFORMATION 1004
/*
* LOCKING_ANDX LockType flags
Home |
Main Index |
Thread Index |
Old Index