Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makefs add debugging, fix warnings.
details: https://anonhg.NetBSD.org/src/rev/fdbd90636fea
branches: trunk
changeset: 784337:fdbd90636fea
user: christos <christos%NetBSD.org@localhost>
date: Sat Jan 26 00:31:49 2013 +0000
description:
add debugging, fix warnings.
diffstat:
usr.sbin/makefs/Makefile | 3 ++-
usr.sbin/makefs/msdos.h | 5 +++--
usr.sbin/makefs/msdos/msdosfs_vfsops.c | 9 +++++----
usr.sbin/makefs/msdos/msdosfs_vnops.c | 10 ++++++----
4 files changed, 16 insertions(+), 11 deletions(-)
diffs (118 lines):
diff -r d4eda06057dd -r fdbd90636fea usr.sbin/makefs/Makefile
--- a/usr.sbin/makefs/Makefile Sat Jan 26 00:21:49 2013 +0000
+++ b/usr.sbin/makefs/Makefile Sat Jan 26 00:31:49 2013 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.33 2013/01/23 22:47:18 christos Exp $
+# $NetBSD: Makefile,v 1.34 2013/01/26 00:31:49 christos Exp $
#
WARNS?= 5
@@ -18,6 +18,7 @@
MTREESRC= ${NETBSDSRCDIR}/usr.sbin/mtree
CPPFLAGS+= -I${.CURDIR} -I${MKNODSRC} -I${MTREESRC} -DMAKEFS
+CPPFLAGS+= -DMSDOSFS_DEBUG
.PATH: ${MKNODSRC} ${MTREESRC}
.include "${.CURDIR}/cd9660/Makefile.inc"
diff -r d4eda06057dd -r fdbd90636fea usr.sbin/makefs/msdos.h
--- a/usr.sbin/makefs/msdos.h Sat Jan 26 00:21:49 2013 +0000
+++ b/usr.sbin/makefs/msdos.h Sat Jan 26 00:31:49 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdos.h,v 1.1 2013/01/26 00:20:40 christos Exp $ */
+/* $NetBSD: msdos.h,v 1.2 2013/01/26 00:31:49 christos Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -33,9 +33,10 @@
*/
struct vnode;
+struct denode;
struct msdosfsmount *msdosfs_mount(struct vnode *, int);
int msdosfs_root(struct msdosfsmount *, struct vnode *);
-struct denode * msdosfs_mkfile(const char *, struct denode *, fsnode *);
+struct denode *msdosfs_mkfile(const char *, struct denode *, fsnode *);
struct denode *msdosfs_mkdire(const char *, struct denode *, fsnode *);
diff -r d4eda06057dd -r fdbd90636fea usr.sbin/makefs/msdos/msdosfs_vfsops.c
--- a/usr.sbin/makefs/msdos/msdosfs_vfsops.c Sat Jan 26 00:21:49 2013 +0000
+++ b/usr.sbin/makefs/msdos/msdosfs_vfsops.c Sat Jan 26 00:31:49 2013 +0000
@@ -50,7 +50,7 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.1 2013/01/26 00:20:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vfsops.c,v 1.2 2013/01/26 00:31:50 christos Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -71,9 +71,10 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
+
+#include "makefs.h"
#include "msdos.h"
#include "mkfs_msdos.h"
-#define NOCRED NULL
#ifdef MSDOSFS_DEBUG
#define DPRINTF(a) printf a
@@ -97,7 +98,7 @@
uint64_t psize = m->create_size;
unsigned secsize = 512;
- if ((error = bread(devvp, 1, secsize, NOCRED, 0, &bp)) != 0)
+ if ((error = bread(devvp, 1, secsize, NULL, 0, &bp)) != 0)
goto error_exit;
bsp = (union bootsector *)bp->b_data;
@@ -327,7 +328,7 @@
* padded at the end or in the middle?
*/
if ((error = bread(devvp, de_bn2kb(pmp, pmp->pm_fsinfo),
- pmp->pm_BytesPerSec, NOCRED, 0, &bp)) != 0)
+ pmp->pm_BytesPerSec, NULL, 0, &bp)) != 0)
goto error_exit;
fp = (struct fsinfo *)bp->b_data;
if (!memcmp(fp->fsisig1, "RRaA", 4)
diff -r d4eda06057dd -r fdbd90636fea usr.sbin/makefs/msdos/msdosfs_vnops.c
--- a/usr.sbin/makefs/msdos/msdosfs_vnops.c Sat Jan 26 00:21:49 2013 +0000
+++ b/usr.sbin/makefs/msdos/msdosfs_vnops.c Sat Jan 26 00:31:49 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_vnops.c,v 1.1 2013/01/26 00:20:40 christos Exp $ */
+/* $NetBSD: msdosfs_vnops.c,v 1.2 2013/01/26 00:31:50 christos Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -48,7 +48,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.1 2013/01/26 00:20:40 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_vnops.c,v 1.2 2013/01/26 00:31:50 christos Exp $");
#include <sys/param.h>
#include <sys/mman.h>
@@ -115,7 +115,8 @@
cn.cn_namelen = strlen(node->name);
#ifdef MSDOSFS_DEBUG
- printf("msdosfs_create(cn %s, vap 0%o\n", node->name, st->st_mode);
+ printf("msdosfs_create(name %s, mode 0%o size %zu\n", node->name,
+ st->st_mode, (size_t)st->st_size);
#endif
/*
@@ -197,7 +198,8 @@
if ((fd = open(path, O_RDONLY)) == -1)
err(1, "open %s", path);
- if ((dat = mmap(0, nsize, PROT_READ, MAP_FILE, fd, 0)) == MAP_FAILED)
+ if ((dat = mmap(0, nsize, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0))
+ == MAP_FAILED)
err(1, "mmap %s", node->name);
close(fd);
Home |
Main Index |
Thread Index |
Old Index