Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/ntfs Set vnode size after creation(*). Fixes cp(1) f...



details:   https://anonhg.NetBSD.org/src/rev/03958f7bbe9c
branches:  trunk
changeset: 747077:03958f7bbe9c
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Sep 01 15:16:41 2009 +0000

description:
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.

diffstat:

 sys/fs/ntfs/ntfs_subr.c   |  6 ++++--
 sys/fs/ntfs/ntfs_vfsops.c |  6 +++---
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (61 lines):

diff -r 9c992af1328f -r 03958f7bbe9c sys/fs/ntfs/ntfs_subr.c
--- a/sys/fs/ntfs/ntfs_subr.c   Tue Sep 01 12:23:36 2009 +0000
+++ b/sys/fs/ntfs/ntfs_subr.c   Tue Sep 01 15:16:41 2009 +0000
@@ -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 (semenu%FreeBSD.org@localhost)
@@ -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;
diff -r 9c992af1328f -r 03958f7bbe9c sys/fs/ntfs/ntfs_vfsops.c
--- a/sys/fs/ntfs/ntfs_vfsops.c Tue Sep 01 12:23:36 2009 +0000
+++ b/sys/fs/ntfs/ntfs_vfsops.c Tue Sep 01 15:16:41 2009 +0000
@@ -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);



Home | Main Index | Thread Index | Old Index