summaryrefslogtreecommitdiff
path: root/sys/ntfs
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2013-08-13 05:52:28 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2013-08-13 05:52:28 +0000
commitf2b95a621a9fd41d222844eda237f607eb14d49c (patch)
tree38d62981cd1caedc3a6a01713c2e4266107b7220 /sys/ntfs
parentbee789b12305f3c5e594fe03c965e0786969eeb7 (diff)
Switch time_t, ino_t, clock_t, and struct kevent's ident and data
members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
Diffstat (limited to 'sys/ntfs')
-rw-r--r--sys/ntfs/ntfs_vnops.c43
1 files changed, 8 insertions, 35 deletions
diff --git a/sys/ntfs/ntfs_vnops.c b/sys/ntfs/ntfs_vnops.c
index 533e1ee05c1..bbaa72d08f1 100644
--- a/sys/ntfs/ntfs_vnops.c
+++ b/sys/ntfs/ntfs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_vnops.c,v 1.30 2013/03/28 02:08:39 guenther Exp $ */
+/* $OpenBSD: ntfs_vnops.c,v 1.31 2013/08/13 05:52:26 guenther Exp $ */
/* $NetBSD: ntfs_vnops.c,v 1.6 2003/04/10 21:57:26 jdolecek Exp $ */
/*
@@ -477,29 +477,27 @@ ntfs_readdir(void *v)
struct ntfsmount *ntmp = ip->i_mp;
int i, error = 0;
u_int32_t faked = 0, num;
- int ncookies = 0;
struct dirent *cde;
off_t off;
- dprintf(("ntfs_readdir %d off: %d resid: %d\n",ip->i_number,(u_int32_t)uio->uio_offset,uio->uio_resid));
+ dprintf(("ntfs_readdir %d off: %lld resid: %d\n", ip->i_number,
+ uio->uio_offset, uio->uio_resid));
off = uio->uio_offset;
cde = malloc(sizeof(struct dirent), M_TEMP, M_WAITOK);
/* Simulate . in every dir except ROOT */
- if (ip->i_number != NTFS_ROOTINO
- && uio->uio_offset < sizeof(struct dirent)) {
+ if (ip->i_number != NTFS_ROOTINO && uio->uio_offset == 0) {
cde->d_fileno = ip->i_number;
cde->d_reclen = sizeof(struct dirent);
cde->d_type = DT_DIR;
cde->d_namlen = 1;
+ cde->d_off = sizeof(struct dirent);
strncpy(cde->d_name, ".", 2);
- error = uiomove((void *)cde, sizeof(struct dirent), uio);
+ error = uiomove(cde, sizeof(struct dirent), uio);
if (error)
goto out;
-
- ncookies++;
}
/* Simulate .. in every dir including ROOT */
@@ -508,13 +506,12 @@ ntfs_readdir(void *v)
cde->d_reclen = sizeof(struct dirent);
cde->d_type = DT_DIR;
cde->d_namlen = 2;
+ cde->d_off = 2 * sizeof(struct dirent);
strncpy(cde->d_name, "..", 3);
- error = uiomove((void *) cde, sizeof(struct dirent), uio);
+ error = uiomove(cde, sizeof(struct dirent), uio);
if (error)
goto out;
-
- ncookies++;
}
faked = (ip->i_number == NTFS_ROOTINO) ? 1 : 2;
@@ -560,8 +557,6 @@ ntfs_readdir(void *v)
error = uiomove((void *)cde, sizeof(struct dirent), uio);
if (error)
goto out;
-
- ncookies++;
num++;
}
}
@@ -571,28 +566,6 @@ ntfs_readdir(void *v)
dprintf(("ntfs_readdir: off: %d resid: %d\n",
(u_int32_t)uio->uio_offset,uio->uio_resid));
- if (!error && ap->a_ncookies != NULL) {
- struct dirent* dpStart;
- struct dirent* dp;
- u_long *cookies;
- u_long *cookiep;
-
- dprintf(("ntfs_readdir: %d cookies\n",ncookies));
- if (uio->uio_segflg != UIO_SYSSPACE || uio->uio_iovcnt != 1)
- panic("ntfs_readdir: unexpected uio from NFS server");
- dpStart = (struct dirent *)
- ((caddr_t)uio->uio_iov->iov_base -
- (uio->uio_offset - off));
- cookies = malloc(ncookies * sizeof(*cookies), M_TEMP, M_WAITOK);
- for (dp = dpStart, cookiep = cookies, i=0;
- i < ncookies;
- dp = (struct dirent *)((caddr_t) dp + dp->d_reclen), i++) {
- off += dp->d_reclen;
- *cookiep++ = off;
- }
- *ap->a_ncookies = ncookies;
- *ap->a_cookies = cookies;
- }
/*
if (ap->a_eofflag)
*ap->a_eofflag = VTONT(ap->a_vp)->i_size <= uio->uio_offset;