Module Name:    src
Committed By:   pooka
Date:           Tue Nov 30 15:39:27 UTC 2010

Modified Files:
        src/sys/rump/librump/rumpvfs: rump_vfs.c

Log Message:
fix broken rototill


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/rump/librump/rumpvfs/rump_vfs.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/rump/librump/rumpvfs/rump_vfs.c
diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.61 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.62
--- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.61	Tue Nov 30 10:48:27 2010
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c	Tue Nov 30 15:39:27 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_vfs.c,v 1.61 2010/11/30 10:48:27 dholland Exp $	*/
+/*	$NetBSD: rump_vfs.c,v 1.62 2010/11/30 15:39:27 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.61 2010/11/30 10:48:27 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump_vfs.c,v 1.62 2010/11/30 15:39:27 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -174,19 +174,29 @@
 	vfs_shutdown();
 }
 
+struct rumpcn {
+	struct componentname rcn_cn;
+	char *rcn_path;
+};
+
 struct componentname *
 rump_makecn(u_long nameiop, u_long flags, const char *name, size_t namelen,
 	kauth_cred_t creds, struct lwp *l)
 {
+	struct rumpcn *rcn;
 	struct componentname *cnp;
 	const char *cp = NULL;
 
-	cnp = kmem_zalloc(sizeof(struct componentname), KM_SLEEP);
+	rcn = kmem_zalloc(sizeof(*rcn), KM_SLEEP);
+	cnp = &rcn->rcn_cn;
+
+	rcn->rcn_path = PNBUF_GET();
+	strlcpy(rcn->rcn_path, name, MAXPATHLEN);
+	cnp->cn_nameptr = rcn->rcn_path;
 
 	cnp->cn_nameiop = nameiop;
 	cnp->cn_flags = flags;
 
-	cnp->cn_nameptr = name;
 	cnp->cn_namelen = namelen;
 	cnp->cn_hash = namei_hash(name, &cp);
 
@@ -198,10 +208,12 @@
 void
 rump_freecn(struct componentname *cnp, int flags)
 {
+	struct rumpcn *rcn = (void *)cnp;
 
 	if (flags & RUMPCN_FREECRED)
 		rump_cred_put(cnp->cn_cred);
 
+	PNBUF_PUT(rcn->rcn_path);
 	kmem_free(cnp, sizeof(*cnp));
 }
 

Reply via email to