Module Name: src
Committed By: pooka
Date: Tue Sep 1 15:16:41 UTC 2009
Modified Files:
src/sys/fs/ntfs: ntfs_subr.c ntfs_vfsops.c
Log Message:
Set vnode size after creation(*). Fixes cp(1) from ntfs, the
complaint in the "ntfs ubc_uiomove error" (ubc_uiomove error was
not coming from ntfs but instead the "to" file system) and PR
kern/38531 (well, I assume the submitter wanted cp(1) working on
ntfs instead of mangling ntfs the way the PR title suggests). Yes,
mmap works on ntfs like it always has.
*) well, um, and in other places too ... uuuh ... no comments.
but I guess this works as long as in-kernel ntfs doesn't grow write
support.
To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/fs/ntfs/ntfs_subr.c
cvs rdiff -u -r1.78 -r1.79 src/sys/fs/ntfs/ntfs_vfsops.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/fs/ntfs/ntfs_subr.c
diff -u src/sys/fs/ntfs/ntfs_subr.c:1.42 src/sys/fs/ntfs/ntfs_subr.c:1.43
--- src/sys/fs/ntfs/ntfs_subr.c:1.42 Wed Mar 18 16:00:21 2009
+++ src/sys/fs/ntfs/ntfs_subr.c Tue Sep 1 15:16:41 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs_subr.c,v 1.42 2009/03/18 16:00:21 cegger Exp $ */
+/* $NetBSD: ntfs_subr.c,v 1.43 2009/09/01 15:16:41 pooka Exp $ */
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko ([email protected])
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.42 2009/03/18 16:00:21 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_subr.c,v 1.43 2009/09/01 15:16:41 pooka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -1036,6 +1036,7 @@
nfp->f_size = iep->ie_fsize;
nfp->f_allocated = iep->ie_fallocated;
nfp->f_flag |= FN_PRELOADED;
+ uvm_vnp_setsize(nvp, iep->ie_fsize);
} else {
error = ntfs_filesize(ntmp, nfp,
&nfp->f_size, &nfp->f_allocated);
@@ -1043,6 +1044,7 @@
vput(nvp);
goto fail;
}
+ uvm_vnp_setsize(nvp, nfp->f_size);
}
nfp->f_flag &= ~FN_VALID;
Index: src/sys/fs/ntfs/ntfs_vfsops.c
diff -u src/sys/fs/ntfs/ntfs_vfsops.c:1.78 src/sys/fs/ntfs/ntfs_vfsops.c:1.79
--- src/sys/fs/ntfs/ntfs_vfsops.c:1.78 Mon Jun 29 05:08:17 2009
+++ src/sys/fs/ntfs/ntfs_vfsops.c Tue Sep 1 15:16:41 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ntfs_vfsops.c,v 1.78 2009/06/29 05:08:17 dholland Exp $ */
+/* $NetBSD: ntfs_vfsops.c,v 1.79 2009/09/01 15:16:41 pooka Exp $ */
/*-
* Copyright (c) 1998, 1999 Semen Ustimenko
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.78 2009/06/29 05:08:17 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ntfs_vfsops.c,v 1.79 2009/09/01 15:16:41 pooka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -815,7 +815,7 @@
}
}
- uvm_vnp_setsize(vp, 0); /* XXX notused */
+ uvm_vnp_setsize(vp, fp->f_size); /* XXX: mess, cf. ntfs_lookupfile() */
VREF(ip->i_devvp);
*vpp = vp;
return (0);