Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/msdosfs more cross-compile friendly.
details: https://anonhg.NetBSD.org/src/rev/346bdb9d113c
branches: trunk
changeset: 784353:346bdb9d113c
user: christos <christos%NetBSD.org@localhost>
date: Sat Jan 26 16:51:51 2013 +0000
description:
more cross-compile friendly.
diffstat:
sys/fs/msdosfs/denode.h | 17 +++++++++++++----
sys/fs/msdosfs/msdosfs_conv.c | 21 ++++++++++++++++-----
sys/fs/msdosfs/msdosfs_fat.c | 10 +++++-----
sys/fs/msdosfs/msdosfs_lookup.c | 8 ++++----
sys/fs/msdosfs/msdosfsmount.h | 4 +++-
5 files changed, 41 insertions(+), 19 deletions(-)
diffs (215 lines):
diff -r 6a63144e63ca -r 346bdb9d113c sys/fs/msdosfs/denode.h
--- a/sys/fs/msdosfs/denode.h Sat Jan 26 16:50:46 2013 +0000
+++ b/sys/fs/msdosfs/denode.h Sat Jan 26 16:51:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: denode.h,v 1.21 2013/01/26 00:21:49 christos Exp $ */
+/* $NetBSD: denode.h,v 1.22 2013/01/26 16:51:51 christos Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -49,7 +49,15 @@
#ifndef _MSDOSFS_DENODE_H_
#define _MSDOSFS_DENODE_H_
+#ifdef _KERNEL
#include <miscfs/genfs/genfs_node.h>
+#else
+struct genfs_node {
+};
+struct vnode;
+struct msdosfsmount;
+struct buf;
+#endif
/*
* This is the pc filesystem specific portion of the vnode structure.
@@ -289,13 +297,14 @@
*/
struct componentname;
struct direntry;
+struct kauth_cred;
int msdosfs_update(struct vnode *, const struct timespec *,
const struct timespec *, int);
int createde(struct denode *, struct denode *,
struct denode **, struct componentname *);
-int deextend(struct denode *, u_long, kauth_cred_t);
+int deextend(struct denode *, u_long, struct kauth_cred *);
int deget(struct msdosfsmount *, u_long, u_long, struct denode **);
-int detrunc(struct denode *, u_long, int, kauth_cred_t);
+int detrunc(struct denode *, u_long, int, struct kauth_cred *);
int deupdat(struct denode *, int);
int doscheckpath(struct denode *, struct denode *);
int dosdirempty(struct denode *);
@@ -306,7 +315,7 @@
int removede(struct denode *, struct denode *);
int uniqdosname(struct denode *, struct componentname *, u_char *);
int findwin95(struct denode *);
-int msdosfs_gop_alloc(struct vnode *, off_t, off_t, int, kauth_cred_t);
+int msdosfs_gop_alloc(struct vnode *, off_t, off_t, int, struct kauth_cred *);
void msdosfs_gop_markupdate(struct vnode *, int);
void msdosfs_detimes(struct denode *, const struct timespec *,
const struct timespec *, const struct timespec *, int);
diff -r 6a63144e63ca -r 346bdb9d113c sys/fs/msdosfs/msdosfs_conv.c
--- a/sys/fs/msdosfs/msdosfs_conv.c Sat Jan 26 16:50:46 2013 +0000
+++ b/sys/fs/msdosfs/msdosfs_conv.c Sat Jan 26 16:51:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_conv.c,v 1.8 2013/01/26 00:21:49 christos Exp $ */
+/* $NetBSD: msdosfs_conv.c,v 1.9 2013/01/26 16:51:51 christos Exp $ */
/*-
* Copyright (C) 1995, 1997 Wolfgang Solfrank.
@@ -52,19 +52,22 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.8 2013/01/26 00:21:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.9 2013/01/26 16:51:51 christos Exp $");
/*
* System include files.
*/
#include <sys/param.h>
-#include <sys/systm.h>
#include <sys/time.h>
-#include <sys/kernel.h>
+#ifdef _KERNEL
#include <sys/dirent.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
#include <sys/vnode.h>
-#ifndef _KERNEL
+#else
#include <stdio.h>
+#include <dirent.h>
+#include <sys/queue.h>
#endif
/*
@@ -722,7 +725,9 @@
/*
* This works even though d_namlen is one byte!
*/
+#ifdef __NetBSD__
dp->d_namlen = (wep->weCnt&WIN_CNT) * WIN_CHARS;
+#endif
} else if (chksum != wep->weChksum)
chksum = -1;
if (chksum == -1)
@@ -740,8 +745,10 @@
for (cp = wep->wePart1, i = sizeof(wep->wePart1)/2; --i >= 0;) {
switch (*np++ = *cp++) {
case 0:
+#ifdef __NetBSD__
dp->d_namlen -= sizeof(wep->wePart2)/2
+ sizeof(wep->wePart3)/2 + i + 1;
+#endif
return chksum;
case '/':
np[-1] = 0;
@@ -762,7 +769,9 @@
for (cp = wep->wePart2, i = sizeof(wep->wePart2)/2; --i >= 0;) {
switch (*np++ = *cp++) {
case 0:
+#ifdef __NetBSD__
dp->d_namlen -= sizeof(wep->wePart3)/2 + i + 1;
+#endif
return chksum;
case '/':
np[-1] = 0;
@@ -783,7 +792,9 @@
for (cp = wep->wePart3, i = sizeof(wep->wePart3)/2; --i >= 0;) {
switch (*np++ = *cp++) {
case 0:
+#ifdef __NetBSD__
dp->d_namlen -= i + 1;
+#endif
return chksum;
case '/':
np[-1] = 0;
diff -r 6a63144e63ca -r 346bdb9d113c sys/fs/msdosfs/msdosfs_fat.c
--- a/sys/fs/msdosfs/msdosfs_fat.c Sat Jan 26 16:50:46 2013 +0000
+++ b/sys/fs/msdosfs/msdosfs_fat.c Sat Jan 26 16:51:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_fat.c,v 1.24 2013/01/26 00:21:49 christos Exp $ */
+/* $NetBSD: msdosfs_fat.c,v 1.25 2013/01/26 16:51:51 christos Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -52,19 +52,19 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_fat.c,v 1.24 2013/01/26 00:21:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_fat.c,v 1.25 2013/01/26 16:51:51 christos Exp $");
/*
* kernel include files.
*/
#include <sys/param.h>
-#include <sys/systm.h>
#include <sys/file.h>
#include <sys/mount.h> /* to define statvfs structure */
+#ifdef _KERNEL
#include <sys/errno.h>
+#include <sys/systm.h>
+#include <sys/kauth.h>
#include <sys/dirent.h>
-#include <sys/kauth.h>
-#ifdef _KERNEL
#include <sys/namei.h>
#include <sys/buf.h>
#include <sys/vnode.h> /* to define vattr structure */
diff -r 6a63144e63ca -r 346bdb9d113c sys/fs/msdosfs/msdosfs_lookup.c
--- a/sys/fs/msdosfs/msdosfs_lookup.c Sat Jan 26 16:50:46 2013 +0000
+++ b/sys/fs/msdosfs/msdosfs_lookup.c Sat Jan 26 16:51:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfs_lookup.c,v 1.28 2013/01/26 00:21:49 christos Exp $ */
+/* $NetBSD: msdosfs_lookup.c,v 1.29 2013/01/26 16:51:51 christos Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -52,16 +52,16 @@
#endif
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_lookup.c,v 1.28 2013/01/26 00:21:49 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_lookup.c,v 1.29 2013/01/26 16:51:51 christos Exp $");
#include <sys/param.h>
+
+#ifdef _KERNEL
#include <sys/systm.h>
#include <sys/mount.h>
#include <sys/kauth.h>
#include <sys/namei.h>
#include <sys/dirent.h>
-
-#ifdef _KERNEL
#include <sys/buf.h>
#include <sys/vnode.h>
#else
diff -r 6a63144e63ca -r 346bdb9d113c sys/fs/msdosfs/msdosfsmount.h
--- a/sys/fs/msdosfs/msdosfsmount.h Sat Jan 26 16:50:46 2013 +0000
+++ b/sys/fs/msdosfs/msdosfsmount.h Sat Jan 26 16:51:51 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: msdosfsmount.h,v 1.18 2013/01/26 00:21:49 christos Exp $ */
+/* $NetBSD: msdosfsmount.h,v 1.19 2013/01/26 16:51:51 christos Exp $ */
/*-
* Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -50,6 +50,7 @@
#ifndef _MSDOSFS_MSDOSFSMOUNT_H_
#define _MSDOSFS_MSDOSFSMOUNT_H_
+#ifndef MAKEFS
/*
* Arguments to mount MSDOS filesystems.
*/
@@ -67,6 +68,7 @@
mode_t dirmask; /* v2: mask to be applied for msdosfs perms */
int gmtoff; /* v3: offset from UTC in seconds */
};
+#endif
/*
* Msdosfs mount options:
Home |
Main Index |
Thread Index |
Old Index